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

    r55412 r56600  
    6161<div class="wrap">
    6262<h1><?php echo esc_html( $title ); ?></h1>
    63 <?php if ( ! empty( $_GET['invalid'] ) ) : ?>
    64     <div class="error">
    65         <p><strong><?php _e( 'Error:' ); ?></strong>
    66             <?php
    67             /* translators: %s: Importer slug. */
    68             printf( __( 'The %s importer is invalid or is not installed.' ), '<strong>' . esc_html( $_GET['invalid'] ) . '</strong>' );
    69             ?>
    70         </p>
    71     </div>
    72 <?php endif; ?>
     63<?php
     64if ( ! empty( $_GET['invalid'] ) ) :
     65    $importer_not_installed = '<strong>' . __( 'Error:' ) . '</strong> ' . sprintf(
     66        /* translators: %s: Importer slug. */
     67        __( 'The %s importer is invalid or is not installed.' ),
     68        '<strong>' . esc_html( $_GET['invalid'] ) . '</strong>'
     69    );
     70    wp_admin_notice(
     71        $importer_not_installed,
     72        array(
     73            'additional_classes' => array( 'error' ),
     74        )
     75    );
     76endif;
     77?>
    7378<p><?php _e( 'If you have posts or comments in another system, WordPress can import those into this site. To get started, choose a system to import from below:' ); ?></p>
    7479
Note: See TracChangeset for help on using the changeset viewer.