default_password_nag_edit_user()WP 2.8.0

No Hooks.

Return

null. Nothing (null).

Usage

default_password_nag_edit_user( $user_ID, $old_data );
$user_ID(int) (required)
-
$old_data(WP_User) (required)
-

Changelog

Since 2.8.0 Introduced.

default_password_nag_edit_user() code WP 6.5.4

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_meta( $user_ID, 'default_password_nag', false );
	}
}