• Resolved trinasc

    (@trinasc)


    Hi everyone! I am having an issue with Widget Logic and The Stars theme. I get the following error:

    Warning: Illegal offset type in (dev server)/wp-content/plugins/widget-logic/widget_logic.php on line 125

    Warning: Illegal offset type in (dev server)/wp-content/plugins/widget-logic/widget_logic.php on line 128

    Warning: Illegal offset type in (dev server)/wp-content/plugins/widget-logic/widget_logic.php on line 125

    Warning: Illegal offset type in (dev server)/wp-content/plugins/widget-logic/widget_logic.php on line 128

    The site link is:https://dev.gamingangels.com/
    Not sure if you can see the error without being logged in.

    This is the section of code in widget_logic that it seems to be breaking on:
    function widget_logic_redirect_callback()
    { global $wp_registered_widgets;
    foreach ( $wp_registered_widgets as $id => $widget )
    { array_push($wp_registered_widgets[$id][‘params’],$id);
    $wp_registered_widgets[$id][‘callback_wl_redirect’]=$wp_registered_widgets[$id][‘callback’];
    $wp_registered_widgets[$id][‘callback’]=’widget_logic_redirected_callback’;
    }
    }

    Any ideas of things to try/check? I’ve read all the widget logic posts and can’t find anything.

    Thank you for your help,
    Trina

Viewing 5 replies - 1 through 5 (of 5 total)
  • widget logic isn’t working well with one of the widgets you are using.

    does the theme provide its own widgets? if so, it might be that the code for them is out of date. give me a link to the theme and i’ll see what i can find out.

    (if you don’t know for sure, you can check it’s not a widget provided by the theme, by switching to the default theme to see if the error persists)

    Thread Starter trinasc

    (@trinasc)

    Here is the link for the Stars theme:
    https://www.premiumwp.com/the-stars-a-free-premium-wordpress-theme/

    Thank you for helping!!
    Trina ^_^

    It is an error with that particular theme because it does work on default. I’m not certain as to what the error is yet though with this particular theme.

    the errors are due to that theme’s header.php calling wp_head twice (once on line 14 and again on line 42)

    you can fix it by either deleting one of those calls, or WL could check for that happening by changing the widget_logic_redirect_callback function to:

    function widget_logic_redirect_callback()
    {	global $wp_registered_widgets;
    	foreach ( $wp_registered_widgets as $id => $widget )
    	{	if (!$wp_registered_widgets[$id]['callback_wl_redirect'])
    		{	array_push($wp_registered_widgets[$id]['params'],$id);
    			$wp_registered_widgets[$id]['callback_wl_redirect']=$wp_registered_widgets[$id]['callback'];
    			$wp_registered_widgets[$id]['callback']='widget_logic_redirected_callback';
    		}
    	}
    }
    Thread Starter trinasc

    (@trinasc)

    Alanft,

    You are amazing and awesome! Thank you so much for helping me out. I changed the widget_logic_redirect_callback function and it worked just great!

    Thank you again!
    Trina

    cheers – i’ll put that into the next release. ‘defensive programming’

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Widget Logic errors in The Stars Theme’ is closed to new replies.