Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

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...

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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