Shortcode messes up attributes
-
Hi.
I am using Joe Tan’s flickr plugin which now supports shortcodes and the attribute parsing doesn’t seem to work on one of my testing servers.
The shortcode is like this:
[flickr album="72157604931449442" num="14"]
And the beginning of function that handles it:
function getShortCodeHTML($attribs=false, $content=false) { global $post; extract(shortcode_atts(array( 'album' => null, 'tag' => null, 'num' => 5, 'size' => 'Square', 'scale' => 1, ), $attribs)); echo $album.' '.$num;
For debugging, I’ve added an echo of the album and num attribute right after the attribute extraction.
The function does it’s job and works well on my local server (which is 2.5.0 still).
72157604931449442 14
On the remote server (2.5.1), it ignores the space that separates them and goes like this:
”72157604931449442” num=”14” 5
So it takes everything it gets, including the quotes, after declaring the album attribute.
How can I fix this?
- The topic ‘Shortcode messes up attributes’ is closed to new replies.