diff --git a/wp-includes/shortcodes.php b/wp-includes/shortcodes.php index e276708449..b2aad3dc4d 100644 --- a/wp-includes/shortcodes.php +++ b/wp-includes/shortcodes.php @@ -321,6 +321,24 @@ function do_shortcode_tag( $m ) { return $m[0]; } + /** + * Filters whether to call a shortcode callback. + * + * Passing a truthy value to the filter will effectively short-circuit the + * shortcode generation process, returning that value instead. + * + * @since 4.7.0 + * + * @param bool|string $return Short-circuit return value. Either false or the value to replace the shortcode with. + * @param string $tag Shortcode name. + * @param array $attr Shortcode attributes array, + * @param array $m Regular expression match array. + */ + $return = apply_filters( 'pre_do_shortcode_tag', false, $tag, $attr, $m ); + if ( false !== $return ) { + return $return; + } + if ( isset( $m[5] ) ) { // enclosing tag - extra parameter return $m[1] . call_user_func( $shortcode_tags[$tag], $attr, $m[5], $tag ) . $m[6]; diff --git a/wp-includes/version.php b/wp-includes/version.php index 9b68cdc5e7..dcd8eb4ee1 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-alpha-38505'; +$wp_version = '4.7-alpha-38506'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.