Autogenerate shortcodes from an array of strings
Your shortcode name (‘$name’ ) is invalid. If you want to use the variable, it should be add_shorcode( $name, …. Also, the function name is invalid. Since you want to make it “dynamic” (I’m assuming you want it to be {$name}_sc, then maybe you should use an anonymous function. What you have is somewhat unconventional … Read more