Make WordPress Core

Changeset 30545


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.

Location:
trunk/src/wp-includes
Files:
4 edited

Legend:

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

    r30157 r30545  
    731731 *     Optional. Array or string of default arguments.
    732732 *
    733  *     @type string       $before           HTML or text to prepend to each link. Default is '<p> Pages:'.
    734  *     @type string       $after            HTML or text to append to each link. Default is '</p>'.
    735  *     @type string       $link_before      HTML or text to prepend to each link, inside the <a> tag.
     733 *     @type string       $before           HTML or text to prepend to each link. Default is `<p> Pages:`.
     734 *     @type string       $after            HTML or text to append to each link. Default is `</p>`.
     735 *     @type string       $link_before      HTML or text to prepend to each link, inside the `<a>` tag.
    736736 *                                          Also prepended to the current item, which is not linked. Default empty.
    737  *     @type string       $link_after       HTML or text to append to each Pages link inside the <a> tag.
     737 *     @type string       $link_after       HTML or text to append to each Pages link inside the `<a>` tag.
    738738 *                                          Also appended to the current item, which is not linked. Default empty.
    739739 *     @type string       $next_or_number   Indicates whether page numbers should be used. Valid values are number
     
    15111511
    15121512/**
    1513  * Wrap attachment in <<p>> element before content.
     1513 * Wrap attachment in paragraph tag before content.
    15141514 *
    15151515 * @since 2.0.0
  • trunk/src/wp-includes/post.php

    r30480 r30545  
    373373 *
    374374 * The returned array has 'main', 'extended', and 'more_text' keys. Main has the text before
    375  * the <code><!--more--></code>. The 'extended' key has the content after the
    376  * <code><!--more--></code> comment. The 'more_text' key has the custom "Read More" text.
     375 * the `<!--more-->`. The 'extended' key has the content after the
     376 * `<!--more-->` comment. The 'more_text' key has the custom "Read More" text.
    377377 *
    378378 * @since 1.0.0
     
    15951595 * - add_new - Default is Add New for both hierarchical and non-hierarchical types.
    15961596 *             When internationalizing this string, please use a gettext context
    1597  *             {@see http://codex.wordpress.org/I18n_for_WordPress_Developers#Disambiguation_by_context}
    1598  *             matching your post type. Example: <code>_x('Add New', 'product');</code>.
     1597 *             {@link http://codex.wordpress.org/I18n_for_WordPress_Developers#Disambiguation_by_context}
     1598 *             matching your post type. Example: `_x( 'Add New', 'product' );`.
    15991599 * - add_new_item - Default is Add New Post/Add New Page.
    16001600 * - edit_item - Default is Edit Post/Edit Page.
     
    16071607 *                       ones the default is 'Parent Page:'.
    16081608 * - all_items - String for the submenu. Default is All Posts/All Pages.
    1609  * - menu_name - Default is the same as <code>name</code>.
     1609 * - menu_name - Default is the same as `name`.
    16101610 *
    16111611 * Above, the first default value is for non-hierarchical post types (like posts)
  • trunk/src/wp-includes/rewrite.php

    r29788 r30545  
    227227 * places specified by the provided bitmask. For example:
    228228 *
    229  * <code>
    230  * add_rewrite_endpoint( 'json', EP_PERMALINK | EP_PAGES );
    231  * </code>
     229 *     add_rewrite_endpoint( 'json', EP_PERMALINK | EP_PAGES );
    232230 *
    233231 * will add a new rewrite rule ending with "json(/(.*))?/?$" for every permastruct
    234232 * that describes a permalink (post) or page. This is rewritten to "json=$match"
    235233 * where $match is the part of the URL matched by the endpoint regex (e.g. "foo" in
    236  * "<permalink>/json/foo/").
     234 * "[permalink]/json/foo/").
    237235 *
    238236 * A new query var with the same name as the endpoint will also be created.
     
    240238 * When specifying $places ensure that you are using the EP_* constants (or a
    241239 * combination of them using the bitwise OR operator) as their values are not
    242  * guaranteed to remain static (especially EP_ALL).
    243  *
    244  * Be sure to flush the rewrite rules - flush_rewrite_rules() - when your plugin gets
     240 * guaranteed to remain static (especially `EP_ALL`).
     241 *
     242 * Be sure to flush the rewrite rules - {@see flush_rewrite_rules()} - when your plugin gets
    245243 * activated and deactivated.
    246244 *
  • 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.