Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

So I have other short codes that are built in this fashion and I cant figure out what i did between them and this one, This short code is used as such: [code code="function(){}"] to wrap your input in <code></code> tags, great for something super simple.

the issue is:

function aisis_inline_code($atts, $content = null){
    extract (
        shortcode_atts (
            array (
                'code' => 'test?'
            ),
            $atts
        )
    );  
    return '<code>'.$code.'</code>';
}

add_shortcode( 'code', 'aisis_inline_code');

The above renders out test wrapped in code tags instead of the content I put in which is: [code code="function(){}"]

How do we debug these? This was working pre WordPress 3.7.1, not it seems all it wants to do is out put test?. I checked the spelling of the short code spelling a hundred times. ...

share|improve this question
    
a copy/paste of your code and example shortcode work as expected for me. –  Milo Oct 31 '13 at 19:52

1 Answer 1

I checked your solution (copy and paste) and it is working fine in Wordpress 3.7.1 Maybe check your post again. Can you provide a link to your site? (can not comment yet, thats why I answer)

share|improve this answer
    
@TheWebs It works fine for me too tested in Wordpress 3.7.1 –  Rahil Wazir Oct 31 '13 at 20:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.