wordpress prevent multiple shortcodes

I created a wordpress plugin and I added shortcode feature to it. but i want to execute only one shortcode and prevent applying of multiple shortcodes if the administrator did so.

Related posts

Leave a Reply

1 comment

  1. Just remove the shortcode during the first call.

    add_shortcode( 'foo', 'foo_shortcode_handler' );
    
    function foo_shortcode_handler()
    {
        remove_shortcode( 'foo' );
        return 'bar';
    }