Hide password protected posts in admin

You can use the has_password parameter of WP_Query. Here’s an example how you can hide it, for non administrators, on the edit.php screen for the post post type: /** * Hide password protected posts, for non-admins, in the case of ‘edit-post’ screen id * * @link http://wordpress.stackexchange.com/a/200426/26350 */ add_action( ‘pre_get_posts’, function( \WP_Query $q ) { … Read more

How to disable Woocommerce password recovery and use the default WordPress password reset page?

I found the solution in WP forum. Here it is: To remove the WooCommerce redirect for the “Lost Password” link, you’ll want to remove the “Lost Password” endpoint setting as found under **WooCommerce > Settings > Advanced > Account endpoints**. By simply leaving that blank, the user will be forced to use the default WordPress … Read more

Duplicate hash method for password in .NET

Here is the library: http://www.zer7.com/software/cryptsharp And this is “howtouse”: public override bool ValidateUser(string name, string password) { if (string.IsNullOrWhiteSpace(name)) return false; if (string.IsNullOrWhiteSpace(password)) return false; // this is just fetching the hash from the WP-database using BLToolkit. You can use any other way to get the hash from db 😉 UserData ud = null; using … Read more

Why do generated passwords start/end with spaces?

If wp_generate_password() was called with the third parameter $extra_special_chars = true a space might be part of the password: function wp_generate_password( $length = 12, $special_chars = true, $extra_special_chars = false ) { $chars=”abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789″; if ( $special_chars ) $chars .= ‘!@#$%^&*()’; if ( $extra_special_chars ) $chars .= ‘-_ []{}<>~`+=,.;:/?|’; $password = ”; for ( $i = … Read more

How can I detect if a user changes their password?

WordPress sends an email to the admin’s email when a user resets their password. To get a notification when a user changes their password you could hook into the profile_update action which is fired when a user’s profile is updated. When the action is fired WordPress has already validated and updated the user’s details we … Read more

How to add Wp_error using lostpassword_post hook when validating custom field?

As of WordPress 4.4, the action lostpassword_post passes the $errors object: function wpse_185243_lastpassword_post( $errors ) { if ( ! $captcha_valid /* The result of your captcha */ ) { $errors->add( ‘invalid_captcha’, ‘<strong>ERROR:</strong> Try again sonny.’ ); } } add_action( ‘lostpassword_post’, ‘wpse_185243_lastpassword_post’ ); Pre 4.4 legacy answer Here’s the relevant code you’re referring to (retrieve_password() in … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)