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.


Just remove the shortcode during the first call.

add_shortcode( 'foo', 'foo_shortcode_handler' );

function foo_shortcode_handler()
    remove_shortcode( 'foo' );
    return 'bar';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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