WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/23/2016 06:04:22 PM (5 years ago)
Author:
DrewAPicture
Message:

Docs: Update the type for $callback parameters to callable in DocBlocks for add_settings_section() and add_settings_field().

Props aidanlane.
Fixes #35772.

File:
1 edited

Legend:

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

    r36328 r36642  
    11871187 * @global $wp_settings_sections Storage array of all settings sections added to admin pages
    11881188 *
    1189  * @param string $id       Slug-name to identify the section. Used in the 'id' attribute of tags.
    1190  * @param string $title    Formatted title of the section. Shown as the heading for the section.
    1191  * @param string $callback Function that echos out any content at the top of the section (between heading and fields).
    1192  * @param string $page     The slug-name of the settings page on which to show the section. Built-in pages include 'general', 'reading', 'writing', 'discussion', 'media', etc. Create your own using add_options_page();
     1189 * @param string   $id       Slug-name to identify the section. Used in the 'id' attribute of tags.
     1190 * @param string   $title    Formatted title of the section. Shown as the heading for the section.
     1191 * @param callable $callback Function that echos out any content at the top of the section (between heading and fields).
     1192 * @param string   $page     The slug-name of the settings page on which to show the section. Built-in pages include
     1193 *                           'general', 'reading', 'writing', 'discussion', 'media', etc. Create your own using
     1194 *                           add_options_page();
    11931195 */
    11941196function add_settings_section($id, $title, $callback, $page) {
     
    12241226 * @global $wp_settings_fields Storage array of settings fields and info about their pages/sections
    12251227 *
    1226  * @param string $id       Slug-name to identify the field. Used in the 'id' attribute of tags.
    1227  * @param string $title    Formatted title of the field. Shown as the label for the field
    1228  *                         during output.
    1229  * @param string $callback Function that fills the field with the desired form inputs. The
    1230  *                         function should echo its output.
    1231  * @param string $page     The slug-name of the settings page on which to show the section
    1232  *                         (general, reading, writing, ...).
    1233  * @param string $section  Optional. The slug-name of the section of the settings page
    1234  *                         in which to show the box. Default 'default'.
    1235  * @param array  $args {
     1228 * @param string   $id       Slug-name to identify the field. Used in the 'id' attribute of tags.
     1229 * @param string   $title    Formatted title of the field. Shown as the label for the field
     1230 *                           during output.
     1231 * @param callable $callback Function that fills the field with the desired form inputs. The
     1232 *                           function should echo its output.
     1233 * @param string   $page     The slug-name of the settings page on which to show the section
     1234 *                           (general, reading, writing, ...).
     1235 * @param string   $section  Optional. The slug-name of the section of the settings page
     1236 *                           in which to show the box. Default 'default'.
     1237 * @param array    $args {
    12361238 *     Optional. Extra arguments used when outputting the field.
    12371239 *
Note: See TracChangeset for help on using the changeset viewer.