Make WordPress Core

Changeset 36504


Ignore:
Timestamp:
02/07/2016 01:53:23 PM (9 years ago)
Author:
ocean90
Message:

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.

Location:
trunk/src/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ms-admin-filters.php

    r35403 r36504  
    1313// User Hooks
    1414add_action( 'admin_notices', 'new_user_email_admin_notice' );
     15add_action( 'user_admin_notices', 'new_user_email_admin_notice' );
    1516
    1617add_action( 'admin_page_access_denied', '_access_denied_splash', 99 );
  • trunk/src/wp-admin/includes/ms.php

    r36503 r36504  
    404404 *
    405405 * @since 3.0.0
     406 *
     407 * @global string $pagenow
    406408 */
    407409function new_user_email_admin_notice() {
    408     if ( strpos( $_SERVER['PHP_SELF'], 'profile.php' ) && isset( $_GET['updated'] ) && $email = get_option( get_current_user_id() . '_new_email' ) )
    409         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>";
     410    global $pagenow;
     411    if ( 'profile.php' === $pagenow && isset( $_GET['updated'] ) && $email = get_option( get_current_user_id() . '_new_email' ) ) {
     412        /* translators: %s: New email address */
     413        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>';
     414    }
    410415}
    411416
Note: See TracChangeset for help on using the changeset viewer.