shortcode_atts defaults are not working
-
I have this code in a shortcode that I’m creating:
extract( shortcode_atts( array( 'id' => '', 'size' => '1/2', 'group' => '', ), $atts ) );
Everything seems to work fine but for some reason the shortcode_atts function is not setting up the defaults.
So when I try something like:
$size = $atts['size'];
I get a PHP notice Notice: Undefined index: size in…
I’m using the shortcode like this: [media id=81]
Any ideas? (or known bugs?)
I’m working on the latest version (3.3.1)
I
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘shortcode_atts defaults are not working’ is closed to new replies.