Make WordPress Core


Ignore:
Timestamp:
09/17/2023 03:31:32 PM (13 months ago)
Author:
joedolson
Message:

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

Add additional usage of wp_admin_notice() in wp-admin/ on .error and miscellaneous usages previously overlooked.

Follow up to [56408], [56409], [56410], [56518], [56570], [56571], [56572], [56573], [56576], [56589], [56590], [56597], [56599].

Props costdev, joedolson.
See #57791.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/theme-editor.php

    r56570 r56600  
    263263<?php
    264264if ( $theme->errors() ) {
    265     echo '<div class="error"><p><strong>' . __( 'This theme is broken.' ) . '</strong> ' . $theme->errors()->get_error_message() . '</p></div>';
     265    wp_admin_notice(
     266        '<strong>' . __( 'This theme is broken.' ) . '</strong> ' . $theme->errors()->get_error_message(),
     267        array(
     268            'additional_classes' => array( 'error' ),
     269        )
     270    );
    266271}
    267272?>
     
    295300<?php
    296301if ( $error ) :
    297     echo '<div class="error"><p>' . __( 'File does not exist! Please double check the name and try again.' ) . '</p></div>';
     302    wp_admin_notice(
     303        __( 'File does not exist! Please double check the name and try again.' ),
     304        array(
     305            'additional_classes' => array( 'error' ),
     306        )
     307    );
    298308else :
    299309    ?>
Note: See TracChangeset for help on using the changeset viewer.