Make WordPress Core

Changeset 35864


Ignore:
Timestamp:
12/11/2015 03:23:26 PM (8 years ago)
Author:
DrewAPicture
Message:

Docs: Document the optional $options parameter for wp_register_widget_control() as a hash notation.

Props stephanethomas.
Fixes #34855.

File:
1 edited

Legend:

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

    r35725 r35864  
    446446 * Registers widget control callback for customizing options.
    447447 *
    448  * The options contains the 'height', 'width', and 'id_base' keys. The 'height'
    449  * option is never used. The 'width' option is the width of the fully expanded
    450  * control form, but try hard to use the default width. The 'id_base' is for
    451  * multi-widgets (widgets which allow multiple instances such as the text
    452  * widget), an id_base must be provided. The widget id will end up looking like
    453  * `{$id_base}-{$unique_number}`.
    454  *
    455  * @since 2.2.0
    456  *
    457  * @todo Document `$options` as a hash notation, re: WP_Widget::__construct() cross-reference.
     448 * @since 2.2.0
     449 *
    458450 * @todo `$params` parameter?
    459451 *
     
    466458 * @param string       $name             Sidebar display name.
    467459 * @param callable     $control_callback Run when sidebar is displayed.
    468  * @param array|string $options          Optional. Widget options. See description above. Default empty array.
     460 * @param array $options {
     461 *     Optional. Array or string of control options. Default empty array.
     462 *
     463 *     @type int        $height  Never used. Default 200.
     464 *     @type int        $width   Width of the fully expanded control form (but try hard to use the default width).
     465 *                               Default 250.
     466 *     @type int|string $id_base Required for multi-widgets, i.e widgets that allow multiple instances such as the
     467 *                               text widget. The widget id will end up looking like `{$id_base}-{$unique_number}`.
     468 * }
    469469 */
    470470function wp_register_widget_control( $id, $name, $control_callback, $options = array() ) {
Note: See TracChangeset for help on using the changeset viewer.