0

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. ...

1
  • a copy/paste of your code and example shortcode work as expected for me.
    – Milo
    Oct 31, 2013 at 19:52

1 Answer 1

0

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)

1
  • @TheWebs It works fine for me too tested in Wordpress 3.7.1 Oct 31, 2013 at 20:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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