WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#15373 closed defect (bug) (fixed)

wp_list_widgets function has no parameters, but documentation says contrary

Reported by: jottlieb Owned by:
Milestone: 3.1 Priority: normal
Severity: minor Version: 3.0.1
Component: Widgets Keywords: widgets, wp_list_widgets
Focuses: Cc:

Description

The documentation of the function wp_list_widgets tells us:

/**
 * Display list of the available widgets, either all or matching search.
 *
 * The search parameter are search terms separated by spaces.
 *
 * @since unknown
 *
 * @param string $show Optional, default is all. What to display, can be 'all', 'unused', or 'used'.
 * @param string $_search Optional. Search for widgets. Should be unsanitized.
 */
function wp_list_widgets() {

But in the function, these parameters are never read or used. So you can't search for a special widget.

Change History (2)

comment:1 nacin3 years ago

  • Milestone changed from Awaiting Review to 3.1

It's only for listing available widgets. wp_list_widget_controls() is used for the other areas, which would explain the lack of functionality for $show and such. Search was pulled in 2.8. See #9511, [11041].

I'm killing the documentation and also documenting the @since, since I'm tracking it down.

comment:2 nacin3 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [16269]) Update phpdoc for wp_list_widgets(). fixes #15373.

Note: See TracTickets for help on using tickets.