• Hi,

    i am getting this PHP warning when not logged in:

    Warning: Undefined variable $status in /wp/wp-content/plugins/wp-members/includes/api/api.php on line 411

Viewing 1 replies (of 1 total)
  • Plugin Author Chad Butler

    (@cbutlerjr)

    That comes from the API function wpmem_login_status(), which I presume you’re using somewhere in custom code or something.

    Interestingly, it is not used within the plugin itself – it’s just a useable function for customization. It has been in the plugin since version 2.0 and as an API function since 3.1, which means it has been there for well over a decade and no one has mentioned this issue up until now, which means it is likely not used by all that many people.

    The problem is that $status is defined only when the user is logged in, but it is used in the return value even if the user is not logged in, so it is undefined when not logged in.

    I will correct this in the next version of the plugin – either by adding a logged out state, or by creating a null value for the logged out state. In the meantime, you can edit the function in api.php. In the function wpmem_login_status(), right after the following line:

    global $user_login;

    add the following:

    $status = '';
Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.