Opened 8 years ago
Closed 7 years ago
#7395 closed defect (bug) (wontfix)
embed_oembed_html not used on sitewide activity?
Reported by: | petervandoorn | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 1.5 |
Component: | Core | Keywords: | has-patch |
Cc: |
Description
I’m using this code ( from http://wpsites.org/how-to-make-oembed-videos-responsive-10520 ) to filter WordPress’s oEmbed to make YouTube videos responsive.
add_filter('embed_oembed_html', 'ct_wrap_embed_container', 10, 3);
function ct_wrap_embed_container($html, $url, $attr) {
return "<div class=\"responsive-video\">".$html."</div>";
}
It works a treat in bbPress forum topic views, but it isn’t working on the BP site-wide activity feed.
This Codex page https://codex.buddypress.org/getting-started/embeds/ says that WP’s native oEmbed functionality is used since BP 1.5, so I would expect it to work.
Thanks
Attachments (1)
Change History (10)
#2
@
8 years ago
Hi Paul
I think the solution would be for BuddyPress to apply filters attached to the WordPress hook embed_oembed_html
?
#3
@
8 years ago
- Component changed from (not sure) to Core
- Version changed from 2.7.2 to 1.5
BP doesn't use the 'embed_oembed_html'
filter.
I originally did use this filter when implementing embeds into BuddyPress, but it was decided that we should prefix the filter name with 'bp_'
.
Try the 'bp_embed_oembed_html'
filter instead.
#4
@
8 years ago
Try the 'bp_embed_oembed_html' filter instead.
And there we have it. Thanks r-a-y :)
#5
@
8 years ago
- Milestone changed from Awaiting Review to 2.9
@r-a-y How do you feel about calling this action in addition to ours? I ended up doing this for the email code with wp_mail
, and I think it'd help more here, too.
#6
@
7 years ago
@r-a-y How do you feel about calling this action in addition to ours? I ended up doing this for the email code with wp_mail, and I think it'd help more here, too.
The problem is the 'embed_oembed_html'
filter doesn't quite have the same filter signature. The 'embed_oembed_html'
filter has a fourth parameter used for the WP post ID, but we do not utilize the item ID in our 'bp_embed_oembed_html'
filter -- we use the raw shortcode attributes instead.
In 01.patch
, I've implemented the 'embed_oembed_html'
filter, but for the fourth parameter, I've just passed integer 0
in its place.
I'll leave it up to you if we want to commit this or not as I don't really have any strong opinions about this ticket.
Hi. What isn't working, exactly?
Are the videos appearing in the activity stream? If so, does your wrapper HTML appear around the activity item? If so, are you reporting this is basically a CSS/responsive issue?