Support » Plugins and Hacks » Meta Box » $wp_registered_sidebars is showing an empty array

$wp_registered_sidebars is showing an empty array

Viewing 2 replies - 1 through 2 (of 2 total)
  • I’m discovering this issue as well. I have worked around the issue previously by calling get_option( ‘sidebars_widgets’ ), but this will only allow me to display the id’s to the user. That isn’t cool especially when the id’s can be unintuitive at times. Now I’ve got some time to look into the matter and believe that I have been calling it before the widgets.php file is called (and all of it’s associated hoods and functions, eg. -register_sidebar-). So, global variable must be called within a function that fires after the widget hooks. I believe this has to be done within the callback function for add_metabox (in my case because I’m attempting to get this global var in the edit.php file so I can display a list of sidebars for the user to select per page). Can’t verify at this second if it will work because client’s dev server just crashed, but if I find the answer I will post back to this thread. I know it’s been 6 months, sucks when you don’t get responses to your inquiries. Hope this comes as new info to you and info you can still use.

    Server back up. Called gobal $wp_registered_sidebars from inside of the callback for add_metabox. Works like a charm.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘$wp_registered_sidebars is showing an empty array’ is closed to new replies.
Skip to toolbar