Users: Display the new user email notice in user admin too.

Also, in `new_user_email_admin_notice()` use the global `$pagenow` and add a translators comment for the placeholder.

Fixes #35767.

git-svn-id: https://develop.svn.wordpress.org/trunk@36504 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90)
2016-02-07 13:53:23 +00:00
parent 96b6828558
commit 92a9a57b63
2 changed files with 8 additions and 2 deletions

View File

@@ -12,6 +12,7 @@ add_filter( 'wp_handle_upload_prefilter', 'check_upload_size' );
// User Hooks
add_action( 'admin_notices', 'new_user_email_admin_notice' );
add_action( 'user_admin_notices', 'new_user_email_admin_notice' );
add_action( 'admin_page_access_denied', '_access_denied_splash', 99 );

View File

@@ -403,10 +403,15 @@ All at ###SITENAME###
* after email address change.
*
* @since 3.0.0
*
* @global string $pagenow
*/
function new_user_email_admin_notice() {
if ( strpos( $_SERVER['PHP_SELF'], 'profile.php' ) && isset( $_GET['updated'] ) && $email = get_option( get_current_user_id() . '_new_email' ) )
echo "<div class='update-nag'>" . sprintf( __( "Your email address has not been updated yet. Please check your inbox at %s for a confirmation email." ), $email['newemail'] ) . "</div>";
global $pagenow;
if ( 'profile.php' === $pagenow && isset( $_GET['updated'] ) && $email = get_option( get_current_user_id() . '_new_email' ) ) {
/* translators: %s: New email address */
echo '<div class="update-nag">' . sprintf( __( 'Your email address has not been updated yet. Please check your inbox at %s for a confirmation email.' ), esc_html( $email['newemail'] ) ) . '</div>';
}
}
/**