[wp-trac] [WordPress Trac] #20077: shortcode_parse_atts should not force arguments to be lowercase
WordPress Trac
wp-trac at lists.automattic.com
Sun Feb 19 19:21:33 UTC 2012
#20077: shortcode_parse_atts should not force arguments to be lowercase
----------------------------+-----------------------------
Reporter: fireproofsocks | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Keywords:
----------------------------+-----------------------------
Inside wp-includes/shortcodes.php, the shortcode_parse_atts() function
forces shortcode arguments to be lowercase. So if your shotcode had
something like [my_shortcode MyVar=123], then your code that uses
something like "print $MyVar;" fails... you have to use "$myvar" instead.
This is counter-intuitive. I understand that there needs to be some
restrictions on what is a valid parameter name (see
http://core.trac.wordpress.org/ticket/9405), but I think it makes the most
sense that the parameter names can correspond to any valid PHP variable
name; PHP variables ARE case-sensitive, so this arbitrary restriction of
forcing lower-case parameters seems like the incorrect approach.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20077>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list