Shortcodes don't allow shortcodes in attributes
|Reported by:||Atoon||Owned by:|
I think that shortcodes should work when used inside attributes of other shortcodes, just like they can work inside the "$content" of a shortcode.
Some people says that that isn't supposed to work, but theoretically it is supposed to work when using the "do_shortcode" function. It don't work because:
1) "do_shortcode" is context free, which it's actually fine by its fastness, although it don't allow stuff like inserting a shortcode inside the content of itself
2) The shortcode regex stops with the first occurrence of a ] in a shortcode, so in this:
[foo bar="[baz /]"]content[/foo]
[foo bar="[baz /]
and "]content[/foo] is ignored.
I'm not programmer but I tried to fix it by changing the shortcode regex so it allow anything between quotes or brackets inside the first group of brackets. It sort of works, but also mess the handling of quotes in the rest of the shortcode, so I think something more advanced have to be done to make it work.
This is somewhat related to another shortcode tickets, but none of them addresses nor solves this specifically.
Change History (10)
- Keywords needs-unit-tests added; shortcode attributes removed
- Milestone changed from 3.1 to Future Release
- Type changed from defect (bug) to feature request
- Keywords needs-unit-tests removed
- Resolution set to wontfix
- Status changed from new to closed