Title: Shortcode messes up attributes
Last modified: August 19, 2016

---

# Shortcode messes up attributes

 *  [GreenDude](https://wordpress.org/support/users/greendude/)
 * (@greendude)
 * [18 years, 1 month ago](https://wordpress.org/support/topic/shortcode-messes-up-attributes/)
 * Hi.
 * I am using [Joe Tan’s flickr plugin](http://tantannoodles.com/toolkit/photo-album/)
   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?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [GreenDude](https://wordpress.org/support/users/greendude/)
 * (@greendude)
 * [18 years, 1 month ago](https://wordpress.org/support/topic/shortcode-messes-up-attributes/#post-761364)
 * Anyone? 🙂
 *  [iridiax](https://wordpress.org/support/users/iridiax/)
 * (@iridiax)
 * [18 years, 1 month ago](https://wordpress.org/support/topic/shortcode-messes-up-attributes/#post-761374)
 * Try the page below for help with your plugin:
 * [http://flickr.com/groups/tantannoodles/discuss/](http://flickr.com/groups/tantannoodles/discuss/)
 *  Thread Starter [GreenDude](https://wordpress.org/support/users/greendude/)
 * (@greendude)
 * [18 years, 1 month ago](https://wordpress.org/support/topic/shortcode-messes-up-attributes/#post-761387)
 * Yes, I know it well, but I’ve separated the problem form the plugin. The function
   is just like the codex model.
 *  [joetan](https://wordpress.org/support/users/joetan/)
 * (@joetan)
 * [18 years, 1 month ago](https://wordpress.org/support/topic/shortcode-messes-up-attributes/#post-761429)
 * I took a look at the code, and it looks like what’s happening is that there’s
   some sort of non-standard whitespace character getting inserted between the first
   and second parameter.
 * This causes the WP shortcode attribute parsing routine to mash together the attributes…
 * eg
 * [flickr album=123456 num=10]
 * should give this attribs:
 * $album = 123456
    $num = 10
 * But because of the non-standard whitespace between “123456” and “num” this happens:
 * $album = “123456 num=10”
 * Perhaps this is due to the fact that GreenDude’s blog uses international characters?
   Or he somehow entered in a “space” that’s slightly different….
 * This is on a WP 2.5.1 installation.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Shortcode messes up attributes’ is closed to new replies.

## Tags

 * [flickr plugin](https://wordpress.org/support/topic-tag/flickr-plugin/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 3 participants
 * Last reply from: [joetan](https://wordpress.org/support/users/joetan/)
 * Last activity: [18 years, 1 month ago](https://wordpress.org/support/topic/shortcode-messes-up-attributes/#post-761429)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
