Make WordPress Core

Changeset 64239


Ignore:
Timestamp:
10/08/2026 09:31:43 AM (31 hours ago)
Author:
afercia
Message:

Users: Prevent duplicate email change admin notices on multisite.

Follow-up to [64228].

  • Remove duplicate admin notices hooked from ms-admin-filters.php.
  • Update @since tag for the new_user_email_admin_notice() docblock.
  • Add unit tests for new_user_email_admin_notice().

Developed in ​https://github.com/WordPress/wordpress-develop/pull/14086

Props ravipatel.
Fixes #66173.

Location:
trunk
Files:
1 added
2 edited

Legend:

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

    r54240 r64239  
    1212
    1313// User hooks.
    14 add_action( 'user_admin_notices', 'new_user_email_admin_notice' );
    15 add_action( 'network_admin_notices', 'new_user_email_admin_notice' );
    16 
    1714add_action( 'admin_page_access_denied', '_access_denied_splash', 99 );
    1815
  • trunk/src/wp-includes/user.php

    r64228 r64239  
    40124012 * @since 3.0.0
    40134013 * @since 4.9.0 This function was moved from wp-admin/includes/ms.php so it's no longer Multisite specific.
     4014 * @since 7.2.0 The notice is displayed whenever an email change is pending, not only after updating
     4015 *              the profile, and includes a link to cancel the request. The function is no longer
     4016 *              hooked to the `admin_notices`, `user_admin_notices`, and `network_admin_notices`
     4017 *              actions, and is instead called directly from wp-admin/user-edit.php.
    40144018 *
    40154019 * @global string $pagenow The filename of the current screen.
    … …  
    40304034                                ' <a href="%1$s">%2$s</a>',
    40314035                                esc_url( wp_nonce_url( self_admin_url( 'profile.php?dismiss=' . $current_user_id . '_new_email' ), 'dismiss-' . $current_user_id . '_new_email' ) ),
    4032                                 _x( 'Cancel request', 'user email change' ),
     4036                                _x( 'Cancel request', 'user email change' )
    40334037                        );
    40344038                        wp_admin_notice( $message, array( 'type' => 'info' ) );
Note: See TracChangeset for help on using the changeset viewer.