/** * Regular Expression callable for do_shortcode() for calling shortcode hook. * @see getShortcodeRegex for details of the match array contents. * * @access private * @uses $shortcode_tags * * @param array $m Regular expression match array * @return mixed False on failure. */ private static function doShortcodeTag($m) { $shortcode_tags = Shortcodes::$shortcode_tags; // allow [[foo]] syntax for escaping a tag if ($m[1] == '[' && $m[6] == ']') { return substr($m[0], 1, -1); } $tag = $m[2]; $attr = Shortcodes::shortcodeParseAtts($m[3]); if (isset($m[5])) { // enclosing tag - extra parameter return $m[1] . call_user_func($shortcode_tags[$tag], $attr, $m[5], $tag) . $m[6]; } else { // self-closing tag return $m[1] . call_user_func($shortcode_tags[$tag], $attr, NULL, $tag) . $m[6]; } }