WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/wp get sidebars widgets


This function's access is marked as private. That means it is not intended for use by plugin and theme developers, but only in other core functions. It is listed here for completeness. Use any of these functions instead.

Contents

Description

Retrieve full list of sidebars and their widgets.

Will upgrade sidebar widget list, if needed. Will also save updated list, if needed.

Parameters

$deprecated
(boolean) (optional) Not used (deprecated).
Default: true

Return Values

(array) 
Upgraded list of widgets to version 3 array format when called from the admin.

Example:

array(4) {
  ["wp_inactive_widgets"]=>
  array(0) {
  }
  ["sidebar-1"]=>
  array(5) {
    [0]=>
    string(8) "search-2"
    [1]=>
    string(14) "recent-posts-2"
    [2]=>
    string(17) "recent-comments-2"
    [3]=>
    string(10) "archives-2"
    [4]=>
    string(12) "categories-2"
    [5]=>
    string(6) "meta-2"
  }
  ["sidebar-2"]=>
  array(0) {
  }
  ["sidebar-3"]=>
  array(0) {
  }
}

Notes

Change Log

Since: 2.2

Source File

wp_get_sidebars_widgets() is located in wp-includes/widgets.php

Related

Sidebars: is_active_sidebar(), is_dynamic_sidebar(), dynamic_sidebar(), register_sidebars(), register_sidebar(), unregister_sidebar(), wp_register_sidebar_widget(), wp_unregister_sidebar_widget(), wp_get_sidebars_widgets(), wp_set_sidebars_widgets()

See also index of Function Reference and index of Template Tags.