php variable in function name – wordpress shortcode

I would like to use a php variable to input the value as the shortcode name for wordpress.

Basically I have an option where people can create an options and give it a shortcode name.

Something like the following:

Is this possible?

$shortcode_name = "name_here";
function $shortcode_name ($atts) {
// code here
}
add_shortcode ($shortcode_name , $shortcode_name);

Thanks

Read more here: php variable in function name – wordpress shortcode

Leave a Reply

Your email address will not be published. Required fields are marked *