WordPress.org

Make WordPress Core

Ticket #28298: 28298.register_sidebars.diff

File 28298.register_sidebars.diff, 1.9 KB (added by coffee2code, 6 years ago)

Add documentation for default arguments in register_sidebars().

  • src/wp-includes/widgets.php

     
    629629 * This function will allow you to do so. If you don't pass the 'name' and/or
    630630 * 'id' in $args, then they will be built for you.
    631631 *
    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.
    637  *
    638632 * @since 2.2.0
    639633 *
    640634 * @see register_sidebar() The second parameter is documented by register_sidebar() and is the same here.
    641635 *
    642636 * @param int $number Number of sidebars to create.
    643  * @param string|array $args Builds Sidebar based off of 'name' and 'id' values.
     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 * }
    644648 */
    645649function register_sidebars($number = 1, $args = array()) {
    646650        global $wp_registered_sidebars;