Opened 17 years ago
Closed 17 years ago
#5914 closed enhancement (fixed)
Positional attributes for shortcodes
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 2.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | General | Keywords: | has-patch |
Focuses: | Cc: |
Description
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
Attachments (1)
Change History (2)
Note: See
TracTickets for help on using
tickets.
(In [6911]) Support positional attributes in shortcodes. Props tellyworth. fixes #5914