Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/shortcode parse atts


Accepts a string of shortcode attributes and returns an associative array of key/value pairs.

The attributes list has the attribute name as the key and the value of the attribute as the value in the key/value pair. This allows for easier retrieval of the attributes, since all attributes have to be known.


<?php shortcode_parse_atts$text ); ?>


(string) (required) The shortcode arguments.
Default: None

Return Values

An array with attributes and their values, or a string.


Used to parse shortcode attributes. Includes attributes that the shortcode doesn't support. Use shortcode_atts to specify specific attributes and only return those.

Change Log

Since: 2.5

Source File

shortcode_parse_atts() is located in wp-includes/shortcodes.php.


Shortcode API

See also index of Function Reference and index of Template Tags.