[wp-trac] [WordPress Trac] #49225: Fix summary for shortcode_atts_{$shortcode}
WordPress Trac
noreply at wordpress.org
Sat Jan 18 22:21:17 UTC 2020
#49225: Fix summary for shortcode_atts_{$shortcode}
--------------------------+-----------------------------
Reporter: glebkema | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Shortcodes | Version:
Severity: normal | Keywords:
Focuses: docs |
--------------------------+-----------------------------
In the `shortcode_atts()` function the `shortcode_atts_{$shortcode}`
filter is described as:
{{{#!php
/**
* Filters a shortcode's default attributes.
*
}}}
However, this filter does not affect the default values. Instead, it
changes the output values of the attributes after they are combined with
the default values:
{{{#!php
* @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, $shortcode );
}
}}}
I suggest to edit the filter summary, for example, like this:
{{{#!php
/**
* Filters an array of shortcode attributes.
*
}}}
Or even shorter:
{{{#!php
/**
* Filters shortcode attributes.
*
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49225>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list