function add_shortcode($tag, $func) {}

Add hook for shortcode tag.
There can only be one hook for each shortcode. Which means that if another plugin has a similar shortcode, it will override yours or yours will override theirs depending on which order the plugins are included and/or ran.


  • string $tag: Shortcode tag to be searched in post content.
  • callable $func: Hook to run when shortcode is found.

Source code

function add_shortcode($tag, $func) {

	global $shortcode_tags;

	if ( is_callable($func) )

		$shortcode_tags[$tag] = $func;



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: