PUM_Site::add_core_content_filters()

Hook core filters into pum_popup_content.


Description Description


Source Source

File: classes/Site.php

	public static function add_core_content_filters() {
		global $wp_version;

		/**
		 * Copied from wp-includes/class-wp-embed.php:32:40
		 *
		 * @note Hack to get the [embed] shortcode to run before wpautop().
		 *
		 * @since 1.4 hooks & filters
		 */
		add_filter( 'pum_popup_content', array( $GLOBALS['wp_embed'], 'run_shortcode' ), 8 );
		add_filter( 'pum_popup_content', array( $GLOBALS['wp_embed'], 'autoembed' ), 8 );

		/**
		 * Copied & from wp-includes/default-filters.php:141:144.
		 *
		 * Format WordPress.
		 *
		 * @since 1.10.0
		 * @sinceWP 5.4
		 */
		foreach ( array( 'pum_popup_content', 'pum_popup_title' ) as $filter ) {
			add_filter( $filter, 'capital_P_dangit', 11 );
		}

		/**
		 * Copied & from wp-includes/default-filters.php:172:178.
		 *
		 * @since 1.10.0
		 * @sinceWP 5.4
		 */
		if ( version_compare( $wp_version, '5.0.0', '>=' ) ) {
			add_filter( 'pum_popup_content', array( __CLASS__, 'do_blocks' ), 9 );
		}
		add_filter( 'pum_popup_content', 'wptexturize' );
		add_filter( 'pum_popup_content', 'convert_smilies', 20 );
		add_filter( 'pum_popup_content', 'wpautop' );
		add_filter( 'pum_popup_content', 'shortcode_unautop' );
		add_filter( 'pum_popup_content', 'prepend_attachment' );
		if ( version_compare( $wp_version, '5.5', '>=' ) ) {
			add_filter( 'pum_popup_content', 'wp_filter_content_tags' );
		} else {
			add_filter( 'pum_popup_content', 'wp_make_content_images_responsive' );
		}

		/**
		 * Copied & from wp-includes/default-filters.php:172:178.
		 *
		 * @note Shortcodes must run AFTER wpautop().
		 *
		 * @since 1.10.0
		 * @sinceWP 5.4
		 */
		$do_shortcode_handler = pum_get_option( 'disable_shortcode_compatibility_mode' ) ? 'do_shortcode' : array( 'PUM_Helpers', 'do_shortcode' );
		add_filter( 'pum_popup_content', $do_shortcode_handler, 11 );
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.