Ticket #5914 (closed enhancement: fixed)

Opened 9 months ago

Last modified 9 months ago

Positional attributes for shortcodes

Reported by: tellyworth Assigned to: anonymous
Priority: normal Milestone: 2.5
Component: General Version:
Severity: normal Keywords: has-patch
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

shortcode-positional-atts-r6855.patch (1.0 kB) - added by tellyworth on 02/19/08 04:45:58.

Change History

02/19/08 04:45:58 changed by tellyworth

  • attachment shortcode-positional-atts-r6855.patch added.

02/19/08 06:52:30 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [6911]) Support positional attributes in shortcodes. Props tellyworth. fixes #5914