Disabling oEmbed support in BuddyPress Activity
If you want to disable oEmbed(e.g youtube videos, vimeo videos etc embedding) support in BuddyPress activity, you can simply put the following code in your bp-custom.php and it will do that.
1 | add_filter( 'bp_use_oembed_in_activity', '__return_false' ); |
Yup! That's all you need to disable oEmbed support in the BuddyPress activity.
Bonus:- Disable clickable links in activity.
Don't want to allow users to link to urls from the activity? No problem. You can put the following code in your bp-custom.php to disable linking from activity contents.
1 2 3 4 5 6 7 8 9 10 11 | function buddydev_disable_activity_links() { remove_filter( 'bp_get_activity_action', 'make_clickable', 9 ); remove_filter( 'bp_get_activity_content_body', 'make_clickable', 9 ); remove_filter( 'bp_get_activity_content', 'make_clickable', 9 ); remove_filter( 'bp_get_activity_parent_content', 'make_clickable', 9 ); remove_filter( 'bp_get_activity_latest_update', 'make_clickable', 9 ); remove_filter( 'bp_get_activity_latest_update_excerpt', 'make_clickable', 9 ); } add_action( 'bp_init', 'buddydev_disable_activity_links' ); |
That's all for today. Have fun!