Make WordPress Core


Ignore:
Timestamp:
09/14/2023 12:52:45 AM (16 months 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/comment.php

    r55988 r56570  
    162162            }
    163163            if ( $message ) {
    164                 echo '<div id="message" class="notice notice-info"><p>' . $message . '</p></div>';
     164                wp_admin_notice(
     165                    $message,
     166                    array(
     167                        'type' => 'info',
     168                        'id'   => 'message',
     169                    )
     170                );
    165171            }
    166172        }
     173        wp_admin_notice(
     174            '<strong>' . __( 'Caution:' ) . '</strong> ' . $caution_msg,
     175            array(
     176                'type' => 'warning',
     177                'id'   => 'message',
     178            )
     179        );
    167180        ?>
    168 <div id="message" class="notice notice-warning"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php echo $caution_msg; ?></p></div>
    169181
    170182<table class="form-table comment-ays">
Note: See TracChangeset for help on using the changeset viewer.