The members members please log in function.
Published Date - July 31, 2023
Redirects users that are not logged in to the 'wp-login.php' page.
members_please_log_in();
The following example is for adding a hook callback.
if ( !function_exists( 'members_please_log_in' ) ) {
require_once ABSPATH . PLUGINDIR . 'membersmembers/inc/functions-private-site.php';
}
// NOTICE! Understand what this does before running.
$result = members_please_log_in();
The function is defined in the following location(s).
members/inc/functions-private-site.php
function members_please_log_in() {
// If private blog is not enabled, bail.
if ( ! members_is_private_blog() )
return;
// If this is a multisite instance and the user is logged into the network.
if ( is_multisite() && is_user_logged_in() && ! is_user_member_of_blog() && ! is_super_admin() ) {
members_ms_private_blog_die();
}
// Check if the private blog feature is active and if the user is not logged in.
if ( ! is_user_logged_in() && members_is_private_page() ) {
auth_redirect();
exit;
}
}