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

Add additional usage of `wp_admin_notice()` in `wp-admin/` on `.error` and miscellaneous usages previously overlooked. 

Follow up to [56408], [56409], [56410], [56518], [56570], [56571], [56572], [56573], [56576], [56589], [56590], [56597], [56599].

Props costdev, joedolson.
See #57791.

git-svn-id: https://develop.svn.wordpress.org/trunk@56600 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Joe Dolson
2023-09-17 15:31:32 +00:00
parent ce32693b3d
commit f058bd1217
15 changed files with 303 additions and 160 deletions
+12 -2
View File
@@ -262,7 +262,12 @@ if ( preg_match( '/\.css$/', $file ) && ! wp_is_block_theme() && current_user_ca
<?php
if ( $theme->errors() ) {
echo '<div class="error"><p><strong>' . __( 'This theme is broken.' ) . '</strong> ' . $theme->errors()->get_error_message() . '</p></div>';
wp_admin_notice(
'<strong>' . __( 'This theme is broken.' ) . '</strong> ' . $theme->errors()->get_error_message(),
array(
'additional_classes' => array( 'error' ),
)
);
}
?>
@@ -294,7 +299,12 @@ if ( $theme->errors() ) {
<?php
if ( $error ) :
echo '<div class="error"><p>' . __( 'File does not exist! Please double check the name and try again.' ) . '</p></div>';
wp_admin_notice(
__( 'File does not exist! Please double check the name and try again.' ),
array(
'additional_classes' => array( 'error' ),
)
);
else :
?>
<form name="template" id="template" action="theme-editor.php" method="post">