pre_do_shortcode_tag хук-фильтрWP 4.7.0

Filters whether to call a shortcode callback.

Returning a non-false value from filter will short-circuit the shortcode generation process, returning that value instead.

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

add_filter( 'pre_do_shortcode_tag', 'wp_kama_pre_do_shortcode_tag_filter', 10, 4 );

/**
 * Function for `pre_do_shortcode_tag` filter-hook.
 * 
 * @param false|string $output Short-circuit return value. Either false or the value to replace the shortcode with.
 * @param string       $tag    Shortcode name.
 * @param array|string $attr   Shortcode attributes array or the original arguments string if it cannot be parsed.
 * @param array        $m      Regular expression match array.
 *
 * @return false|string
 */
function wp_kama_pre_do_shortcode_tag_filter( $output, $tag, $attr, $m ){

	// filter...
	return $output;
}
$output(false|строка)
Short-circuit return value. Either false or the value to replace the shortcode with.
$tag(строка)
Shortcode name.
$attr(массив|строка)
Shortcode attributes array or the original arguments string if it cannot be parsed.
$m(массив)
Regular expression match array.

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

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

Где вызывается хук

do_shortcode_tag()
pre_do_shortcode_tag
wp-includes/shortcodes.php 426
$return = apply_filters( 'pre_do_shortcode_tag', false, $tag, $attr, $m );

Где используется хук в WordPress

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