Make WordPress Core


Ignore:
Timestamp:
09/14/2023 12:52:45 AM (15 months ago)
Author:
joedolson
Message:

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

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

Props costdev, joedolson.
See #57791.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-form-advanced.php

    r55414 r56570  
    441441<hr class="wp-header-end">
    442442
    443 <?php if ( $notice ) : ?>
    444 <div id="notice" class="notice notice-warning"><p id="has-newer-autosave"><?php echo $notice; ?></p></div>
    445 <?php endif; ?>
    446 <?php if ( $message ) : ?>
    447 <div id="message" class="updated notice notice-success is-dismissible"><p><?php echo $message; ?></p></div>
    448 <?php endif; ?>
     443<?php
     444if ( $notice ) :
     445    wp_admin_notice(
     446        '<p id="has-newer-autosave">' . $notice . '</p>',
     447        array(
     448            'type'           => 'warning',
     449            'id'             => 'notice',
     450            'paragraph_wrap' => false,
     451        )
     452    );
     453endif;
     454if ( $message ) :
     455    wp_admin_notice(
     456        $message,
     457        array(
     458            'type'               => 'success',
     459            'dismissible'        => true,
     460            'id'                 => 'message',
     461            'additional_classes' => array( 'updated' ),
     462        )
     463    );
     464endif;
     465?>
    449466<div id="lost-connection-notice" class="error hidden">
    450467    <p><span class="spinner"></span> <?php _e( '<strong>Connection lost.</strong> Saving has been disabled until you are reconnected.' ); ?>
Note: See TracChangeset for help on using the changeset viewer.