Make WordPress Core


Ignore:
Timestamp:
02/23/2023 10:11:51 PM (22 months ago)
Author:
joedolson
Message:

Networks and Sites: Use consistent markup for admin notices.

Fix admin notices in network screens so they use consistent markup and style.

Props afercia, marksabbath, stevenkword, jeremyfelt, aryamaaru, robinwpdeveloper, obayedmamur, joedolson.
Fixes #39213.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/network/themes.php

    r55412 r55418  
    376376        $message = _n( '%s theme enabled.', '%s themes enabled.', $enabled );
    377377    }
    378     echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>';
     378    echo '<div id="message" class="notice notice-updated is-dismissible"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>';
    379379} elseif ( isset( $_GET['disabled'] ) ) {
    380380    $disabled = absint( $_GET['disabled'] );
     
    385385        $message = _n( '%s theme disabled.', '%s themes disabled.', $disabled );
    386386    }
    387     echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>';
     387    echo '<div id="message" class="notice notice-updated is-dismissible"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>';
    388388} elseif ( isset( $_GET['deleted'] ) ) {
    389389    $deleted = absint( $_GET['deleted'] );
     
    394394        $message = _n( '%s theme deleted.', '%s themes deleted.', $deleted );
    395395    }
    396     echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $deleted ) ) . '</p></div>';
     396    echo '<div id="message" class="notice notice-success is-dismissible"><p>' . sprintf( $message, number_format_i18n( $deleted ) ) . '</p></div>';
    397397} elseif ( isset( $_GET['enabled-auto-update'] ) ) {
    398398    $enabled = absint( $_GET['enabled-auto-update'] );
     
    403403        $message = _n( '%s theme will be auto-updated.', '%s themes will be auto-updated.', $enabled );
    404404    }
    405     echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>';
     405    echo '<div id="message" class="notice notice-success is-dismissible"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>';
    406406} elseif ( isset( $_GET['disabled-auto-update'] ) ) {
    407407    $disabled = absint( $_GET['disabled-auto-update'] );
     
    412412        $message = _n( '%s theme will no longer be auto-updated.', '%s themes will no longer be auto-updated.', $disabled );
    413413    }
    414     echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>';
     414    echo '<div id="message" class="notice notice-success is-dismissible"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>';
    415415} elseif ( isset( $_GET['error'] ) && 'none' === $_GET['error'] ) {
    416     echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'No theme selected.' ) . '</p></div>';
     416    echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'No theme selected.' ) . '</p></div>';
    417417} elseif ( isset( $_GET['error'] ) && 'main' === $_GET['error'] ) {
    418     echo '<div class="error notice is-dismissible"><p>' . __( 'You cannot delete a theme while it is active on the main site.' ) . '</p></div>';
     418    echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'You cannot delete a theme while it is active on the main site.' ) . '</p></div>';
    419419}
    420420
Note: See TracChangeset for help on using the changeset viewer.