WPDev.one
Core Function
View Source on Trac ↗

shortcode_atts()

shortcode_atts( mixed $pairs, mixed $atts, mixed $shortcode = '' )

Combines user attributes with known attributes and fill in defaults when needed.

Parameters 2 required

Name / Type Description
$pairs
array

Entire list of supported attributes and their defaults.

Required
$atts
array

User defined attributes in shortcode tag.

Required
$shortcode
string

Optional. The name of the shortcode, provided for context to enable filtering

Return Value

(array)
Combined and filtered attribute list.

Function Information

Since Version
2.5.0
Source File
wp-includes/shortcodes.php
Advertisement