Make WordPress Core


Ignore:
Timestamp:
11/24/2014 06:14:03 AM (10 years ago)
Author:
DrewAPicture
Message:

Ensure inline code is markdown-escaped as such, HTML tags are removed from summaries, and that code snippets in descriptions are properly indented.

Affects DocBlocks for the following core elements:

  • Backtick-escape HTML tags in several argument descriptions for wp_link_pages()
  • Remove an HTML tag from the summary for prepend_attachment()
  • Backtick-escape inline code in the description for get_extended()
  • Backtick-escape inline code in the description for get_post_type_labels()
  • Various markdown formatting in the description for add_rewrite_endpoint()
  • Markdown-indent a code snippet in the file header for wp-includes/shortcodes.php
  • Markdown-indent code snippets in the description for `add_shortcode()

Props rarst.
See #30473.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/shortcodes.php

    r30105 r30545  
    2222 * To apply shortcode tags to content:
    2323 *
    24  * <code>
    25  * $out = do_shortcode($content);
    26  * </code>
     24 *     $out = do_shortcode( $content );
    2725 *
    2826 * @link http://codex.wordpress.org/Shortcode_API
     
    5351 * Simplest example of a shortcode tag using the API:
    5452 *
    55  * <code>
    56  * // [footag foo="bar"]
    57  * function footag_func($atts) {
    58  *  return "foo = {$atts[foo]}";
    59  * }
    60  * add_shortcode('footag', 'footag_func');
    61  * </code>
     53 *     // [footag foo="bar"]
     54 *     function footag_func( $atts ) {
     55 *         return "foo = {
     56 *             $atts[foo]
     57 *         }";
     58 *     }
     59 *     add_shortcode( 'footag', 'footag_func' );
    6260 *
    6361 * Example with nice attribute defaults:
    6462 *
    65  * <code>
    66  * // [bartag foo="bar"]
    67  * function bartag_func($atts) {
    68  *  $args = shortcode_atts(array(
    69  *      'foo' => 'no foo',
    70  *      'baz' => 'default baz',
    71  *  ), $atts);
    72  *
    73  *  return "foo = {$args['foo']}";
    74  * }
    75  * add_shortcode('bartag', 'bartag_func');
    76  * </code>
     63 *     // [bartag foo="bar"]
     64 *     function bartag_func( $atts ) {
     65 *         $args = shortcode_atts( array(
     66 *             'foo' => 'no foo',
     67 *             'baz' => 'default baz',
     68 *         ), $atts );
     69 *
     70 *         return "foo = {$args['foo']}";
     71 *     }
     72 *     add_shortcode( 'bartag', 'bartag_func' );
    7773 *
    7874 * Example with enclosed content:
    7975 *
    80  * <code>
    81  * // [baztag]content[/baztag]
    82  * function baztag_func($atts, $content='') {
    83  *  return "content = $content";
    84  * }
    85  * add_shortcode('baztag', 'baztag_func');
    86  * </code>
     76 *     // [baztag]content[/baztag]
     77 *     function baztag_func( $atts, $content = '' ) {
     78 *         return "content = $content";
     79 *     }
     80 *     add_shortcode( 'baztag', 'baztag_func' );
    8781 *
    8882 * @since 2.5.0
Note: See TracChangeset for help on using the changeset viewer.