Make WordPress Core


Ignore:
Timestamp:
09/14/2023 01:11:29 AM (3 years ago)
Author:
joedolson
Message:

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

Add usages of wp_admin_notice() and wp_get_admin_notice() on .notice-[type] in the root level of /wp-admin/includes. Ongoing task to implement new function across core.

Props costdev, joedolson.
See #57791.

File:
1 edited

Legend:

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

    r55988 r56571  
    510510<h1><?php _e( 'Custom Header' ); ?></h1>
    511511
    512                 <?php if ( current_user_can( 'customize' ) ) { ?>
    513 <div class="notice notice-info hide-if-no-customize">
    514         <p>
    515                         <?php
    516                         printf(
     512                <?php
     513                if ( current_user_can( 'customize' ) ) {
     514                        $message = sprintf(
    517515                                /* translators: %s: URL to header image configuration in Customizer. */
    518516                                __( 'You can now manage and live-preview Custom Header in the <a href="%s">Customizer</a>.' ),
    519517                                admin_url( 'customize.php?autofocus[control]=header_image' )
    520518                        );
    521                         ?>
    522         </p>
    523 </div>
    524                 <?php } ?>
     519                        wp_admin_notice(
     520                                $message,
     521                                array(
     522                                        'type'               => 'info',
     523                                        'additional_classes' => array( 'hide-if-no-customize' ),
     524                                )
     525                        );
     526                }
     527                ?>
    525528
    526529                <?php if ( ! empty( $this->updated ) ) { ?>
Note: See TracChangeset for help on using the changeset viewer.