Why are you using add_action for shortcode?

If you take a look at the Codex page about add_shortcode() you won’t see anything about the need of an add_action() before you can use add_shortcode().

So, you can just put your add_shortcode() directly into your functions.php. This is what I do too.

See this article – WordPress Shortcodes: A Complete Guide about the use of shortcodes and best practices.

Leave a Comment