The What
Syntax
array shortcode_atts ( array $default_attributes, array $specified_attributes, string $shortcode_name = '' );
Description
This WordPress function merges (combines) the specified shortcode attributes (passed in with the shortcode itself) with the default attributes. It also fires a filter event shortcode_atts_{$shortcode_name}
when the third parameter is provided. This filter allows you to change the array that is returned from the function.
Parameters
default_attributes
- The default attributes with the associated default values.
default_value
- The attributes passed in from the shortcode, as specified by the user in the content.
shortcode_name
- optional The name of this shortcode, which is used to fire the filter
shortcode_atts_{$shortcode_name}
. The default value is an empty string.
Return Values
Returns an array of merged attributes.
Who needs copy/paste? Right. Writing code from scratch is fun!
More coming soon…keep checking back.