WordPress giving error when I log in after trying emergency.php
WordPress giving error when I log in after trying emergency.php
WordPress giving error when I log in after trying emergency.php
There is wp_loginout() which will get you a simple login/logout form, and that content is filterable with the loginout hook, but the “login-form page” (by which I think you mean wp-login.php) is mostly hard-coded. There are a lot of hook in there that might be enough to do what you want though– twenty-three hooks by … Read more
You could use the user_register-hook, to replace the username with the mail-address right after the account has been created. It could be something like this (untested) in your functions.php: add_action( ‘user_register’, ‘wpse216787_mail_as_username’, 10, 1 ); function wpse216787_mail_as_username( $user_id ) { $email = get_the_author_meta( ‘user_email’, $user_id ); update_user_meta($user_id, ‘user_login’, $email ); }
I found that I was setting the default mime type for wp_mail_content_type to be text/html which according to the notes on the codex can cause this particular issue. I’ve removed the code from my functions file, and the registration email looks better, but (and I haven’t seen WordPress’s emails in a long time) still doesn’t … Read more
The warning you are receiving is because you can’t redirect the browser to another page once you have already sent content for the current page to it. The rest of the error tells you the exact file that is sending the content you don’t yet want. You need to either: ensure you run your redirect … Read more
I decided to still provide an answer based on the premise of the title backend access per user status Note this is an explanation to the concept of granting or restricting access based on user statuses (roles or capabilities). So this could or could not be applied directly to your situation since you make use … Read more
Ues this function to redirect admin to dashboard function admin_login_redirect( $redirect_to, $request, $user ) { global $user; if( isset( $user->roles ) && is_array( $user->roles ) ) { if( in_array( “administrator”, $user->roles ) ) { return $redirect_to; } } } add_filter(“login_redirect”, “admin_login_redirect”, 10, 3); For more/brief detail read this article. Page ID don’t come in quotes, … Read more
Dont pass plain text as password, use this function: wp_set_password( $password, $user_id ); Keep in mind that it should only be run on user creation (so just once), otherwise the password might keep changing.
Here is a snipped. Make sure to run this code after the users are logged in //To get logged in user information $user = wp_get_current_user(); //Condition to check weather user is subscriber or not if ( in_array( ‘subscriber’, (array) $user->roles ) ) { //The user has the “subscriber” role }else{ // redirect user to different … Read more
You can use the filter “login_redirect”, in the function to create you’ll need to verify the role of the user, check for the order and get product id in the order. Then you’ll be able to get the permalink for this product and redirect the user. A little example, as you told that they can … Read more