Closed jerclarke closed 8 years ago
Thank you for considering this patch!
Here is a very simple example of the kind of filter it enables (my actual use is much more elaborate):
function gv_expand_shortcode_filter_atts( $out, $pairs, $atts, $shortcode) {
// Disable the title= attribute
$out['notitle'] = true;
return $out;
}
add_filter('shortcode_atts_expand', 'gv_expand_shortcode_filter_atts', 10, 4);
Thanks baden!
shortcode_atts() merges the passed-in values and the defaults for the shortcode. It's third argument is $shortcode, which is supposed to be the slug of the shortcode. It's optional, but if it's missing then no one can filter the arguments with the "shortcodeatts{$shortcode}" filter.
This patch just adds the third argument so I can set a bunch of defaults for the [expand] shortcode on my site.