Make WordPress Core


Ignore:
Timestamp:
09/14/2023 01:11:29 AM (10 months 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-background.php

    r55881 r56571  
    240240<h1><?php _e( 'Custom Background' ); ?></h1>
    241241
    242         <?php if ( current_user_can( 'customize' ) ) { ?>
    243 <div class="notice notice-info hide-if-no-customize">
    244     <p>
    245             <?php
    246             printf(
     242        <?php
     243        if ( current_user_can( 'customize' ) ) {
     244            $message = sprintf(
    247245                /* translators: %s: URL to background image configuration in Customizer. */
    248246                __( 'You can now manage and live-preview Custom Backgrounds in the <a href="%s">Customizer</a>.' ),
    249247                admin_url( 'customize.php?autofocus[control]=background_image' )
    250248            );
    251             ?>
    252     </p>
    253 </div>
    254         <?php } ?>
    255 
    256         <?php if ( ! empty( $this->updated ) ) { ?>
     249            wp_admin_notice(
     250                $message,
     251                array(
     252                    'type'               => 'info',
     253                    'additional_classes' => array( 'hide-if-no-customize' ),
     254                )
     255            );
     256        }
     257
     258        if ( ! empty( $this->updated ) ) {
     259            ?>
    257260<div id="message" class="updated">
    258261    <p>
Note: See TracChangeset for help on using the changeset viewer.