[wp-trac] [WordPress Trac] #5914: Positional attributes for
shortcodes
WordPress Trac
wp-trac at lists.automattic.com
Tue Feb 19 04:45:33 GMT 2008
#5914: Positional attributes for shortcodes
-------------------------+--------------------------------------------------
Reporter: tellyworth | Owner: anonymous
Type: enhancement | Status: new
Priority: normal | Milestone: 2.5
Component: General | Version:
Severity: normal | Keywords: has-patch
-------------------------+--------------------------------------------------
The shortcode API introduced with the gallery feature supports attributes
like this:
{{{
[mytag foo=1 bar="baz"]
}}}
This patch adds support for positional attributes like this:
{{{
[mytag foo bar]
}}}
Positional attributes are included in the $atts array with numeric keys.
It's possible to use quotes for attributes that contain spaces, and to mix
positional and named attributes:
{{{
[mytag "foo bar" baz="bing" asdf]
}}}
This would produce the $atts array( 0 => 'foo bar', 'baz' => 'bing', 1 =>
'asdf').
Unit tests are here:
http://svn.automattic.com/wordpress-tests/wp-testcase/test_shortcode.php
--
Ticket URL: <http://trac.wordpress.org/ticket/5914>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list