Opened 11 months ago
#21158 new defect (bug)
different result when shortcode atribute without value
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Shortcodes | Version: | 3.4 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
imagine those two shortcodes
[shortcode attribute] [shortcode attribute=value]
IMO they should have the same result, just the second should have some value to the attribute and the first should have NULL or false
But if you do
add_shortcode( 'shortcode', 'my_shortcode' );
function my_shortcode( $atts ) { print_r ($atts); }
the first shortcode results in
array ( 0 => 'attribute', )
while the second in
array ( 'attribute' => 'value', )
I'm not sure, maybe it is intentional, i have not found any description, what should shortcode attribute without value do. But imo it should work as i have described as it is the only way how it could clear some predefined value (the only other way is to set it to empty string, which may not always be the same as NULL or FALSE).
Note: See
TracTickets for help on using
tickets.
