Advertisements

add_shortcode

Definition:
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.

Parameters

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

}

365

Advertisements

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:

WordPress.com Logo

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

Google+ photo

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

Twitter picture

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

Facebook photo

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

Connecting to %s

%d bloggers like this: