Make WordPress Core


Ignore:
Timestamp:
09/14/2023 02:13:42 AM (10 months ago)
Author:
joedolson
Message:

Administration: Use wp_admin_notice() for .updated.

Add usages of wp_admin_notice() and wp_get_admin_notice() on .updated in the root level of /wp-admin/. Ongoing task to implement new function across core.

Props costdev, joedolson.
See #57791.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/user-new.php

    r56008 r56573  
    397397if ( ! empty( $messages ) ) {
    398398    foreach ( $messages as $msg ) {
    399         echo '<div id="message" class="updated notice is-dismissible"><p>' . $msg . '</p></div>';
     399        wp_admin_notice(
     400            $msg,
     401            array(
     402                'id'                 => 'message',
     403                'additional_classes' => array( 'updated' ),
     404                'dismissible'        => true,
     405            )
     406        );
    400407    }
    401408}
Note: See TracChangeset for help on using the changeset viewer.