Support » Fixing WordPress » Widgets problem

  • Resolved Sparkblog


    my website, using the “mystique” theme has had some issues for a long while now, something i am not familliar with at all, and i was wondering wether anyone could tell me what the following means?

    Fatal error: Nesting level too deep – recursive dependency? in /mnt/w1009/d42/s05/b02dc22a/www/ on line 924

    any ideas?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The problem is in widgets.php

    function is_active_widget($callback = false, $widget_id = false, $id_base = false, $skip_inactive = true) {
    	global $wp_registered_widgets;
    	$sidebars_widgets = wp_get_sidebars_widgets();
    	if ( is_array($sidebars_widgets) ) {
    		foreach ( $sidebars_widgets as $sidebar => $widgets ) {
    			if ( $skip_inactive && 'wp_inactive_widgets' == $sidebar )
    			if ( is_array($widgets) ) {
    				foreach ( $widgets as $widget ) {
    					if ( ( $callback && isset($wp_registered_widgets[$widget]['callback']) && $wp_registered_widgets[$widget]['callback'] == $callback ) || ( $id_base && _get_widget_id_base($widget) == $id_base ) ) {
    						if ( !$widget_id || $widget_id == $wp_registered_widgets[$widget]['id'] )
    							return $sidebar;
    	return false;

    Line 924-925 (widgets.php):

    if ( ( $callback && isset($wp_registered_widgets[$widget]['callback']) && $wp_registered_widgets[$widget]['callback'] == $callback ) || ( $id_base && _get_widget_id_base($widget) == $id_base ) ) {
        if ( !$widget_id || $widget_id == $wp_registered_widgets[$widget]['id'] )

    From what this guy said about the “Nesting level too deep – recursive dependency” error I switched the comparison operators in the if statements (lines 924 and 925) from non-strict (==) to strict (===) and it reduces the amount of objects being checked to those of the same type, so all of the widgets now show up in widgets.php and no more error.

    Line 924-925 (widgets.php):
    Replace the three non-strict comparison operators (==) with strict (===).
    Third replacement, line 925, may not be necessary

    if ( ( $callback && isset($wp_registered_widgets[$widget]['callback']) && $wp_registered_widgets[$widget]['callback'] === $callback ) || ( $id_base && _get_widget_id_base($widget) === $id_base ) ) {
        if ( !$widget_id || $widget_id === $wp_registered_widgets[$widget]['id'] )

    Thanks bung, all fixed and ready to go 😀

    My widgets are stuck and I downloaded widgets reset they are still I change themes, deactived all plugins and actived another theme and I get this message. Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/bah/bahbah/bahbah/wp-includes/widgets.php on line 852

    This is whats on that line 852:
    if ( empty($wp_registered_sidebars[$index]) || !array_key_exists($index, $sidebars_widgets) || !is_array($sidebars_widgets[$index]) || empty($sidebars_widgets[$index]) )
    return false;

    I have a customer using the Flexx Professional 2.7.8 theme on WordPress 2.9.2 who is experiencing the same problem as the original poster but replacing == with === in lines 925 and 926 has failed to have any effect.

    Can anyone suggest any other method of getting this working again? She’d rather not upgrade the WordPress installation to 3.0.1 as this will break other Plugins that she relies on which have not yet been upgraded.

    I’m stumped and, as a result of changing themes to test the problem, the website is currently broken. I’d like to get it working for her again as soon as possible.

    our website is The widgets have moved down and not in position. I have tried many forums and have not received any answers. Please could someone tell me what I should do as I am a novice and not experienced in any php???
    Many thanks

    Anusethu, maybe you have the widget in to the “footer”, reset it to “default sidebar”.

    Thanks Duca,
    I have managed to sort it. I validated the code and fixed the errors and it has sorted the issue.
    Many thanks for your help.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Widgets problem’ is closed to new replies.