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.

git-svn-id: https://develop.svn.wordpress.org/trunk@56570 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Joe Dolson
2023-09-14 00:52:45 +00:00
parent 96a7954ee6
commit 3cefc7c7ff
20 changed files with 434 additions and 225 deletions

View File

@@ -440,12 +440,29 @@ if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create
<hr class="wp-header-end">
<?php if ( $notice ) : ?>
<div id="notice" class="notice notice-warning"><p id="has-newer-autosave"><?php echo $notice; ?></p></div>
<?php endif; ?>
<?php if ( $message ) : ?>
<div id="message" class="updated notice notice-success is-dismissible"><p><?php echo $message; ?></p></div>
<?php endif; ?>
<?php
if ( $notice ) :
wp_admin_notice(
'<p id="has-newer-autosave">' . $notice . '</p>',
array(
'type' => 'warning',
'id' => 'notice',
'paragraph_wrap' => false,
)
);
endif;
if ( $message ) :
wp_admin_notice(
$message,
array(
'type' => 'success',
'dismissible' => true,
'id' => 'message',
'additional_classes' => array( 'updated' ),
)
);
endif;
?>
<div id="lost-connection-notice" class="error hidden">
<p><span class="spinner"></span> <?php _e( '<strong>Connection lost.</strong> Saving has been disabled until you are reconnected.' ); ?>
<span class="hide-if-no-sessionstorage"><?php _e( 'This post is being backed up in your browser, just in case.' ); ?></span>