1

I have a problem of widgets not showing up, trying to investigate why $wp_registered_widgets is empty.

Can somebody tell me where it gets filled from the database? How can I find out why the default widgets are not set.

4

As you can see here, $wp_registered_widgets is defined in wp-includes/widgets.php (as expected). You should be able to debug it by doing something like this:

function yoast_print_active_widgets() {
    global $wp_registered_widgets;    
    echo '<pre>'.print_r( $wp_registered_widgets, 1 ).'</pre>';
}
add_action('init','yoast_print_active_widgets');

Then you could loop through the different stages, from init, to send_headers to wp_head and see where stuff goes wrong...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.