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.

Built from https://develop.svn.wordpress.org/trunk@30546


git-svn-id: http://core.svn.wordpress.org/trunk@30535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Drew Jaynes 2014-11-24 06:31:21 +00:00
parent 3b6c9519a8
commit 4b6abbaff4
6 changed files with 57 additions and 51 deletions

View File

@ -13,12 +13,13 @@
// //
/** /**
* Walker to output an unordered list of category checkbox <input> elements. * Walker to output an unordered list of category checkbox input elements.
*
* @since 2.5.1
* *
* @see Walker * @see Walker
* @see wp_category_checklist() * @see wp_category_checklist()
* @see wp_terms_checklist() * @see wp_terms_checklist()
* @since 2.5.1
*/ */
class Walker_Category_Checklist extends Walker { class Walker_Category_Checklist extends Walker {
public $tree_type = 'category'; public $tree_type = 'category';
@ -112,12 +113,15 @@ class Walker_Category_Checklist extends Walker {
} }
/** /**
* Output an unordered list of checkbox <input> elements labelled * Output an unordered list of checkbox input elements labelled
* with category names. * with category names.
* *
* @see wp_terms_checklist()
* @since 2.5.1 * @since 2.5.1
* *
* @todo Properly document optional arguments as such.
*
* @see wp_terms_checklist()
*
* @param int $post_id Mark categories associated with this post as checked. $selected_cats must not be an array. * @param int $post_id Mark categories associated with this post as checked. $selected_cats must not be an array.
* @param int $descendants_and_self ID of the category to output along with its descendents. * @param int $descendants_and_self ID of the category to output along with its descendents.
* @param bool|array $selected_cats List of categories to mark as checked. * @param bool|array $selected_cats List of categories to mark as checked.
@ -137,13 +141,16 @@ function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $select
} }
/** /**
* Output an unordered list of checkbox <input> elements labelled * Output an unordered list of checkbox input elements labelled with term names.
* with term names. Taxonomy independent version of wp_category_checklist(). *
* Taxonomy independent version of {@see wp_category_checklist()}.
* *
* @since 3.0.0 * @since 3.0.0
* *
* @param int $post_id * @todo Properly document optional default arguments.
* @param array $args *
* @param int $post_id Post ID.
* @param array $args Arguments to form the terms checklist.
*/ */
function wp_terms_checklist( $post_id = 0, $args = array() ) { function wp_terms_checklist( $post_id = 0, $args = array() ) {
$defaults = array( $defaults = array(
@ -236,7 +243,7 @@ function wp_terms_checklist( $post_id = 0, $args = array() ) {
* Retrieve a list of the most popular terms from the specified taxonomy. * Retrieve a list of the most popular terms from the specified taxonomy.
* *
* If the $echo argument is true then the elements for a list of checkbox * If the $echo argument is true then the elements for a list of checkbox
* <input> elements labelled with the names of the selected terms is output. * `<input>` elements labelled with the names of the selected terms is output.
* If the $post_ID global isn't empty then the terms associated with that * If the $post_ID global isn't empty then the terms associated with that
* post will be marked as checked. * post will be marked as checked.
* *
@ -782,7 +789,7 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
} }
/** /**
* Print out <option> HTML elements for the page templates drop-down. * Print out option HTML elements for the page templates drop-down.
* *
* @since 1.5.0 * @since 1.5.0
* *
@ -798,7 +805,7 @@ function page_template_dropdown( $default = '' ) {
} }
/** /**
* Print out <option> HTML elements for the page parents drop-down. * Print out option HTML elements for the page parents drop-down.
* *
* @since 1.5.0 * @since 1.5.0
* *
@ -831,7 +838,7 @@ function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) {
} }
/** /**
* Print out <option> html elements for role selectors * Print out option html elements for role selectors.
* *
* @since 2.1.0 * @since 2.1.0
* *
@ -1307,12 +1314,15 @@ function do_settings_fields($page, $section) {
* *
* @since 3.0.0 * @since 3.0.0
* *
* @todo Properly document optional arguments as such.
*
* @global array $wp_settings_errors Storage array of errors registered during this pageload * @global array $wp_settings_errors Storage array of errors registered during this pageload
* *
* @param string $setting Slug title of the setting to which this error applies * @param string $setting Slug title of the setting to which this error applies
* @param string $code Slug-name to identify the error. Used as part of 'id' attribute in HTML output. * @param string $code Slug-name to identify the error. Used as part of 'id' attribute in HTML output.
* @param string $message The formatted message text to display to the user (will be shown inside styled <div> and <p>) * @param string $message The formatted message text to display to the user (will be shown inside styled
* @param string $type The type of message it is, controls HTML class. Use 'error' or 'updated'. * `<div>` and `<p>` tags).
* @param string $type The type of message it is, controls HTML class. Use 'error' or 'updated'.
*/ */
function add_settings_error( $setting, $code, $message, $type = 'error' ) { function add_settings_error( $setting, $code, $message, $type = 'error' ) {
global $wp_settings_errors; global $wp_settings_errors;
@ -1382,20 +1392,24 @@ function get_settings_errors( $setting = '', $sanitize = false ) {
} }
/** /**
* Display settings errors registered by add_settings_error() * Display settings errors registered by {@see add_settings_error()}.
* *
* Part of the Settings API. Outputs a <div> for each error retrieved by get_settings_errors(). * Part of the Settings API. Outputs a div for each error retrieved by
* {@see get_settings_errors()}.
* *
* This is called automatically after a settings page based on the Settings API is submitted. * This is called automatically after a settings page based on the
* Errors should be added during the validation callback function for a setting defined in register_setting() * Settings API is submitted. Errors should be added during the validation
* callback function for a setting defined in {@see register_setting()}
* *
* The $sanitize option is passed into get_settings_errors() and will re-run the setting sanitization * The $sanitize option is passed into {@see get_settings_errors()} and will
* re-run the setting sanitization
* on its current value. * on its current value.
* *
* The $hide_on_update option will cause errors to only show when the settings page is first loaded. * The $hide_on_update option will cause errors to only show when the settings
* if the user has already saved new values it will be hidden to avoid repeating messages already * page is first loaded. if the user has already saved new values it will be
* shown in the default error reporting after submission. This is useful to show general errors like missing * hidden to avoid repeating messages already shown in the default error
* settings when the user arrives at the settings page. * reporting after submission. This is useful to show general errors like
* missing settings when the user arrives at the settings page.
* *
* @since 3.0.0 * @since 3.0.0
* *

View File

@ -155,8 +155,8 @@ function get_taxonomies( $args = array(), $output = 'names', $operator = 'and' )
* It appears that this function can be used to find all of the names inside of * It appears that this function can be used to find all of the names inside of
* $wp_taxonomies global variable. * $wp_taxonomies global variable.
* *
* <code><?php $taxonomies = get_object_taxonomies('post'); ?></code> Should * `<?php $taxonomies = get_object_taxonomies('post'); ?>` Should
* result in <code>Array('category', 'post_tag')</code> * result in `Array( 'category', 'post_tag' )`
* *
* @since 2.3.0 * @since 2.3.0
* *
@ -434,13 +434,14 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
* Builds an object with all taxonomy labels out of a taxonomy object * Builds an object with all taxonomy labels out of a taxonomy object
* *
* Accepted keys of the label array in the taxonomy object: * Accepted keys of the label array in the taxonomy object:
*
* - name - general name for the taxonomy, usually plural. The same as and overridden by $tax->label. Default is Tags/Categories * - name - general name for the taxonomy, usually plural. The same as and overridden by $tax->label. Default is Tags/Categories
* - singular_name - name for one object of this taxonomy. Default is Tag/Category * - singular_name - name for one object of this taxonomy. Default is Tag/Category
* - search_items - Default is Search Tags/Search Categories * - search_items - Default is Search Tags/Search Categories
* - popular_items - This string isn't used on hierarchical taxonomies. Default is Popular Tags * - popular_items - This string isn't used on hierarchical taxonomies. Default is Popular Tags
* - all_items - Default is All Tags/All Categories * - all_items - Default is All Tags/All Categories
* - parent_item - This string isn't used on non-hierarchical taxonomies. In hierarchical ones the default is Parent Category * - parent_item - This string isn't used on non-hierarchical taxonomies. In hierarchical ones the default is Parent Category
* - parent_item_colon - The same as <code>parent_item</code>, but with colon <code>:</code> in the end * - parent_item_colon - The same as `parent_item`, but with colon `:ё in the end
* - edit_item - Default is Edit Tag/Edit Category * - edit_item - Default is Edit Tag/Edit Category
* - view_item - Default is View Tag/View Category * - view_item - Default is View Tag/View Category
* - update_item - Default is Update Tag/Update Category * - update_item - Default is Update Tag/Update Category

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.1-beta2-30545'; $wp_version = '4.1-beta2-30546';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -1172,10 +1172,8 @@ class wpdb {
* *
* Both %d and %s should be left unquoted in the query string. * Both %d and %s should be left unquoted in the query string.
* *
* <code> * wpdb::prepare( "SELECT * FROM `table` WHERE `column` = %s AND `field` = %d", 'foo', 1337 )
* wpdb::prepare( "SELECT * FROM `table` WHERE `column` = %s AND `field` = %d", 'foo', 1337 ) * wpdb::prepare( "SELECT DATE_FORMAT(`field`, '%%c') FROM `table` WHERE `column` = %s", 'foo' );
* wpdb::prepare( "SELECT DATE_FORMAT(`field`, '%%c') FROM `table` WHERE `column` = %s", 'foo' );
* </code>
* *
* @link http://php.net/sprintf Description of syntax. * @link http://php.net/sprintf Description of syntax.
* @since 2.3.0 * @since 2.3.0
@ -1724,10 +1722,8 @@ class wpdb {
/** /**
* Insert a row into a table. * Insert a row into a table.
* *
* <code> * wpdb::insert( 'table', array( 'column' => 'foo', 'field' => 'bar' ) )
* wpdb::insert( 'table', array( 'column' => 'foo', 'field' => 'bar' ) ) * wpdb::insert( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( '%s', '%d' ) )
* wpdb::insert( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( '%s', '%d' ) )
* </code>
* *
* @since 2.5.0 * @since 2.5.0
* @see wpdb::prepare() * @see wpdb::prepare()
@ -1747,10 +1743,8 @@ class wpdb {
/** /**
* Replace a row into a table. * Replace a row into a table.
* *
* <code> * wpdb::replace( 'table', array( 'column' => 'foo', 'field' => 'bar' ) )
* wpdb::replace( 'table', array( 'column' => 'foo', 'field' => 'bar' ) ) * wpdb::replace( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( '%s', '%d' ) )
* wpdb::replace( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( '%s', '%d' ) )
* </code>
* *
* @since 3.0.0 * @since 3.0.0
* @see wpdb::prepare() * @see wpdb::prepare()
@ -1814,10 +1808,8 @@ class wpdb {
/** /**
* Update a row in the table * Update a row in the table
* *
* <code> * wpdb::update( 'table', array( 'column' => 'foo', 'field' => 'bar' ), array( 'ID' => 1 ) )
* wpdb::update( 'table', array( 'column' => 'foo', 'field' => 'bar' ), array( 'ID' => 1 ) ) * wpdb::update( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( 'ID' => 1 ), array( '%s', '%d' ), array( '%d' ) )
* wpdb::update( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( 'ID' => 1 ), array( '%s', '%d' ), array( '%d' ) )
* </code>
* *
* @since 2.5.0 * @since 2.5.0
* @see wpdb::prepare() * @see wpdb::prepare()
@ -1868,10 +1860,8 @@ class wpdb {
/** /**
* Delete a row in the table * Delete a row in the table
* *
* <code> * wpdb::delete( 'table', array( 'ID' => 1 ) )
* wpdb::delete( 'table', array( 'ID' => 1 ) ) * wpdb::delete( 'table', array( 'ID' => 1 ), array( '%d' ) )
* wpdb::delete( 'table', array( 'ID' => 1 ), array( '%d' ) )
* </code>
* *
* @since 3.4.0 * @since 3.4.0
* @see wpdb::prepare() * @see wpdb::prepare()

View File

@ -25,7 +25,8 @@ if ( force_ssl_admin() && ! is_ssl() ) {
/** /**
* Output the login page header. * Output the login page header.
* *
* @param string $title Optional. WordPress Log In Page title to display in <title> element. Default 'Log In'. * @param string $title Optional. WordPress login Page title to display in the `<title>` element.
* Default 'Log In'.
* @param string $message Optional. Message to display in header. Default empty. * @param string $message Optional. Message to display in header. Default empty.
* @param WP_Error $wp_error Optional. The error to pass. Default empty. * @param WP_Error $wp_error Optional. The error to pass. Default empty.
*/ */
@ -537,7 +538,7 @@ case 'retrievepassword' :
</p> </p>
<?php <?php
/** /**
* Fires inside the lostpassword <form> tags, before the hidden fields. * Fires inside the lostpassword form tags, before the hidden fields.
* *
* @since 2.1.0 * @since 2.1.0
*/ */

View File

@ -19,7 +19,7 @@ if ( is_array( get_site_option( 'illegal_names' )) && isset( $_GET[ 'new' ] ) &&
*/ */
function do_signup_header() { function do_signup_header() {
/** /**
* Fires within the <head> section of the site sign-up screen. * Fires within the head section of the site sign-up screen.
* *
* @since 3.0.0 * @since 3.0.0
*/ */