Make WordPress Core

Changeset 30546


Ignore:
Timestamp:
11/24/2014 06:30:19 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 code snippets in the description for get_object_taxonomies()
  • Backtick-escape inline code in a markdown-formatted unordered list in the description for get_taxonomy_labels()
  • Remove an HTML tag from the summary for the Walker_Category_Checklist class
  • Remove an HTML tag from the summary for wp_category_checklist(), various formatting
  • Remove an HTML tag from the summary for wp_terms_checklist()
  • Backtick-escape an HTML tag in the description for wp_popular_terms_checklist()
  • Remove HTML tags from the summaries for page_template_dropdown(), parent_dropdown(), and wp_dropdown_roles()
  • Backtick-escape HTML tags in a parameter description for add_settings_error()
  • Various formatting in the description and summary for settings_errors()
  • Markdown-indent code snippets in the descriptions for wpdb::prepare(), wpdb::insert(), wpdb::replace(), wpdb::update(), and wpdb::delete()
  • Backtick-escape an HTML tag in a parameter description for login_header()
  • Remove HTML tags from the summaries for the lostpassword_form and signup_header hooks

Props rarst.
See #30473.

Location:
trunk/src
Files:
5 edited

Legend:

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

    r30505 r30546  
    1414
    1515/**
    16  * Walker to output an unordered list of category checkbox <input> elements.
     16 * Walker to output an unordered list of category checkbox input elements.
     17 *
     18 * @since 2.5.1
    1719 *
    1820 * @see Walker
    1921 * @see wp_category_checklist()
    2022 * @see wp_terms_checklist()
    21  * @since 2.5.1
    2223 */
    2324class Walker_Category_Checklist extends Walker {
     
    113114
    114115/**
    115  * Output an unordered list of checkbox <input> elements labelled
     116 * Output an unordered list of checkbox input elements labelled
    116117 * with category names.
    117118 *
     119 * @since 2.5.1
     120 *
     121 * @todo Properly document optional arguments as such.
     122 *
    118123 * @see wp_terms_checklist()
    119  * @since 2.5.1
    120124 *
    121125 * @param int $post_id Mark categories associated with this post as checked. $selected_cats must not be an array.
     
    138142
    139143/**
    140  * Output an unordered list of checkbox <input> elements labelled
    141  * with term names. Taxonomy independent version of wp_category_checklist().
     144 * Output an unordered list of checkbox input elements labelled with term names.
     145 *
     146 * Taxonomy independent version of {@see wp_category_checklist()}.
    142147 *
    143148 * @since 3.0.0
    144149 *
    145  * @param int $post_id
    146  * @param array $args
     150 * @todo Properly document optional default arguments.
     151 *
     152 * @param int   $post_id Post ID.
     153 * @param array $args    Arguments to form the terms checklist.
    147154 */
    148155function wp_terms_checklist( $post_id = 0, $args = array() ) {
     
    237244 *
    238245 * If the $echo argument is true then the elements for a list of checkbox
    239  * <input> elements labelled with the names of the selected terms is output.
     246 * `<input>` elements labelled with the names of the selected terms is output.
    240247 * If the $post_ID global isn't empty then the terms associated with that
    241248 * post will be marked as checked.
     
    783790
    784791/**
    785  * Print out <option> HTML elements for the page templates drop-down.
     792 * Print out option HTML elements for the page templates drop-down.
    786793 *
    787794 * @since 1.5.0
     
    799806
    800807/**
    801  * Print out <option> HTML elements for the page parents drop-down.
     808 * Print out option HTML elements for the page parents drop-down.
    802809 *
    803810 * @since 1.5.0
     
    832839
    833840/**
    834  * Print out <option> html elements for role selectors
     841 * Print out option html elements for role selectors.
    835842 *
    836843 * @since 2.1.0
     
    13081315 * @since 3.0.0
    13091316 *
     1317 * @todo Properly document optional arguments as such.
     1318 *
    13101319 * @global array $wp_settings_errors Storage array of errors registered during this pageload
    13111320 *
    13121321 * @param string $setting Slug title of the setting to which this error applies
    1313  * @param string $code Slug-name to identify the error. Used as part of 'id' attribute in HTML output.
    1314  * @param string $message The formatted message text to display to the user (will be shown inside styled <div> and <p>)
    1315  * @param string $type The type of message it is, controls HTML class. Use 'error' or 'updated'.
     1322 * @param string $code    Slug-name to identify the error. Used as part of 'id' attribute in HTML output.
     1323 * @param string $message The formatted message text to display to the user (will be shown inside styled
     1324 *                        `<div>` and `<p>` tags).
     1325 * @param string $type    The type of message it is, controls HTML class. Use 'error' or 'updated'.
    13161326 */
    13171327function add_settings_error( $setting, $code, $message, $type = 'error' ) {
     
    13831393
    13841394/**
    1385  * Display settings errors registered by add_settings_error()
    1386  *
    1387  * Part of the Settings API. Outputs a <div> for each error retrieved by get_settings_errors().
    1388  *
    1389  * This is called automatically after a settings page based on the Settings API is submitted.
    1390  * Errors should be added during the validation callback function for a setting defined in register_setting()
    1391  *
    1392  * The $sanitize option is passed into get_settings_errors() and will re-run the setting sanitization
     1395 * Display settings errors registered by {@see add_settings_error()}.
     1396 *
     1397 * Part of the Settings API. Outputs a div for each error retrieved by
     1398 * {@see get_settings_errors()}.
     1399 *
     1400 * This is called automatically after a settings page based on the
     1401 * Settings API is submitted. Errors should be added during the validation
     1402 * callback function for a setting defined in {@see register_setting()}
     1403 *
     1404 * The $sanitize option is passed into {@see get_settings_errors()} and will
     1405 * re-run the setting sanitization
    13931406 * on its current value.
    13941407 *
    1395  * The $hide_on_update option will cause errors to only show when the settings page is first loaded.
    1396  * if the user has already saved new values it will be hidden to avoid repeating messages already
    1397  * shown in the default error reporting after submission. This is useful to show general errors like missing
    1398  * settings when the user arrives at the settings page.
     1408 * The $hide_on_update option will cause errors to only show when the settings
     1409 * page is first loaded. if the user has already saved new values it will be
     1410 * hidden to avoid repeating messages already shown in the default error
     1411 * reporting after submission. This is useful to show general errors like
     1412 * missing settings when the user arrives at the settings page.
    13991413 *
    14001414 * @since 3.0.0
  • trunk/src/wp-includes/taxonomy.php

    r30494 r30546  
    156156 * $wp_taxonomies global variable.
    157157 *
    158  * <code><?php $taxonomies = get_object_taxonomies('post'); ?></code> Should
    159  * result in <code>Array('category', 'post_tag')</code>
     158 * `<?php $taxonomies = get_object_taxonomies('post'); ?>` Should
     159 * result in `Array( 'category', 'post_tag' )`
    160160 *
    161161 * @since 2.3.0
     
    435435 *
    436436 * Accepted keys of the label array in the taxonomy object:
     437 *
    437438 * - name - general name for the taxonomy, usually plural. The same as and overridden by $tax->label. Default is Tags/Categories
    438439 * - singular_name - name for one object of this taxonomy. Default is Tag/Category
     
    441442 * - all_items - Default is All Tags/All Categories
    442443 * - parent_item - This string isn't used on non-hierarchical taxonomies. In hierarchical ones the default is Parent Category
    443  * - parent_item_colon - The same as <code>parent_item</code>, but with colon <code>:</code> in the end
     444 * - parent_item_colon - The same as `parent_item`, but with colon `:ё in the end
    444445 * - edit_item - Default is Edit Tag/Edit Category
    445446 * - view_item - Default is View Tag/View Category
  • trunk/src/wp-includes/wp-db.php

    r30400 r30546  
    11731173     * Both %d and %s should be left unquoted in the query string.
    11741174     *
    1175      * <code>
    1176      * wpdb::prepare( "SELECT * FROM `table` WHERE `column` = %s AND `field` = %d", 'foo', 1337 )
    1177      * wpdb::prepare( "SELECT DATE_FORMAT(`field`, '%%c') FROM `table` WHERE `column` = %s", 'foo' );
    1178      * </code>
     1175     *     wpdb::prepare( "SELECT * FROM `table` WHERE `column` = %s AND `field` = %d", 'foo', 1337 )
     1176     *     wpdb::prepare( "SELECT DATE_FORMAT(`field`, '%%c') FROM `table` WHERE `column` = %s", 'foo' );
    11791177     *
    11801178     * @link http://php.net/sprintf Description of syntax.
     
    17251723     * Insert a row into a table.
    17261724     *
    1727      * <code>
    1728      * wpdb::insert( 'table', array( 'column' => 'foo', 'field' => 'bar' ) )
    1729      * wpdb::insert( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( '%s', '%d' ) )
    1730      * </code>
     1725     *     wpdb::insert( 'table', array( 'column' => 'foo', 'field' => 'bar' ) )
     1726     *     wpdb::insert( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( '%s', '%d' ) )
    17311727     *
    17321728     * @since 2.5.0
     
    17481744     * Replace a row into a table.
    17491745     *
    1750      * <code>
    1751      * wpdb::replace( 'table', array( 'column' => 'foo', 'field' => 'bar' ) )
    1752      * wpdb::replace( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( '%s', '%d' ) )
    1753      * </code>
     1746     *     wpdb::replace( 'table', array( 'column' => 'foo', 'field' => 'bar' ) )
     1747     *     wpdb::replace( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( '%s', '%d' ) )
    17541748     *
    17551749     * @since 3.0.0
     
    18151809     * Update a row in the table
    18161810     *
    1817      * <code>
    1818      * wpdb::update( 'table', array( 'column' => 'foo', 'field' => 'bar' ), array( 'ID' => 1 ) )
    1819      * wpdb::update( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( 'ID' => 1 ), array( '%s', '%d' ), array( '%d' ) )
    1820      * </code>
     1811     *     wpdb::update( 'table', array( 'column' => 'foo', 'field' => 'bar' ), array( 'ID' => 1 ) )
     1812     *     wpdb::update( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( 'ID' => 1 ), array( '%s', '%d' ), array( '%d' ) )
    18211813     *
    18221814     * @since 2.5.0
     
    18691861     * Delete a row in the table
    18701862     *
    1871      * <code>
    1872      * wpdb::delete( 'table', array( 'ID' => 1 ) )
    1873      * wpdb::delete( 'table', array( 'ID' => 1 ), array( '%d' ) )
    1874      * </code>
     1863     *     wpdb::delete( 'table', array( 'ID' => 1 ) )
     1864     *     wpdb::delete( 'table', array( 'ID' => 1 ), array( '%d' ) )
    18751865     *
    18761866     * @since 3.4.0
  • trunk/src/wp-login.php

    r30417 r30546  
    2626 * Output the login page header.
    2727 *
    28  * @param string   $title    Optional. WordPress Log In Page title to display in <title> element. Default 'Log In'.
     28 * @param string   $title    Optional. WordPress login Page title to display in the `<title>` element.
     29 *                           Default 'Log In'.
    2930 * @param string   $message  Optional. Message to display in header. Default empty.
    3031 * @param WP_Error $wp_error Optional. The error to pass. Default empty.
     
    538539    <?php
    539540    /**
    540      * Fires inside the lostpassword <form> tags, before the hidden fields.
     541     * Fires inside the lostpassword form tags, before the hidden fields.
    541542     *
    542543     * @since 2.1.0
  • trunk/src/wp-signup.php

    r30105 r30546  
    2020function do_signup_header() {
    2121    /**
    22      * Fires within the <head> section of the site sign-up screen.
     22     * Fires within the head section of the site sign-up screen.
    2323     *
    2424     * @since 3.0.0
Note: See TracChangeset for help on using the changeset viewer.