Mark on WordPress

WordPress 2.5.1: Shortcodes updates

Posted in wordpress by Mark Jaquith on April 25th, 2008

WordPress 2.5.1 is out, with a ton of little bug fixes and one important security fix. Go upgrade your 2.5 blogs now.

One area that has changed is shortcodes, those little square bracket shortcuts like [gallery]. In WP 2.5, those were processed before paragraphs were auto-created and quotes were curled. This lead to funky (and invalid) XHTML formatting for block-level shortcodes like the [gallery] one. In 2.5.1, shortcodes are parsed “at 11″ — that is, after paragraphs are wrapped and quotes are curled. Additionally, a shortcode with a buffer line between surrounding content will not be paragraph wrapped.

Example:

[gallery]

That shortcode’s output would be untouched by WordPress — whatever the shortcode outputs is going to the browser. Note that if you’re a plugin developer and you want the output of your shortcode to be p-wrapped or have its quotes curled, you’ll have to call those functions yourself. At some point in the future we may add more options for shortcode calling, but for now, you’re on your own for formatting.

Be sure to check out the excellent documentation for this feature!

Tagged with: , , ,

20 Responses to 'WordPress 2.5.1: Shortcodes updates'

Subscribe to comments with RSS or TrackBack to 'WordPress 2.5.1: Shortcodes updates'.

  1. Neil said, on April 25th, 2008 at 1:15 pm

    just updated now and im going to check out all the new little fixes, great work guys!

  2. Stijn said, on April 25th, 2008 at 1:42 pm

    Great work. The update seems to have fixed a security issue I was having.

  3. 420bay said, on April 25th, 2008 at 2:54 pm

    Thanks for always trying to make Wp a better and safer place to blog.

  4. Claude Gelinas said, on April 25th, 2008 at 3:23 pm

    Thanks to all WP coders for another solid upgrade!

  5. Wessel said, on April 25th, 2008 at 9:00 pm

    Great job guys, I just upgraded to the new version.
    Checking out the the new fixes.
    Keep up the good work.

  6. [...] comes with a lot of bug fixes and according to core developer Mark Jaquith, with some important shortcode fixes, like the “ which caused blogs to become xhtml [...]

  7. Ken Savage said, on April 25th, 2008 at 11:33 pm

    Thanks to all coders for another solid upgrade for secutrity

  8. Kuya Jhay said, on April 26th, 2008 at 1:44 am

    How come the “Please update now” strip is still showing up even after I’ve upgraded to WP 2.5.1?

  9. Steve Winters said, on April 26th, 2008 at 6:11 am

    I love how simple the updates are to….ahhh update :) hahaha
    Keep up the good work!

  10. Ray W. said, on April 26th, 2008 at 6:55 am

    Upgraded without any problems, as usual. Well done to the WP crew!

  11. [...] WordPress 2.5.1: Shortcodes updates [...]

  12. shantanu goel said, on April 26th, 2008 at 3:38 pm

    @Kuya: The strip will be gone in a few hours (if it hasn’t already). Basically WP checks for updates only a limited number of times in a day.

  13. Jim Dicecco said, on April 26th, 2008 at 9:29 pm

    I upgraded to version 2.5.1. None of my RSS link pages work. The shortcode is rendered as text in some cases.

    I’ve tried subbing other plugins but nothing works. Is the a compatible program with version 2.5.1 for putting RSS in a post?

  14. Jermayn Parker said, on April 28th, 2008 at 8:35 pm

    Any chance this will fix the upload images problem??

  15. dhruvasagar said, on April 29th, 2008 at 12:20 am

    Upgraded, works like a charm.

  16. slillico said, on April 29th, 2008 at 4:22 pm

    Looks great, thanks everyone, the site I administer http://www.deboldfield.com is solid as a result.

  17. Steve Cadick said, on April 30th, 2008 at 1:55 am

    Now with LOANS you have an opportunity to solve the financial crisis.

  18. GauharJK said, on April 30th, 2008 at 5:01 am

    I won’t take any chances yet. I don’t want to screw up my blog. Better wait and watch. I am satisfied with WordPress 2.5… Its just that I have too many assets at risk in case anything goes wrong while updating to 2.5.1

  19. Megapixels said, on April 30th, 2008 at 5:40 am

    I upgraded from 2.04 to 2.51 two days ago with minimal problems. It was long overdue. Used the automatic upgrade plugin. Had to manually reactivate my plugins, but nothing too painful. I didn’t even know about shortcodes before. Thanks for the info.

  20. [...] Shortcodes Improved: Among the improvements in WordPress 2.5.1, the new shortcodes feature was updated. These are codes written in brackets like used for the new Media Library Gallery feature. Mark [...]

Leave a Reply