Clean up and refine DocBlocks for a variety of functions and methods in wp-admin/includes/template.php.

* Also documents the default arguments of `wp_terms_checklist()` as a hash notation.

Props ipm-frommen, DrewAPicture.
Fixes #31248.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31580 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Drew Jaynes 2015-03-02 06:11:40 +00:00
parent acc6c422e2
commit 0b3c3092fc
2 changed files with 53 additions and 36 deletions

View File

@ -113,21 +113,23 @@ class Walker_Category_Checklist extends Walker {
}
/**
* Output an unordered list of checkbox input elements labelled
* with category names.
* Output an unordered list of checkbox input elements labeled with category names.
*
* @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 $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 $popular_cats Override the list of categories that receive the "popular-category" class.
* @param object $walker Walker object to use to build the output.
* @param bool $checked_ontop Move checked items out of the hierarchy and to the top of the list.
* @param int $post_id Optional. Post to generate a categories checklist for. Default 0.
* $selected_cats must not be an array. Default 0.
* @param int $descendants_and_self Optional. ID of the category to output along with its descendants.
* Default 0.
* @param array $selected_cats Optional. List of categories to mark as checked. Default false.
* @param array $popular_cats Optional. List of categories to receive the "popular-category" class.
* Default false.
* @param object $walker Optional. Walker object to use to build the output.
* Default is a Walker_Category_Checklist instance.
* @param bool $checked_ontop Optional. Whether to move checked items out of the hierarchy and to
* the top of the list. Default true.
*/
function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null, $checked_ontop = true ) {
wp_terms_checklist( $post_id, array(
@ -143,14 +145,25 @@ function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $select
/**
* Output an unordered list of checkbox input elements labelled with term names.
*
* Taxonomy independent version of {@see wp_category_checklist()}.
* Taxonomy-independent version of wp_category_checklist().
*
* @since 3.0.0
*
* @todo Properly document optional default arguments.
* @param int $post_id Optional. Post ID. Default 0.
* @param array|string $args {
* Optional. Array or string of arguments for generating a terms checklist. Default empty array.
*
* @param int $post_id Post ID.
* @param array $args Arguments to form the terms checklist.
* @type int $descendants_and_self ID of the category to output along with its descendants.
* Default 0.
* @type array $selected_cats List of categories to mark as checked. Default false.
* @type array $popular_cats List of categories to receive the "popular-category" class.
* Default false.
* @type object $walker Walker object to use to build the output.
* Default is a Walker_Category_Checklist instance.
* @type string $taxonomy Taxonomy to generate the checklist for. Default 'category'.
* @type bool $checked_ontop Whether to move checked items out of the hierarchy and to
* the top of the list. Default true.
* }
*/
function wp_terms_checklist( $post_id = 0, $args = array() ) {
$defaults = array(
@ -328,13 +341,12 @@ function wp_link_category_checklist( $link_id = 0 ) {
}
}
// adds hidden fields with the data for use in the inline editor for posts and pages
/**
* {@internal Missing Short Description}}
* Adds hidden fields with the data for use in the inline editor for posts and pages.
*
* @since 2.7.0
*
* @param WP_Post $post
* @param WP_Post $post Post object.
*/
function get_inline_data($post) {
$post_type_object = get_post_type_object($post->post_type);
@ -1338,15 +1350,14 @@ function do_settings_fields($page, $section) {
*
* @since 3.0.0
*
* @todo Properly document optional arguments as such.
*
* @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 $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>` tags).
* @param string $type The type of message it is, controls HTML class. Use 'error' or 'updated'.
* @param string $type Optional. Message type, controls HTML class. Accepts 'error' or 'updated'.
* Default 'error'.
*/
function add_settings_error( $setting, $code, $message, $type = 'error' ) {
global $wp_settings_errors;
@ -1538,7 +1549,6 @@ function _draft_or_post_title( $post = 0 ) {
* should only be used when {@link the_search_query()} cannot.
*
* @since 2.7.0
*
*/
function _admin_search_query() {
echo isset($_REQUEST['s']) ? esc_attr( wp_unslash( $_REQUEST['s'] ) ) : '';
@ -1548,9 +1558,9 @@ function _admin_search_query() {
* Generic Iframe header for use with Thickbox
*
* @since 2.7.0
* @param string $title Title of the Iframe page.
* @param bool $deprecated Not used.
*
* @param string $title Optional. Title of the Iframe page. Default empty.
* @param bool $deprecated Not used.
*/
function iframe_header( $title = '', $deprecated = false ) {
show_admin_bar( false );
@ -1625,7 +1635,6 @@ document.body.className = c;
* Generic Iframe footer for use with Thickbox
*
* @since 2.7.0
*
*/
function iframe_footer() {
/*
@ -1824,17 +1833,21 @@ function submit_button( $text = null, $type = 'primary', $name = 'submit', $wrap
*
* @since 3.1.0
*
* @param string $text The text of the button (defaults to 'Save Changes')
* @param string $type The type of button. One of: primary, secondary, delete
* @param string $name The HTML name of the submit button. Defaults to "submit". If no id attribute
* is given in $other_attributes below, $name will be used as the button's id.
* @param bool $wrap True if the output button should be wrapped in a paragraph tag,
* false otherwise. Defaults to true
* @param array|string $other_attributes Other attributes that should be output with the button,
* mapping attributes to their values, such as array( 'tabindex' => '1' ).
* These attributes will be output as attribute="value", such as tabindex="1".
* Defaults to no other attributes. Other attributes can also be provided as a
* string such as 'tabindex="1"', though the array format is typically cleaner.
* @param string $text Optional. The text of the button. Default 'Save Changes'.
* @param string $type Optional. The type of button. Accepts 'primary', 'secondary',
* or 'delete'. Default 'primary large'.
* @param string $name Optional. The HTML name of the submit button. Defaults to "submit".
* If no id attribute is given in $other_attributes below, `$name` will
* be used as the button's id. Default 'submit'.
* @param bool $wrap Optional. True if the output button should be wrapped in a paragraph
* tag, false otherwise. Default true.
* @param array|string $other_attributes Optional. Other attributes that should be output with the button,
* mapping attributes to their values, such as `array( 'tabindex' => '1' )`.
* These attributes will be output as `attribute="value"`, such as
* `tabindex="1"`. Other attributes can also be provided as a string such
* as `tabindex="1"`, though the array format is typically cleaner.
* Default empty.
* @return string Submit button HTML.
*/
function get_submit_button( $text = '', $type = 'primary large', $name = 'submit', $wrap = true, $other_attributes = '' ) {
if ( ! is_array( $type ) )
@ -1922,6 +1935,8 @@ final class WP_Internal_Pointers {
*
* Individual pointers (e.g. wp390_widgets) can be disabled using the following:
* remove_action( 'admin_print_footer_scripts', array( 'WP_Internal_Pointers', 'pointer_wp390_widgets' ) );
*
* @param string $hook_suffix The current admin page.
*/
public static function enqueue_scripts( $hook_suffix ) {
/*
@ -2089,6 +2104,8 @@ final class WP_Internal_Pointers {
* Prevents new users from seeing existing 'new feature' pointers.
*
* @since 3.3.0
*
* @param int $user_id User ID.
*/
public static function dismiss_pointers_for_new_users( $user_id ) {
add_user_meta( $user_id, 'dismissed_wp_pointers', 'wp360_locks,wp390_widgets' );

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.2-alpha-31598';
$wp_version = '4.2-alpha-31599';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.