Open slaFFik opened 9 years ago
Reference to Buddypress Support Ticket; https://buddypress.org/support/topic/bp-2-2-update-broke-auto-embeds-on-bp-groups-extras-pages/
Hi @slaFFik was wondering if you'd had a chance to reproduce this issue. An update, I did notice if you go to view the gpage from wp-admin and you go to it outside a group that the autoembed is working. Example Path - ?gpages=2015-connecttherapy-series-course-prep/thoracic-ring-taping Whereas if you go to the gpage through the group this is where the autoembed is broken. Example Path - /groups/2015-connecttherapy-series-course-prep/gpages/thoracic-ring-taping/ So it's specific to Buddypress fairly frustrating as I can't update Buddypress due to this, but the Buddypress update fixes a completely unrelated issue which is why I want to move forward with it. I tried to see what differences are there between the buddypress versions with no luck. I'm hoping you'll have better luck with investigation. The diff I'm looking at - https://github.com/buddypress/BuddyPress/compare/2.1.1...2.2.1#files_bucket Appreciate any insight you can shed. Thank you
Hi @slaFFik I wanted to share my findings with you.
I created a support post for BP; https://buddypress.org/support/topic/does-buddypress-disable-autoembed-and-other-the_content-filter-actions/#post-253953
It holds my solution. Seems the wp_embed only works on posts which is why it functions when you view the post outside the group. I tried the buddypress()->embed->autoembed and buddypress()->embed->run_shortcode without success.
Finally with help from @r-a-y I found all embeds and shortcodes with BP_Media_Extractor, looped through them to run wp_oembed_get and do_shortcode, storing rendering in groupmeta to cache and replaced into the contents and finally ran wpautop on the results.
Hopefully this helps with implementing on Group Pages.
One note from @r-a-y was his bp_core_extract_media_from_content function will be implemented into Buddypress 2.6 so may want to wait for that release to take advantage of it, although I don't believe it will return shortcodes.
Let me know if you need any assistance.
Cheers
I just upgraded to Buddypress 2.2 and found the Group Pages which had vimeo links on them which previously auto-embedded are now just showing as plain text. Wanted to raise to your attention, but am also opening a ticket with Buddypress.