• Resolved drizzt99

    (@drizzt99)


    I’ve created a simple snippet:

    function shortCodeHandler($attr){
      return 'I was here';
    }
    add_shortcode('my_short_code', 'shortCodeHandler');

    I can tell it being read (I’ve even added a “mail” below the “add_shortcode” and emails were sent to me). But the shortcode itself is not being processed by wordpress.

    Am I doing something wrong?

    https://ww.wp.xz.cn/plugins/code-snippets/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    This is strange behaviour; I’ve used shortcodes in snippets before and it has worked fine. The only thing I can think of right now is perhaps it would help registering the shortcode later.

    function shortCodeHandler($attr){
      return 'I was here';
    }
    
    function registerMyShortCode() {
      add_shortcode('my_short_code', 'shortCodeHandler');
    }
    
    add_action('init', 'registerMyShortCode');
    Thread Starter drizzt99

    (@drizzt99)

    That was it! Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Snippets aren't working’ is closed to new replies.