Support » Plugins » Hacks » Determine wether the shortcode was called in text widget or in content

  • Hi Guys,

    I am using a shortcode api and I added a shortcode using add_shortcode.

    The shortcode is added to a post and to a text widget. But I want the shortcode to work only when viewing the post content and not in the post list.

    Using is_single is my first solution but the text widget shortcode didnt show up also.

    Is there a way for me to determine wether the shortcode hook was called in post content or in a text widget?

    Thanks
    Feljun

Viewing 1 replies (of 1 total)
  • Hi guys,

    Got the fix for this. although no one has answered, we found a way to do it.

    You can use in_the_loop() to check wether the shortcode was called in the post.

    I just thought that somebody might need it someday.

Viewing 1 replies (of 1 total)
  • The topic ‘Determine wether the shortcode was called in text widget or in content’ is closed to new replies.