]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/shortcodes.php
WordPress 4.1.1-scripts
[autoinstalls/wordpress.git] / wp-includes / shortcodes.php
index 55e64a1863f9f9891b42595b2c7bc02cb76ae8d4..99eec774dcd8ecd677577499516ea0025a40956e 100644 (file)
@@ -21,9 +21,7 @@
  *
  * To apply shortcode tags to content:
  *
- * <code>
- * $out = do_shortcode($content);
- * </code>
+ *     $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:
  *
- * <code>
- * // [footag foo="bar"]
- * function footag_func($atts) {
- *     return "foo = {$atts[foo]}";
- * }
- * add_shortcode('footag', 'footag_func');
- * </code>
+ *     // [footag foo="bar"]
+ *     function footag_func( $atts ) {
+ *         return "foo = {
+ *             $atts[foo]
+ *         }";
+ *     }
+ *     add_shortcode( 'footag', 'footag_func' );
  *
  * Example with nice attribute defaults:
  *
- * <code>
- * // [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');
- * </code>
+ *         return "foo = {$args['foo']}";
+ *     }
+ *     add_shortcode( 'bartag', 'bartag_func' );
  *
  * Example with enclosed content:
  *
- * <code>
- * // [baztag]content[/baztag]
- * function baztag_func($atts, $content='') {
- *     return "content = $content";
- * }
- * add_shortcode('baztag', 'baztag_func');
- * </code>
+ *     // [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.