• Resolved Tony DeStefano

    (@spokanetony)


    After updating to v3.2.2 I got the following error:

    Call to undefined function is_user_logged_in()

    I resolved it temporarily by changing line 287 of sidebar.php to this:

    //$user_visibility = is_user_logged_in() ? array(-1) : array();
    $user_visibility = array();

    Apparently that WP function is not available until after the init hook.

    Thanks!
    Tony

    https://wordpress.org/plugins/content-aware-sidebars/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Joachim Jensen

    (@intoxstudio)

    Thanks for reporting this, very strange I did not get any errors about this during testing, but I do see this post in the Docs:

    This function is more accurate if used at, or after, the ‘template_redirect’ Action. Before that, under unusual circumstances, it will give unexpected results.

    Your fix will render the Visibility option useless, which of course is fine if you don’t use it. Would you test if this fix works too (just move $user_visibility below the if-statement:

    if ($posts) {
        $user_visibility = is_user_logged_in() ? array(-1) : array();
        $user_visibility = apply_filters("cas/user_visibility",$user_visibility);

    Thread Starter Tony DeStefano

    (@spokanetony)

    That worked. Thanks!

    Plugin Author Joachim Jensen

    (@intoxstudio)

    Thanks for the feedback, I will include this fix in the next version.

    If you run in to any other problems, do not hesitate to open a new support thread here. And if you like Content Aware Sidebars, please use 2 minutes to leave a review here: https://wordpress.org/support/view/plugin-reviews/content-aware-sidebars

    Thread Starter Tony DeStefano

    (@spokanetony)

    Done! I know how hard it is to get comments on plugins, lol. 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Error on New Update’ is closed to new replies.