summaryrefslogtreecommitdiffstatshomepage
path: root/src/wp-admin/includes/class-custom-image-header.php
diff options
context:
space:
mode:
authorColin Stewart <costdev@git.wordpress.org>2023-09-17 15:21:07 +0000
committerColin Stewart <costdev@git.wordpress.org>2023-09-17 15:21:07 +0000
commitce32693b3dde40b3293e9f6057c1857bc8899292 (patch)
tree335460b66b99efb0b7376d9e2e50df0110567fdf /src/wp-admin/includes/class-custom-image-header.php
parentfe097d1686f6eea3e7a347ad5f361c1bbd6ce1f8 (diff)
downloadwordpress-ce32693b3dde40b3293e9f6057c1857bc8899292.tar.gz
wordpress-ce32693b3dde40b3293e9f6057c1857bc8899292.zip
Administration: Use `wp_admin_notice()` more in `/wp-admin/includes/`.
Adds further usages of `wp_admin_notice()` in `/wp-admin/includes/` on `.notice-error`, `.notice-warning`, `.error`, and `.updated`. Ongoing task to implement new function across core. Follow-up to [56408], [56409], [56410], [56518], [56570], [56571], [56572], [56573], [56576], [56589], [56590], [56597]. Props joedolson, mukesh27, costdev. See #57791. git-svn-id: https://develop.svn.wordpress.org/trunk@56599 602fd350-edb4-49c9-b593-d223f7449a82
Diffstat (limited to 'src/wp-admin/includes/class-custom-image-header.php')
-rw-r--r--src/wp-admin/includes/class-custom-image-header.php26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/wp-admin/includes/class-custom-image-header.php b/src/wp-admin/includes/class-custom-image-header.php
index 5d0260b1c3..9df725af0c 100644
--- a/src/wp-admin/includes/class-custom-image-header.php
+++ b/src/wp-admin/includes/class-custom-image-header.php
@@ -524,18 +524,22 @@ class Custom_Image_Header {
)
);
}
- ?>
- <?php if ( ! empty( $this->updated ) ) { ?>
-<div id="message" class="updated">
- <p>
- <?php
- /* translators: %s: Home URL. */
- printf( __( 'Header updated. <a href="%s">Visit your site</a> to see how it looks.' ), esc_url( home_url( '/' ) ) );
- ?>
- </p>
-</div>
- <?php } ?>
+ if ( ! empty( $this->updated ) ) {
+ $updated_message = sprintf(
+ /* translators: %s: Home URL. */
+ __( 'Header updated. <a href="%s">Visit your site</a> to see how it looks.' ),
+ esc_url( home_url( '/' ) )
+ );
+ wp_admin_notice(
+ $updated_message,
+ array(
+ 'id' => 'message',
+ 'additional_classes' => array( 'updated' ),
+ )
+ );
+ }
+ ?>
<h2><?php _e( 'Header Image' ); ?></h2>