Make WordPress Core


Ignore:
Timestamp:
09/17/2023 03:21:07 PM (3 years ago)
Author:
costdev
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-custom-image-header.php

    r56571 r56599  
    525525                        );
    526526                }
     527
     528                if ( ! empty( $this->updated ) ) {
     529                        $updated_message = sprintf(
     530                                /* translators: %s: Home URL. */
     531                                __( 'Header updated. <a href="%s">Visit your site</a> to see how it looks.' ),
     532                                esc_url( home_url( '/' ) )
     533                        );
     534                        wp_admin_notice(
     535                                $updated_message,
     536                                array(
     537                                        'id'                 => 'message',
     538                                        'additional_classes' => array( 'updated' ),
     539                                )
     540                        );
     541                }
    527542                ?>
    528 
    529                 <?php if ( ! empty( $this->updated ) ) { ?>
    530 <div id="message" class="updated">
    531         <p>
    532                         <?php
    533                         /* translators: %s: Home URL. */
    534                         printf( __( 'Header updated. <a href="%s">Visit your site</a> to see how it looks.' ), esc_url( home_url( '/' ) ) );
    535                         ?>
    536         </p>
    537 </div>
    538                 <?php } ?>
    539543
    540544<h2><?php _e( 'Header Image' ); ?></h2>
Note: See TracChangeset for help on using the changeset viewer.