Validate::whitelist_shortcodes( array $m )

Description #

Whitelist shortcodes in content.

Parameters #

  • $m
    array (Required) Preg matches.

Source #

File: lib/class-validate.php

	private static function whitelist_shortcodes( $m ) {
		/**
		 * Filter for overriding allowed shortcodes.
		 *
		 * @since 4.1.8
		 */
		$allowed_shortcodes = apply_filters( 'ap_allowed_shortcodes', array() );

		// if not allowed shortcode then change square brackets.
		if ( ! in_array( $m[2], $allowed_shortcodes, true ) ) {
			return ap_replace_square_bracket( $m[0] );
		}

		return $m[0];
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment