How do I combine wp_redirect and add_filter?
How do I combine wp_redirect and add_filter?
How do I combine wp_redirect and add_filter?
Adding A Login Fail Notice
Just for everybody to know I finally got through this. WordPress was installed in a subfolder and the rewrite rule was partialy wrong, so that the session wasn’t properly recognized from the homepage. I rewrote the rule as it was suppsed to be and now everything works.
You should be able to create a role for your wholesalers and then toggle price based on membership in that role, or limit access to certain “Pages” to members of that role. That is going to be much easier than multiple linked sites. Your question is lacking detail and code (which might be closed source … Read more
I can be wrong, but I almost sure is not an issue: the cookie is based on user login, changing it the cookie is not valid anymore. If I’m right, is not possible kick out this behaviour, but if you want you can auto re-login the user after the update using wp_signon function.
Multiple Users Logged In Causing Incorrect Account Returned
You could proceed like that : add_filter(“login_redirect”, “wpse_113875_login_redirect”, 10, 3); function wpse_113875_login_redirect($redirect_to, $request, $user) { if(is_array($user->roles)) if(in_array(‘administrator’, $user->roles)) return site_url(‘/wp-admin/’); return home_url(); } This will use the WP login system and redirect users according to their role after login. I think this is easier than building your own script in this case. You could easily … Read more
Change Login CSS – Include instead of echo
In the header.php of your theme you can add the following code @ the beginning of the php code if ( is_user_logged_in() ) { header( ‘Location: /’ ); } else { header( ‘Location: /wp-login.php’ ); } If the user is not logged it will be redirected to the login form else it will be redirected … Read more
I worked out a way to conditionally print a script to the head of the page, but not to actually enqueue it. The code depends on the presence of the wp_shake_js callback that is conditionally added to the login page on login failure. If that hook is present, the assumption is that the login failed. … Read more