Make WordPress Core


Ignore:
Timestamp:
09/14/2023 12:52:45 AM (3 years ago)
Author:
joedolson
Message:

Administration: Use wp_admin_notice() in /wp-admin/.

Add usages of wp_admin_notice() and wp_get_admin_notice() on .notice-[type] 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/site-health.php

    r55917 r56570  
    106106        if ( isset( $_GET['https_updated'] ) ) {
    107107                if ( $_GET['https_updated'] ) {
    108                         ?>
    109                         <div id="message" class="notice notice-success is-dismissible"><p><?php _e( 'Site URLs switched to HTTPS.' ); ?></p></div>
    110                         <?php
     108                        wp_admin_notice(
     109                                __( 'Site URLs switched to HTTPS.' ),
     110                                array(
     111                                        'type'        => 'success',
     112                                        'id'          => 'message',
     113                                        'dismissible' => true,
     114                                )
     115                        );
    111116                } else {
    112                         ?>
    113                         <div id="message" class="notice notice-error is-dismissible"><p><?php _e( 'Site URLs could not be switched to HTTPS.' ); ?></p></div>
    114                         <?php
     117                        wp_admin_notice(
     118                                __( 'Site URLs could not be switched to HTTPS.' ),
     119                                array(
     120                                        'type'        => 'error',
     121                                        'id'          => 'message',
     122                                        'dismissible' => true,
     123                                )
     124                        );
    115125                }
    116126        }
     
    213223        return;
    214224} else {
     225        wp_admin_notice(
     226                __( 'The Site Health check requires JavaScript.' ),
     227                array(
     228                        'type'               => 'error',
     229                        'additional_classes' => array( 'hide-if-js' ),
     230                )
     231        );
    215232        ?>
    216 
    217 <div class="notice notice-error hide-if-js">
    218         <p><?php _e( 'The Site Health check requires JavaScript.' ); ?></p>
    219 </div>
    220233
    221234<div class="health-check-body health-check-status-tab hide-if-no-js">
Note: See TracChangeset for help on using the changeset viewer.