default_password_nag

The timeline below displays how wordpress function default_password_nag has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.4

/**
 * @since 2.8.0
 *
 * @global string $pagenow The filename of the current screen.
 */
function default_password_nag()
{
    global $pagenow;
    // Short-circuit it.
    if ('profile.php' === $pagenow || !get_user_option('default_password_nag')) {
        return;
    }
    $default_password_nag_message = sprintf('<p><strong>%1$s</strong> %2$s</p>', __('Notice:'), __('You are using the auto-generated password for your account. Would you like to change it?'));
    $default_password_nag_message .= sprintf('<p><a href="%1$s">%2$s</a> | ', esc_url(get_edit_profile_url() . '#password'), __('Yes, take me to my profile page'));
    $default_password_nag_message .= sprintf('<a href="%1$s" id="default-password-nag-no">%2$s</a></p>', '?default_password_nag=0', __('No thanks, do not remind me again'));
    wp_admin_notice($default_password_nag_message, array('additional_classes' => array('error', 'default-password-nag'), 'paragraph_wrap' => false));
}

WordPress Version: 6.3

/**
 * @since 2.8.0
 *
 * @global string $pagenow The filename of the current screen.
 */
function default_password_nag()
{
    global $pagenow;
    // Short-circuit it.
    if ('profile.php' === $pagenow || !get_user_option('default_password_nag')) {
        return;
    }
    ?>
	<div class="error default-password-nag">
		<p>
			<strong><?php 
    _e('Notice:');
    ?></strong>
			<?php 
    _e('You are using the auto-generated password for your account. Would you like to change it?');
    ?>
		</p>
		<p>
		<?php 
    printf('<a href="%1$s">%2$s</a> | ', esc_url(get_edit_profile_url() . '#password'), __('Yes, take me to my profile page'));
    printf('<a href="%1$s" id="default-password-nag-no">%2$s</a>', '?default_password_nag=0', __('No thanks, do not remind me again'));
    ?>
		</p>
	</div>
	<?php 
}

WordPress Version: 6.1

/**
 * @since 2.8.0
 *
 * @global string $pagenow The filename of the current screen.
 */
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>';
}

WordPress Version: 5.5

/**
 * @since 2.8.0
 *
 * @global string $pagenow
 */
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>';
}

WordPress Version: 4.3

/**
 * @since 2.8.0
 *
 * @global string $pagenow
 */
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>';
}

WordPress Version: 4.0

/**
 * @since 2.8.0
 */
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 to something easier to remember?');
    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>';
}

WordPress Version: 3.9

/**
 * @since 2.8.0
 */
function default_password_nag()
{
    global $pagenow;
    if ('profile.php' == $pagenow || !get_user_option('default_password_nag')) {
        //Short circuit it.
        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 to something easier to remember?');
    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>';
}

WordPress Version: 3.7

/**
 * @since 2.8.0
 */
function default_password_nag()
{
    global $pagenow;
    if ('profile.php' == $pagenow || !get_user_option('default_password_nag')) {
        //Short circuit it.
        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 to something easier to remember?');
    echo '</p><p>';
    printf('<a href="%s">' . __('Yes, take me to my profile page') . '</a> | ', get_edit_profile_url(get_current_user_id()) . '#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>';
}