default_password_nag_edit_user
The WordPress Core default password nag edit user function.
Description
Parameters (2)
- 0. $user_id (int)
- The user id.
- 1. $old_data (object)
- The old data.
Usage
if ( !function_exists( 'default_password_nag_edit_user' ) ) { require_once ABSPATH . '/wp-admin/includes/user.php'; } // The user id. $user_id = -1; // The old data. $old_data = null; // NOTICE! Understand what this does before running. $result = default_password_nag_edit_user($user_id, $old_data);
Defined (1)
The function is defined in the following location(s).
- /wp-admin/includes/user.php
- function default_password_nag_edit_user($user_ID, $old_data) {
- // Short-circuit it.
- if ( ! get_user_option('default_password_nag', $user_ID) )
- return;
- $new_data = get_userdata($user_ID);
- // Remove the nag if the password has been changed.
- if ( $new_data->user_pass != $old_data->user_pass ) {
- delete_user_setting('default_password_nag');
- update_user_option($user_ID, 'default_password_nag', false, true);
- }
- }