Allow users of my plugin to define their own shortcode rather than use mine?

I’m creating my first plugin. So far everything is great, but my shortcode is something like this [BIMS] and that acronym might not be easy to remember, or appeal to everyone. I’d like to include an option to have them input their own replacement shortcode.

What is the proper code to allow them to use their own shortcode text yet bring up my function?

Related posts

1 comment

  1. Save the shortcode name in an option, and use that when you add the shortcode:

    add_shortcode( 
        get_option( 'your_plugin_option', 'default_shortcode_name' ), 
        'your_shortcode_callback'
    );
    

Comments are closed.