default_password_nag_handler() WordPress Function

The default_password_nag_handler() function is used to display a notice to users who have not changed their WordPress password in over 14 days. By default, this notice is displayed on the user's home screen and in the admin bar.

default_password_nag_handler( false $errors = false ) #


Parameters

$errors

(false)(Optional)Deprecated.

Default value: false


Top ↑

Source

File: wp-admin/includes/user.php

function default_password_nag_handler( $errors = false ) {
	global $user_ID;
	// Short-circuit it.
	if ( ! get_user_option( 'default_password_nag' ) ) {
		return;
	}

	// get_user_setting() = JS-saved UI setting. Else no-js-fallback code.
	if ( 'hide' === get_user_setting( 'default_password_nag' )
		|| isset( $_GET['default_password_nag'] ) && '0' == $_GET['default_password_nag']
	) {
		delete_user_setting( 'default_password_nag' );
		update_user_meta( $user_ID, 'default_password_nag', false );
	}
}


Top ↑

Changelog

Changelog
VersionDescription
2.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.