X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/f5fcdc7994bb67cce809bc4777944ae8b7fad4a4..53f4633144ed68c8b8fb5861f992b5489894a940:/wp-includes/shortcodes.php?ds=sidebyside diff --git a/wp-includes/shortcodes.php b/wp-includes/shortcodes.php index 810db200..c63958b1 100644 --- a/wp-includes/shortcodes.php +++ b/wp-includes/shortcodes.php @@ -81,16 +81,14 @@ $shortcode_tags = array(); * * @since 2.5.0 * - * @uses $shortcode_tags + * @global array $shortcode_tags * - * @param string $tag Shortcode tag to be searched in post content. + * @param string $tag Shortcode tag to be searched in post content. * @param callable $func Hook to run when shortcode is found. */ function add_shortcode($tag, $func) { global $shortcode_tags; - - if ( is_callable($func) ) - $shortcode_tags[$tag] = $func; + $shortcode_tags[ $tag ] = $func; } /** @@ -98,7 +96,7 @@ function add_shortcode($tag, $func) { * * @since 2.5.0 * - * @uses $shortcode_tags + * @global array $shortcode_tags * * @param string $tag Shortcode tag to remove hook for. */ @@ -117,7 +115,7 @@ function remove_shortcode($tag) { * * @since 2.5.0 * - * @uses $shortcode_tags + * @global array $shortcode_tags */ function remove_all_shortcodes() { global $shortcode_tags; @@ -210,10 +208,10 @@ function do_shortcode( $content, $ignore_html = false ) { $pattern = get_shortcode_regex(); $content = preg_replace_callback( "/$pattern/s", 'do_shortcode_tag', $content ); - + // Always restore square braces so we don't break things like