What is the $atts parameter in shortcode_atts()?

Question

The WordPress developers reference page for shortcode_atts() states:

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

But I do not understand this definition.

For example, in this piece of the WP Frontend Profile plugin:

$atts = shortcode_atts(
     [
     'role' => '',
     ],
     $atts
);

As far as I understand, shortcode_atts() is used to create a map between the shortcode attributes and a PHP array.

But I don’t see what the purpose of the $atts parameter is.

0
Alvaro Franz 4 years 2020-05-22T05:10:35-05:00 0 Answers 89 views 0

Leave an answer

Browse
Browse