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
No comments yet... Be the first to leave a reply!