WordPress.org

Ready to get started?Download WordPress

Forums

Widget Logic
Fatal error: Call to undefined function is_user_logged_in() (8 posts)

  1. radi_v
    Member
    Posted 2 years ago #

    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

    http://wordpress.org/extend/plugins/widget-logic/

  2. radi_v
    Member
    Posted 2 years ago #

    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()

  3. alanft
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  4. topherb
    Member
    Posted 2 years ago #

    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.

  5. alanft
    Member
    Plugin Author

    Posted 2 years ago #

    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?

  6. jroles
    Member
    Posted 2 years ago #

    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: http://jroles-associates.com/m4a/

    I would appreciate any help.

  7. alanft
    Member
    Plugin Author

    Posted 2 years ago #

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

  8. jroles
    Member
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags