[wp-testers] Manage Media and Gallery

Steve stevish at gmail.com
Fri Mar 28 14:24:53 GMT 2008


Ok, here's a more informed report of what's happening with the shortcodes:

I made a plugin that adds the following shortcode:

add_shortcode('testit','test_it_func');

function test_it_func($atts, $content = null) {
    extract(shortcode_atts(array(
        'ems'        => '1',
    ), $atts));
    //$ems = intval($ems);
    $output .= '<span style="font-size: ';
    $output .= $ems;
    $output .= 'em;">This text is ';
    $output .= $ems;
    $output .= ' ems in size</span>';

    return $output;
}

When I enter [testit] it outputs <span style="font-size: 1em;">This text is
1 ems in sive</span>

When I enter [testit ems=3] it outputs <span style="font-size: 3em;">This
text is 3 ems in sive</span>, and the text is actually 3ems in size.

But when I enter [testit ems="3"] the output is  <span style="font-size:
&#8221;3&#8243;em;">This text is &#8221;3&#8243; ems in size</span>, and the
text size is not altered.


Basically, it simply uses an escaped version of the quotes as part of the
variable. That's definitely wrong... right? Also, if I enter a variable that
has a space in it, surrounded by quotes (such as "has space"), then the
variable is filled with everything up to the first space, excluding the
space, but including the first quotation mark.

I'm assuming this is a bug... should I add it to the Trac?


More information about the wp-testers mailing list