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
This commit is contained in:
Helen Hou-Sandi 2015-10-06 14:33:27 +00:00
parent 719f51b19d
commit b1b51495f3
1 changed files with 8 additions and 5 deletions

View File

@ -530,13 +530,16 @@ function shortcode_atts( $pairs, $atts, $shortcode = '' ) {
* The third parameter, $shortcode, is the name of the shortcode. * The third parameter, $shortcode, is the name of the shortcode.
* *
* @since 3.6.0 * @since 3.6.0
* @since 4.4.0 Added the `$shortcode` parameter.
* *
* @param array $out The output array of shortcode attributes. * @param array $out The output array of shortcode attributes.
* @param array $pairs The supported attributes and their defaults. * @param array $pairs The supported attributes and their defaults.
* @param array $atts The user defined shortcode attributes. * @param array $atts The user defined shortcode attributes.
* @param string $shortcode The shortcode name.
*/ */
if ( $shortcode ) if ( $shortcode ) {
$out = apply_filters( "shortcode_atts_{$shortcode}", $out, $pairs, $atts ); $out = apply_filters( "shortcode_atts_{$shortcode}", $out, $pairs, $atts, $shortcode );
}
return $out; return $out;
} }