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/template.php

    r56549 r56571  
    513513            <span class="waiting spinner"></span>
    514514        </p>
    515         <div class="notice notice-error notice-alt inline hidden">
    516             <p class="error"></p>
    517         </div>
     515        <?php
     516        wp_admin_notice(
     517            '<p class="error"></p>',
     518            array(
     519                'type'               => 'error',
     520                'additional_classes' => array( 'notice-alt', 'inline', 'hidden' ),
     521                'paragraph_wrap'     => false,
     522            )
     523        );
     524        ?>
    518525    </div>
    519526
     
    27772784 */
    27782785function _wp_posts_page_notice() {
    2779     printf(
    2780         '<div class="notice notice-warning inline"><p>%s</p></div>',
    2781         __( 'You are currently editing the page that shows your latest posts.' )
     2786    wp_admin_notice(
     2787        __( 'You are currently editing the page that shows your latest posts.' ),
     2788        array(
     2789            'type'               => 'warning',
     2790            'additional_classes' => array( 'inline' ),
     2791        )
    27822792    );
    27832793}
Note: See TracChangeset for help on using the changeset viewer.