Support » Plugin: Widget Logic » [Plugin: Widget Logic] Fatal error: Call to undefined function is_user_logged_in()

Viewing 7 replies - 1 through 7 (of 7 total)
  • Additional Information:
    I am using Widget Logic plugin and WooCommerce on my site and when I set a widget with this logic is_user_logged_in() the website will throw an error:
    Fatal error: Call to undefined function is_user_logged_in() in /home/zxcvbnm/wp-content/plugins/widget-logic/widget_logic.php(270) : eval()'d code on line 1

    any other logic works but is_user_logged_in() or !is_user_logged_in()

    Plugin Contributor alanft


    i think as this function is in pluggable.php, that the function doesn’t exist when the plugin is activated. This *should* mean that you just have to delay the loading of your logic.

    You can do this on the widget admin page, at the foot of the page is the ‘Load logic’ option. By default it first runs ‘when plugin starts’. Try changing that to ‘after theme loads’, and if that doesn’t work ‘when all PHP loaded’.

    Let me know if that fixes it – as I’ll add that to the read me / FAQ / and notes if so.

    I’m having the same issue. I’m using WP 3.4.1 and BuddyPress 1.5.6. If I add !is_user_logged_in() I get the same error as the user above with default widget logic settings and if I tell it to load after theme.

    If I set widget logic to load after all PHP is loaded, I don’t see any content on my site, but get no error.

    Plugin Contributor alanft


    You set “Load Logic” option to the “when all PHP loaded” option and your site becomes entirely blank? (i.e. you don’t just mean all your widgets or something)

    Other than !is_user_logged_in() what other WL code are you using on widgets?

    Also, if you don’t use any WL based on the is_user_logged_in() function, is everything otherwise OK – regardless of the “Load Logic” option?

    I have been using Widget Logic with good results. it was doing everything i needed. i am not sure what I did but all of sudden I get the error on repeated over and over on every page:

    Parse error: syntax error, unexpected ‘)’ in /home/content/j/r/o/jroles2/html/m4a/wp-content/plugins/widget-logic/widget_logic.php(270) : eval()’d code on line 2

    i have removed all Widget logic code on all my widgets; uninstalled and reinstalled. And i have changed the Widget Logic preferences to load after php. i cannot get rid of the error messages.

    This is the url:

    I would appreciate any help.

    Plugin Contributor alanft


    “Parse error… eval()’d code” is symptomatic of a PHP syntax error somewhere in your WL (unbalanced brackets in this case).

    The best way to troubleshoot that is to blank your WL one at a time to see when the error goes away. You can save all your WL code out first, then when you find the (final) widget that was causing the problem, restore it all, and check the syntax of that widget’s code.

    Thanks so much. I exported the code and could see something a little odd (nav_menu-3 “\r\n”) in one of the widgets even if it didn’t seem to have an an entry in the WL box. I deleted that widget and the error went away.

    I appreciate the quick response.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Widget Logic] Fatal error: Call to undefined function is_user_logged_in()’ is closed to new replies.