X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/9e77185fafaf4e60e2b73821e0e4b9b1a11fb85f..a7cd4c052013b423c6301153f68c7fdbaa2a447b:/wp-includes/shortcodes.php diff --git a/wp-includes/shortcodes.php b/wp-includes/shortcodes.php index 55e64a18..99eec774 100644 --- a/wp-includes/shortcodes.php +++ b/wp-includes/shortcodes.php @@ -21,9 +21,7 @@ * * To apply shortcode tags to content: * - * - * $out = do_shortcode($content); - * + * $out = do_shortcode( $content ); * * @link http://codex.wordpress.org/Shortcode_API * @@ -52,38 +50,34 @@ $shortcode_tags = array(); * * Simplest example of a shortcode tag using the API: * - * - * // [footag foo="bar"] - * function footag_func($atts) { - * return "foo = {$atts[foo]}"; - * } - * add_shortcode('footag', 'footag_func'); - * + * // [footag foo="bar"] + * function footag_func( $atts ) { + * return "foo = { + * $atts[foo] + * }"; + * } + * add_shortcode( 'footag', 'footag_func' ); * * Example with nice attribute defaults: * - * - * // [bartag foo="bar"] - * function bartag_func($atts) { - * $args = shortcode_atts(array( - * 'foo' => 'no foo', - * 'baz' => 'default baz', - * ), $atts); + * // [bartag foo="bar"] + * function bartag_func( $atts ) { + * $args = shortcode_atts( array( + * 'foo' => 'no foo', + * 'baz' => 'default baz', + * ), $atts ); * - * return "foo = {$args['foo']}"; - * } - * add_shortcode('bartag', 'bartag_func'); - * + * return "foo = {$args['foo']}"; + * } + * add_shortcode( 'bartag', 'bartag_func' ); * * Example with enclosed content: * - * - * // [baztag]content[/baztag] - * function baztag_func($atts, $content='') { - * return "content = $content"; - * } - * add_shortcode('baztag', 'baztag_func'); - * + * // [baztag]content[/baztag] + * function baztag_func( $atts, $content = '' ) { + * return "content = $content"; + * } + * add_shortcode( 'baztag', 'baztag_func' ); * * @since 2.5.0 * @@ -185,7 +179,6 @@ function has_shortcode( $content, $tag ) { * @since 2.5.0 * * @uses $shortcode_tags - * @uses get_shortcode_regex() Gets the search pattern for searching shortcodes. * * @param string $content Content to search for shortcodes * @return string Content with shortcodes filtered out.