Make WordPress Core


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.

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.