Make WordPress Core

Changeset 31599


Ignore:
Timestamp:
03/02/2015 06:10:08 AM (10 years ago)
Author:
DrewAPicture
Message:

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.

File:
1 edited

Legend:

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

    r31593 r31599  
    114114
    115115/**
    116  * Output an unordered list of checkbox input elements labelled
    117  * with category names.
     116 * Output an unordered list of checkbox input elements labeled with category names.
    118117 *
    119118 * @since 2.5.1
    120119 *
    121  * @todo Properly document optional arguments as such.
    122  *
    123120 * @see wp_terms_checklist()
    124121 *
    125  * @param int $post_id Mark categories associated with this post as checked. $selected_cats must not be an array.
    126  * @param int $descendants_and_self ID of the category to output along with its descendents.
    127  * @param bool|array $selected_cats List of categories to mark as checked.
    128  * @param bool|array $popular_cats Override the list of categories that receive the "popular-category" class.
    129  * @param object $walker Walker object to use to build the output.
    130  * @param bool $checked_ontop Move checked items out of the hierarchy and to the top of the list.
     122 * @param int    $post_id              Optional. Post to generate a categories checklist for. Default 0.
     123 *                                     $selected_cats must not be an array. Default 0.
     124 * @param int    $descendants_and_self Optional. ID of the category to output along with its descendants.
     125 *                                     Default 0.
     126 * @param array  $selected_cats        Optional. List of categories to mark as checked. Default false.
     127 * @param array  $popular_cats         Optional. List of categories to receive the "popular-category" class.
     128 *                                     Default false.
     129 * @param object $walker               Optional. Walker object to use to build the output.
     130 *                                     Default is a Walker_Category_Checklist instance.
     131 * @param bool   $checked_ontop        Optional. Whether to move checked items out of the hierarchy and to
     132 *                                     the top of the list. Default true.
    131133 */
    132134function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null, $checked_ontop = true ) {
     
    144146 * Output an unordered list of checkbox input elements labelled with term names.
    145147 *
    146  * Taxonomy independent version of {@see wp_category_checklist()}.
     148 * Taxonomy-independent version of wp_category_checklist().
    147149 *
    148150 * @since 3.0.0
    149151 *
    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.
     152 * @param int          $post_id Optional. Post ID. Default 0.
     153 * @param array|string $args {
     154 *     Optional. Array or string of arguments for generating a terms checklist. Default empty array.
     155 *
     156 *     @type int    $descendants_and_self ID of the category to output along with its descendants.
     157 *                                        Default 0.
     158 *     @type array  $selected_cats        List of categories to mark as checked. Default false.
     159 *     @type array  $popular_cats         List of categories to receive the "popular-category" class.
     160 *                                        Default false.
     161 *     @type object $walker               Walker object to use to build the output.
     162 *                                        Default is a Walker_Category_Checklist instance.
     163 *     @type string $taxonomy             Taxonomy to generate the checklist for. Default 'category'.
     164 *     @type bool   $checked_ontop        Whether to move checked items out of the hierarchy and to
     165 *                                        the top of the list. Default true.
     166 * }
    154167 */
    155168function wp_terms_checklist( $post_id = 0, $args = array() ) {
     
    329342}
    330343
    331 // adds hidden fields with the data for use in the inline editor for posts and pages
    332 /**
    333  * {@internal Missing Short Description}}
     344/**
     345 * Adds hidden fields with the data for use in the inline editor for posts and pages.
    334346 *
    335347 * @since 2.7.0
    336348 *
    337  * @param WP_Post $post
     349 * @param WP_Post $post Post object.
    338350 */
    339351function get_inline_data($post) {
     
    13391351 * @since 3.0.0
    13401352 *
    1341  * @todo Properly document optional arguments as such.
    1342  *
    13431353 * @global array $wp_settings_errors Storage array of errors registered during this pageload
    13441354 *
     
    13471357 * @param string $message The formatted message text to display to the user (will be shown inside styled
    13481358 *                        `<div>` and `<p>` tags).
    1349  * @param string $type    The type of message it is, controls HTML class. Use 'error' or 'updated'.
     1359 * @param string $type    Optional. Message type, controls HTML class. Accepts 'error' or 'updated'.
     1360 *                        Default 'error'.
    13501361 */
    13511362function add_settings_error( $setting, $code, $message, $type = 'error' ) {
     
    15391550 *
    15401551 * @since 2.7.0
    1541  *
    15421552 */
    15431553function _admin_search_query() {
     
    15491559 *
    15501560 * @since 2.7.0
    1551  * @param string $title Title of the Iframe page.
    1552  * @param bool $deprecated Not used.
    1553  *
     1561 *
     1562 * @param string $title      Optional. Title of the Iframe page. Default empty.
     1563 * @param bool   $deprecated Not used.
    15541564 */
    15551565function iframe_header( $title = '', $deprecated = false ) {
     
    16261636 *
    16271637 * @since 2.7.0
    1628  *
    16291638 */
    16301639function iframe_footer() {
     
    18251834 * @since 3.1.0
    18261835 *
    1827  * @param string $text The text of the button (defaults to 'Save Changes')
    1828  * @param string $type The type of button. One of: primary, secondary, delete
    1829  * @param string $name The HTML name of the submit button. Defaults to "submit". If no id attribute
    1830  *               is given in $other_attributes below, $name will be used as the button's id.
    1831  * @param bool $wrap True if the output button should be wrapped in a paragraph tag,
    1832  *             false otherwise. Defaults to true
    1833  * @param array|string $other_attributes Other attributes that should be output with the button,
    1834  *                     mapping attributes to their values, such as array( 'tabindex' => '1' ).
    1835  *                     These attributes will be output as attribute="value", such as tabindex="1".
    1836  *                     Defaults to no other attributes. Other attributes can also be provided as a
    1837  *                     string such as 'tabindex="1"', though the array format is typically cleaner.
     1836 * @param string       $text             Optional. The text of the button. Default 'Save Changes'.
     1837 * @param string       $type             Optional. The type of button. Accepts 'primary', 'secondary',
     1838 *                                       or 'delete'. Default 'primary large'.
     1839 * @param string       $name             Optional. The HTML name of the submit button. Defaults to "submit".
     1840 *                                       If no id attribute is given in $other_attributes below, `$name` will
     1841 *                                       be used as the button's id. Default 'submit'.
     1842 * @param bool         $wrap             Optional. True if the output button should be wrapped in a paragraph
     1843 *                                       tag, false otherwise. Default true.
     1844 * @param array|string $other_attributes Optional. Other attributes that should be output with the button,
     1845 *                                       mapping attributes to their values, such as `array( 'tabindex' => '1' )`.
     1846 *                                       These attributes will be output as `attribute="value"`, such as
     1847 *                                       `tabindex="1"`. Other attributes can also be provided as a string such
     1848 *                                       as `tabindex="1"`, though the array format is typically cleaner.
     1849 *                                       Default empty.
     1850 * @return string Submit button HTML.
    18381851 */
    18391852function get_submit_button( $text = '', $type = 'primary large', $name = 'submit', $wrap = true, $other_attributes = '' ) {
     
    19231936     * Individual pointers (e.g. wp390_widgets) can be disabled using the following:
    19241937     *     remove_action( 'admin_print_footer_scripts', array( 'WP_Internal_Pointers', 'pointer_wp390_widgets' ) );
     1938     *
     1939     * @param string $hook_suffix The current admin page.
    19251940     */
    19261941    public static function enqueue_scripts( $hook_suffix ) {
     
    20902105     *
    20912106     * @since 3.3.0
     2107     *
     2108     * @param int $user_id User ID.
    20922109     */
    20932110    public static function dismiss_pointers_for_new_users( $user_id ) {
Note: See TracChangeset for help on using the changeset viewer.