How/where is the global variable $wp_registered_widgets filled?
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 … Read more