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-tag-form.php

    r54240 r56570  
    8080
    8181if ( $message ) {
    82     ?>
    83 <div id="message" class="notice notice-<?php echo $class; ?>">
    84     <p><strong><?php echo $message; ?></strong></p>
    85     <?php if ( $wp_http_referer ) { ?>
    86     <p><a href="<?php echo esc_url( wp_validate_redirect( sanitize_url( $wp_http_referer ), admin_url( 'term.php?taxonomy=' . $taxonomy ) ) ); ?>">
    87         <?php echo esc_html( $tax->labels->back_to_items ); ?>
    88     </a></p>
    89     <?php } ?>
    90 </div>
    91     <?php
     82    $message = '<p><strong>' . $message . '</strong></p>';
     83    if ( $wp_http_referer ) {
     84        $message .= '<p><a href="' . esc_url( wp_validate_redirect( sanitize_url( $wp_http_referer ), admin_url( 'term.php?taxonomy=' . $taxonomy ) ) ) . '">' . esc_html( $tax->labels->back_to_items ) . '</a></p>';
     85    }
     86    wp_admin_notice(
     87        $message,
     88        array(
     89            'type'           => $class,
     90            'id'             => 'message',
     91            'paragraph_wrap' => false,
     92        )
     93    );
    9294}
    9395?>
Note: See TracChangeset for help on using the changeset viewer.