WordPress.org

Make WordPress Core

Changeset 30745


Ignore:
Timestamp:
12/05/2014 03:37:48 AM (6 years ago)
Author:
DrewAPicture
Message:

Document the default arguments for register_sidebar() in the hash notation style.

Props coffee2code.
See #28298.

File:
1 edited

Legend:

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

    r30691 r30745  
    690690 * called, it will be automatically enabled through the use of add_theme_support()
    691691 *
    692  * Arguments passed as a string should be separated by '&':
    693  *
    694  *     e.g. 'name=Sidebar&id=my_prefix_sidebar'
    695  *
    696  * The same arguments passed as an array:
    697  *
    698  *     array(
    699  *         'name' => 'Sidebar',
    700  *         'id'   => 'my_prefix_sidebar',
    701  *     )
    702  *
    703  * Arguments:
    704  *     name          - The name or title of the sidebar displayed in the admin dashboard.
    705  *     id            - The unique identifier by which the sidebar will be called.
    706  *     before_widget - HTML content that will be prepended to each widget's HTML output
    707  *                     when assigned to this sidebar.
    708  *     after_widget  - HTML content that will be appended to each widget's HTML output
    709  *                     when assigned to this sidebar.
    710  *     before_title  - HTML content that will be prepended to the sidebar title when displayed.
    711  *     after_title   - HTML content that will be appended to the sidebar title when displayed.
    712  *
    713692 * @since 2.2.0
    714  * @uses $wp_registered_sidebars Stores the new sidebar in this array by sidebar ID.
    715  *
    716  * @param string|array $args Arguments for the sidebar being registered.
     693 *
     694 * @global array $wp_registered_sidebars Stores the new sidebar in this array by sidebar ID.
     695 *
     696 * @param array|string $args {
     697 *     Optional. Array or string of arguments for the sidebar being registered.
     698 *
     699 *     @type string $name          The name or title of the sidebar displayed in the Widgets
     700 *                                 interface. Default 'Sidebar $instance'.
     701 *     @type string $id            The unique identifier by which the sidebar will be called.
     702 *                                 Default 'sidebar-$instance'.
     703 *     @type string $description   Description of the sidebar, displayed in the Widgets interface.
     704 *                                 Default empty string.
     705 *     @type string $class         Extra CSS class to assign to the sidebar in the Widgets interface.
     706 *                                 Default empty.
     707 *     @type string $before_widget HTML content to prepend to each widget's HTML output when
     708 *                                 assigned to this sidebar. Default is an opening list item element.
     709 *     @type string $after_widget  HTML content to append to each widget's HTML output when
     710 *                                 assigned to this sidebar. Default is a closing list item element.
     711 *     @type string $before_title  HTML content to prepend to the sidebar title when displayed.
     712 *                                 Default is an opening h2 element.
     713 *     @type string $after_title   HTML content to append to the sidebar title when displayed.
     714 *                                 Default is a closing h2 element.
     715 * }
    717716 * @return string Sidebar ID added to $wp_registered_sidebars global.
    718717 */
Note: See TracChangeset for help on using the changeset viewer.