diff --git a/wp-includes/shortcodes.php b/wp-includes/shortcodes.php index b2aad3dc4d..f0523622cc 100644 --- a/wp-includes/shortcodes.php +++ b/wp-includes/shortcodes.php @@ -339,13 +339,21 @@ function do_shortcode_tag( $m ) { 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]; - } else { - // self-closing tag - return $m[1] . call_user_func( $shortcode_tags[$tag], $attr, null, $tag ) . $m[6]; - } + $content = isset( $m[5] ) ? $m[5] : null; + + $output = $m[1] . call_user_func( $shortcode_tags[ $tag ], $attr, $content, $tag ) . $m[6]; + + /** + * Filters the output created by a shortcode callback. + * + * @since 4.7.0 + * + * @param string $output Shortcode output. + * @param string $tag Shortcode name. + * @param array $attr Shortcode attributes array, + * @param array $m Regular expression match array. + */ + return apply_filters( 'do_shortcode_tag', $output, $tag, $attr, $m ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index ba9f691c7d..e6cb70a524 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-alpha-38712'; +$wp_version = '4.7-alpha-38713'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.