WooCommerce Lost Password reset goes to 404
WooCommerce Lost Password reset goes to 404
WooCommerce Lost Password reset goes to 404
When you redirect via wp_safe_redirect, this is done by sending a header to the browser containing the URL to redirect to. If any content has been sent to the browser before trying to send this header, you get the headers already sent error. Once content goes to the browser, happy header time is over, no … Read more
Download the theme– actually download to your computer rather than use the built in updater/installer–, unzip it, find the footer file, and upload that to your site over FTP. After that, my advice would be to setup a development environment on your computer and don’t edit the live site directly.
WordPress doesn’t use PHP sessions. If you tried stating a session in your custom-written code, it’s not going to work as you’d hope. There’s a plugin which will enable all normal session use: https://wordpress.org/plugins/wp-native-php-sessions/ But, depending on what exactly you’re trying to achieve, you may prefer to keep things clean/do it the WordPress way and … Read more
According to the WordPress Code Reference you have to pass the user object to get_password_reset_key() instead of the mail address. Maybe a solution for your problem will be: $user = get_user_by( ’email’, ‘[email protected]’ ); $reset_key = get_password_reset_key( $user );
Yep, there’s a hook to change the lost password URL. I found it by going to this nice page to search all the hooks and filters and selecting ‘Hooks’ and trying ‘lost password’ https://developer.wordpress.org/reference/ An example from here: https://codex.wordpress.org/Plugin_API/Filter_Reference/lostpassword_url add_filter( ‘lostpassword_url’, ‘my_lost_password_page’, 10, 2 ); function my_lost_password_page( $lostpassword_url, $redirect ) { return home_url( “/yournew/lostpasswordpage.php” ); … Read more
That uses the site admin email address. Changing that will change the email address that is sent.
You aren’t requesting all of the parameters that your callback needs.This: add_filter ( ‘retrieve_password_message’, ‘retrieve_password_message_filter’); Should be: add_filter ( ‘retrieve_password_message’, ‘retrieve_password_message_filter’, 10 ,4); Though you only need the first three, it looks loke.
I’ve added jQuery( document ).ready(function() { and it works! Final working code below: add_action( ‘resetpass_form’, ‘resettext’); function resettext(){ ?> <script type=”text/javascript”> jQuery( document ).ready(function() { jQuery(‘#resetpassform input#wp-submit’).val(“Set Password”); }); </script> <?php }
You can use retrieve_password_message hook for that. That filter is applied as this: apply_filters( ‘retrieve_password_message’, string $message, string $key, string $user_login, WP_User $user_data ) So you’ll have access to $user_login of the user. It means, that you can write a filter function that will create random password for that user and then send it. function … Read more