Make WordPress Core


Ignore:
Timestamp:
09/14/2023 01:11:29 AM (9 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/meta-boxes.php

    r56420 r56571  
    312312
    313313        if ( 'draft' === $post->post_status && get_post_meta( $post_id, '_customize_changeset_uuid', true ) ) :
    314             ?>
    315             <div class="notice notice-info notice-alt inline">
    316                 <p>
    317                     <?php
    318                     printf(
    319                         /* translators: %s: URL to the Customizer. */
    320                         __( 'This draft comes from your <a href="%s">unpublished customization changes</a>. You can edit, but there is no need to publish now. It will be published automatically with those changes.' ),
    321                         esc_url(
    322                             add_query_arg(
    323                                 'changeset_uuid',
    324                                 rawurlencode( get_post_meta( $post_id, '_customize_changeset_uuid', true ) ),
    325                                 admin_url( 'customize.php' )
    326                             )
    327                         )
    328                     );
    329                     ?>
    330                 </p>
    331             </div>
    332             <?php
     314            $message = sprintf(
     315                /* translators: %s: URL to the Customizer. */
     316                __( 'This draft comes from your <a href="%s">unpublished customization changes</a>. You can edit, but there is no need to publish now. It will be published automatically with those changes.' ),
     317                esc_url(
     318                    add_query_arg(
     319                        'changeset_uuid',
     320                        rawurlencode( get_post_meta( $post_id, '_customize_changeset_uuid', true ) ),
     321                        admin_url( 'customize.php' )
     322                    )
     323                )
     324            );
     325            wp_admin_notice(
     326                $message,
     327                array(
     328                    'type'               => 'info',
     329                    'additional_classes' => array( 'notice-alt', 'inline' ),
     330                )
     331            );
    333332        endif;
    334333
Note: See TracChangeset for help on using the changeset viewer.