From b1b51495f30d87f9223514d0bc5b8f1b561509df Mon Sep 17 00:00:00 2001 From: Helen Hou-Sandi Date: Tue, 6 Oct 2015 14:33:27 +0000 Subject: [PATCH] Shortcodes: Pass the name as context for `shortcode_atts_{$shortcode}`. props mattheu. fixes #34167. git-svn-id: https://develop.svn.wordpress.org/trunk@34868 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/shortcodes.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/wp-includes/shortcodes.php b/src/wp-includes/shortcodes.php index 3959818575..0042877e17 100644 --- a/src/wp-includes/shortcodes.php +++ b/src/wp-includes/shortcodes.php @@ -530,13 +530,16 @@ function shortcode_atts( $pairs, $atts, $shortcode = '' ) { * The third parameter, $shortcode, is the name of the shortcode. * * @since 3.6.0 + * @since 4.4.0 Added the `$shortcode` parameter. * - * @param array $out The output array of shortcode attributes. - * @param array $pairs The supported attributes and their defaults. - * @param array $atts The user defined shortcode attributes. + * @param array $out The output array of shortcode attributes. + * @param array $pairs The supported attributes and their defaults. + * @param array $atts The user defined shortcode attributes. + * @param string $shortcode The shortcode name. */ - if ( $shortcode ) - $out = apply_filters( "shortcode_atts_{$shortcode}", $out, $pairs, $atts ); + if ( $shortcode ) { + $out = apply_filters( "shortcode_atts_{$shortcode}", $out, $pairs, $atts, $shortcode ); + } return $out; }