bbp_topic_content_autoembed()

Check if autoembeds are enabled and hook them in if so

Description

Source

File: bp-forums/topics/functions.php

function bbp_topic_content_autoembed() {
	global $wp_embed;

	if ( bbp_use_autoembed() && is_a( $wp_embed, 'WP_Embed' ) ) {
		add_filter( 'bbp_get_topic_content', array( $wp_embed, 'autoembed' ), 2 );
		// WordPress is not able to convert URLs to oembed if URL is in paragraph.
		add_filter( 'bbp_get_reply_content', 'bbp_topic_content_autoembed_paragraph', 99999, 1 );
	}
}

Changelog

Changelog
Version Description
bbPress (r3752) Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.