shortcode_atts

SummerySummery

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

Syntax

shortcode_atts( array $pairs, array $atts, string $shortcode = '' )

DescriptionDescription

The pairs should be considered to be all of the attributes which are supported by the caller and given as a list. The returned attributes will only contain the attributes in the $pairs list.

If the $atts list has unsupported attributes, then they will be ignored and removed from the final returned list.

ParametersParameters

$pairs

(array) (Required) Entire list of supported attributes and their defaults.

$atts

(array) (Required) User defined attributes in shortcode tag.

$shortcode

(string) (Optional) The name of the shortcode, provided for context to enable filtering

Default value: ''

ReturnReturn

(array) Combined and filtered attribute list.

SourceSource

File: wp-includes/shortcodes.php


			

ChangelogChangelog

Changelog
Version Description
2.5.0 Introduced.
Scroll to Top