Make WordPress Core


Ignore:
Timestamp:
03/10/2025 06:14:48 PM (20 months ago)
Author:
joedolson
Message:

Administration: Update out of date error message styling.

Change several error message across core to use WordPress standard styling. Ensure only prefixes are wrapped in strong tags rather than the whole message, use notice notice-error classes where appropriate, and replace a custom error with wp_admin_notice() in multisite.

Props afercia, rajinsharwar, robinmartijn, mukesh27, sabernhardt, oglekler, joedolson, chaion07, im3dabasia1, audrasjb, dkarfa, najmulsaju.
Fixes #50402.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-ms-themes-list-table.php

    r58745 r59960  
    705705
    706706                if ( $theme->errors() ) {
    707                         $pre = 'broken' === $status ? __( 'Broken Theme:' ) . ' ' : '';
    708                         echo '<p><strong class="error-message">' . $pre . $theme->errors()->get_error_message() . '</strong></p>';
     707                        $pre = 'broken' === $status ? '<strong class="error-message">' . __( 'Broken Theme:' ) . '</strong> ' : '';
     708                        wp_admin_notice(
     709                                $pre . $theme->errors()->get_error_message(),
     710                                array(
     711                                        'type'               => 'error',
     712                                        'additional_classes' => 'inline',
     713                                )
     714                        );
    709715                }
    710716
Note: See TracChangeset for help on using the changeset viewer.