Site icon Hip-Hop Website Design and Development

Customized Login web page, redirection and restrictions

I am having some points with my customized login web page with redirections and restrictions. Any consumer can browse a ‘neighborhood’ web page however they cannot entry the ‘distributors’ pages. I’ve set a rule so if anybody that it is not logged in might be forwarded to the house web page. Those that are logged might be redirected to the ‘distributor’ pages. Every little thing appears to be working fantastic besides on Firefox.
For the customized login web page I am utilizing a type from Elementor.

Here is customized code I’ve to limit non-logged customers to some pages.

/*
*   Limit non logged customers to sure pages
*/
add_action('template_redirect','my_non_logged_redirect', 10, 2);
perform my_non_logged_redirect()
{
    if ((is_page('distributors') || is_page('distributor-success-stories') || is_page('distributor-solutions') || is_page('distributor-software') || is_page('distributor-product-software') || is_page('product-smart-projectors') || is_page('distributor-product') || is_page('product-accessories') || is_page('distributor-press') || is_page('distributor-media') || is_page('distributor-firmware')) && !is_user_logged_in())
    {
        wp_redirect( '/login' );
        die();
    }
}

Here is the code I’ve to redirect registered customers after they efficiently log in

/**
 * Redirect non-admins to the homepage after logging into the location.
 */
perform custom_login_redirect( $redirect_to, $request, $consumer  ) {
    return ( is_array( $user->roles ) && in_array( 'administrator', $user->roles ) ) ? admin_url() : '/distributors';
}
add_filter( 'login_redirect', 'custom_login_redirect', 10, 3 );

Once more, that is working fantastic on Chrome, Safari and Edge nevertheless it’s not on Firefox. Can anybody assist me on this one?