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);


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


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: