WordPress.org

Make WordPress Core

Changeset 30769


Ignore:
Timestamp:
12/07/2014 11:00:57 AM (6 years ago)
Author:
DrewAPicture
Message:

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

Props coffee2code.
See #28298.

File:
1 edited

Legend:

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

    r30745 r30769  
    628628 * If you wanted to quickly create multiple sidebars for a theme or internally.
    629629 * This function will allow you to do so. If you don't pass the 'name' and/or
    630  * 'id' in $args, then they will be built for you.
    631  *
    632  * The default for the name is "Sidebar #", with '#' being replaced with the
    633  * number the sidebar is currently when greater than one. If first sidebar, the
    634  * name will be just "Sidebar". The default for id is "sidebar-" followed by the
    635  * number the sidebar creation is currently at. If the id is provided, and multiple
    636  * sidebars are being defined, the id will have "-2" appended, and so on.
     630 * 'id' in `$args`, then they will be built for you.
    637631 *
    638632 * @since 2.2.0
     
    640634 * @see register_sidebar() The second parameter is documented by register_sidebar() and is the same here.
    641635 *
    642  * @param int $number Number of sidebars to create.
    643  * @param string|array $args Builds Sidebar based off of 'name' and 'id' values.
    644  */
    645 function register_sidebars($number = 1, $args = array()) {
     636 * @param int          $number Optional. Number of sidebars to create. Default 1.
     637 * @param array|string $args {
     638 *     Optional. Array or string of arguments for building a sidebar.
     639 *
     640 *     @type string $id   The base string of the unique identifier for each sidebar. If provided, and multiple
     641 *                        sidebars are being defined, the id will have "-2" appended, and so on.
     642 *                        Default 'sidebar-' followed by the number the sidebar creation is currently at.
     643 *     @type string $name The name or title for the sidebars displayed in the admin dashboard. If registering
     644 *                        more than one sidebar, include '%d' in the string as a placeholder for the uniquely
     645 *                        assigned number for each sidebar.
     646 *                        Default 'Sidebar' for the first sidebar, otherwise 'Sidebar %d'.
     647 * }
     648 */
     649function register_sidebars( $number = 1, $args = array() ) {
    646650    global $wp_registered_sidebars;
    647651    $number = (int) $number;
Note: See TracChangeset for help on using the changeset viewer.