acf_field_wysiwyg::add_filters()publicACF 5.4.0

add_filters

This function will add filters to acf_the_content

Метод класса: acf_field_wysiwyg{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$acf_field_wysiwyg = new acf_field_wysiwyg();
$acf_field_wysiwyg->add_filters();

Список изменений

С версии 5.4.0 Введена.

Код acf_field_wysiwyg::add_filters() ACF 6.0.4

function add_filters() {

	// WordPress 5.5 introduced new function for applying image tags.
	$wp_filter_content_tags = function_exists( 'wp_filter_content_tags' ) ? 'wp_filter_content_tags' : 'wp_make_content_images_responsive';

	// Mimic filters added to "the_content" in "wp-includes/default-filters.php".
	add_filter( 'acf_the_content', 'capital_P_dangit', 11 );
	// add_filter( 'acf_the_content', 'do_blocks', 9 ); Not yet supported.
	add_filter( 'acf_the_content', 'wptexturize' );
	add_filter( 'acf_the_content', 'convert_smilies', 20 );
	add_filter( 'acf_the_content', 'wpautop' );
	add_filter( 'acf_the_content', 'shortcode_unautop' );
	// add_filter( 'acf_the_content', 'prepend_attachment' ); Causes double image on attachment page.
	add_filter( 'acf_the_content', $wp_filter_content_tags );
	add_filter( 'acf_the_content', 'do_shortcode', 11 );

	// Mimic filters added to "the_content" in "wp-includes/class-wp-embed.php"
	if ( isset( $GLOBALS['wp_embed'] ) ) {
		add_filter( 'acf_the_content', array( $GLOBALS['wp_embed'], 'run_shortcode' ), 8 );
		add_filter( 'acf_the_content', array( $GLOBALS['wp_embed'], 'autoembed' ), 8 );
	}
}