Make WordPress Core


Ignore:
Timestamp:
09/14/2023 02:13:42 AM (9 months ago)
Author:
joedolson
Message:

Administration: Use wp_admin_notice() for .updated.

Add usages of wp_admin_notice() and wp_get_admin_notice() on .updated 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/widgets-form.php

    r56549 r56573  
    404404<hr class="wp-header-end">
    405405
    406 <?php if ( isset( $_GET['message'] ) && isset( $messages[ $_GET['message'] ] ) ) { ?>
    407 <div id="message" class="updated notice is-dismissible"><p><?php echo $messages[ $_GET['message'] ]; ?></p></div>
    408 <?php } ?>
    409 <?php if ( isset( $_GET['error'] ) && isset( $errors[ $_GET['error'] ] ) ) { ?>
    410 <div id="message" class="error"><p><?php echo $errors[ $_GET['error'] ]; ?></p></div>
    411 <?php } ?>
    412 
    413 <?php
     406<?php
     407if ( isset( $_GET['message'] ) && isset( $messages[ $_GET['message'] ] ) ) {
     408    wp_admin_notice(
     409        $messages[ $_GET['message'] ],
     410        array(
     411            'id'                 => 'message',
     412            'additional_classes' => array( 'updated' ),
     413            'dismissible'        => true,
     414        )
     415    );
     416}
     417if ( isset( $_GET['error'] ) && isset( $errors[ $_GET['error'] ] ) ) {
     418    wp_admin_notice(
     419        $errors[ $_GET['error'] ],
     420        array(
     421            'id'                 => 'message',
     422            'additional_classes' => array( 'error' ),
     423            'dismissible'        => true,
     424        )
     425    );
     426}
     427
    414428/**
    415429 * Fires before the Widgets administration page content loads.
Note: See TracChangeset for help on using the changeset viewer.