default_password_nag

函数
default_password_nag ( No parameters )

default_password_nag: 如果用户使用的是默认密码,该函数在用户资料页面的顶部添加一条提示信息。该提示信息鼓励用户将他们的密码改为更安全的密码。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function default_password_nag() {
global $pagenow;
// Short-circuit it.
if ( 'profile.php' === $pagenow || ! get_user_option( 'default_password_nag' ) ) {
return;
}
echo '<div class="error default-password-nag">';
echo '<p>';
echo '<strong>' . __( 'Notice:' ) . '</strong> ';
_e( 'You&rsquo;re using the auto-generated password for your account. Would you like to change it?' );
echo '</p><p>';
printf( '<a href="%s">' . __( 'Yes, take me to my profile page' ) . '</a> | ', get_edit_profile_url() . '#password' );
printf( '<a href="%s" id="default-password-nag-no">' . __( 'No thanks, do not remind me again' ) . '</a>', '?default_password_nag=0' );
echo '</p></div>';
}
function default_password_nag() { global $pagenow; // Short-circuit it. if ( 'profile.php' === $pagenow || ! get_user_option( 'default_password_nag' ) ) { return; } echo '<div class="error default-password-nag">'; echo '<p>'; echo '<strong>' . __( 'Notice:' ) . '</strong> '; _e( 'You&rsquo;re using the auto-generated password for your account. Would you like to change it?' ); echo '</p><p>'; printf( '<a href="%s">' . __( 'Yes, take me to my profile page' ) . '</a> | ', get_edit_profile_url() . '#password' ); printf( '<a href="%s" id="default-password-nag-no">' . __( 'No thanks, do not remind me again' ) . '</a>', '?default_password_nag=0' ); echo '</p></div>'; }
function default_password_nag() {
	global $pagenow;

	// Short-circuit it.
	if ( 'profile.php' === $pagenow || ! get_user_option( 'default_password_nag' ) ) {
		return;
	}

	echo '<div class="error default-password-nag">';
	echo '<p>';
	echo '<strong>' . __( 'Notice:' ) . '</strong> ';
	_e( 'You&rsquo;re using the auto-generated password for your account. Would you like to change it?' );
	echo '</p><p>';
	printf( '<a href="%s">' . __( 'Yes, take me to my profile page' ) . '</a> | ', get_edit_profile_url() . '#password' );
	printf( '<a href="%s" id="default-password-nag-no">' . __( 'No thanks, do not remind me again' ) . '</a>', '?default_password_nag=0' );
	echo '</p></div>';
}

常见问题

FAQs
查看更多 >