Is there a way to get all parameters in the WordPress shortcode?
For example,
function bartag_func( $atts ) {
$a = shortcode_atts(
array(
'foo' => 'something',
'bar' => 'something else',
),
$atts);
return "foo = {$a['foo']}";
}
add_shortcode('bartag', 'bartag_func');
Here [bartag]
is shortcode.
Is there a way to know the values of shortcode_atts
or value of foo
bar
, etc.?
Is there a way to get all variable values inside the bartag_func
?
You can use this function to get all values from shortcode: