Make WordPress Core

Changeset 55418


Ignore:
Timestamp:
02/23/2023 10:11:51 PM (20 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.

Location:
trunk/src/wp-admin
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/my-sites.php

    r55412 r55418  
    5757
    5858if ( $updated ) { ?>
    59     <div id="message" class="updated notice is-dismissible"><p><strong><?php _e( 'Settings saved.' ); ?></strong></p></div>
     59    <div id="message" class="notice notice-success is-dismissible"><p><strong><?php _e( 'Settings saved.' ); ?></strong></p></div>
    6060<?php } ?>
    6161
     
    7575
    7676if ( empty( $blogs ) ) :
    77     echo '<p>';
    78     _e( 'You must be a member of at least one site to use this page.' );
    79     echo '</p>';
     77    ?>
     78    <div class="notice notice-error is-dismissible"><p><strong><?php _e( 'You must be a member of at least one site to use this page.' ); ?></strong></p></div>
     79    <?php
    8080else :
    8181    ?>
  • trunk/src/wp-admin/network/settings.php

    r55412 r55418  
    139139
    140140if ( isset( $_GET['updated'] ) ) {
    141     ?><div id="message" class="updated notice is-dismissible"><p><?php _e( 'Settings saved.' ); ?></p></div>
     141    ?><div id="message" class="notice notice-success is-dismissible"><p><?php _e( 'Settings saved.' ); ?></p></div>
    142142    <?php
    143143}
     
    168168                    if ( $new_admin_email && get_site_option( 'admin_email' ) !== $new_admin_email ) :
    169169                        ?>
    170                         <div class="updated inline">
     170                        <div class="notice notice-warning is-dismissible inline">
    171171                        <p>
    172172                        <?php
  • trunk/src/wp-admin/network/site-info.php

    r55276 r55418  
    148148if ( ! empty( $messages ) ) {
    149149    foreach ( $messages as $msg ) {
    150         echo '<div id="message" class="updated notice is-dismissible"><p>' . $msg . '</p></div>';
     150        echo '<div id="message" class="notice notice-success is-dismissible"><p>' . $msg . '</p></div>';
    151151    }
    152152}
  • trunk/src/wp-admin/network/site-new.php

    r55415 r55418  
    190190if ( ! empty( $messages ) ) {
    191191    foreach ( $messages as $msg ) {
    192         echo '<div id="message" class="updated notice is-dismissible"><p>' . $msg . '</p></div>';
     192        echo '<div id="message" class="notice notice-success is-dismissible"><p>' . $msg . '</p></div>';
    193193    }
    194194}
  • trunk/src/wp-admin/network/site-settings.php

    r55408 r55418  
    106106if ( ! empty( $messages ) ) {
    107107    foreach ( $messages as $msg ) {
    108         echo '<div id="message" class="updated notice is-dismissible"><p>' . $msg . '</p></div>';
     108        echo '<div id="message" class="notice notice-success is-dismissible"><p>' . $msg . '</p></div>';
    109109    }
    110110}
  • trunk/src/wp-admin/network/site-themes.php

    r51475 r55418  
    196196        $message = _n( '%s theme enabled.', '%s themes enabled.', $enabled );
    197197    }
    198     echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>';
     198    echo '<div id="message" class="notice notice-success is-dismissible"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>';
    199199} elseif ( isset( $_GET['disabled'] ) ) {
    200200    $disabled = absint( $_GET['disabled'] );
     
    205205        $message = _n( '%s theme disabled.', '%s themes disabled.', $disabled );
    206206    }
    207     echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>';
     207    echo '<div id="message" class="notice notice-success is-dismissible"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>';
    208208} elseif ( isset( $_GET['error'] ) && 'none' === $_GET['error'] ) {
    209     echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'No theme selected.' ) . '</p></div>';
     209    echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'No theme selected.' ) . '</p></div>';
    210210}
    211211?>
  • trunk/src/wp-admin/network/site-users.php

    r51475 r55418  
    236236    switch ( $_GET['update'] ) {
    237237        case 'adduser':
    238             echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User added.' ) . '</p></div>';
     238            echo '<div id="message" class="notice notice-success is-dismissible"><p>' . __( 'User added.' ) . '</p></div>';
    239239            break;
    240240        case 'err_add_member':
    241             echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'User is already a member of this site.' ) . '</p></div>';
     241            echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'User is already a member of this site.' ) . '</p></div>';
    242242            break;
    243243        case 'err_add_fail':
    244             echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'User could not be added to this site.' ) . '</p></div>';
     244            echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'User could not be added to this site.' ) . '</p></div>';
    245245            break;
    246246        case 'err_add_notfound':
    247             echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username of an existing user.' ) . '</p></div>';
     247            echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'Enter the username of an existing user.' ) . '</p></div>';
    248248            break;
    249249        case 'promote':
    250             echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Changed roles.' ) . '</p></div>';
     250            echo '<div id="message" class="notice notice-success is-dismissible"><p>' . __( 'Changed roles.' ) . '</p></div>';
    251251            break;
    252252        case 'err_promote':
    253             echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to change role.' ) . '</p></div>';
     253            echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'Select a user to change role.' ) . '</p></div>';
    254254            break;
    255255        case 'remove':
    256             echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User removed from this site.' ) . '</p></div>';
     256            echo '<div id="message" class="notice notice-success is-dismissible"><p>' . __( 'User removed from this site.' ) . '</p></div>';
    257257            break;
    258258        case 'err_remove':
    259             echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to remove.' ) . '</p></div>';
     259            echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'Select a user to remove.' ) . '</p></div>';
    260260            break;
    261261        case 'newuser':
    262             echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User created.' ) . '</p></div>';
     262            echo '<div id="message" class="notice notice-success is-dismissible"><p>' . __( 'User created.' ) . '</p></div>';
    263263            break;
    264264        case 'err_new':
    265             echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username and email.' ) . '</p></div>';
     265            echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'Enter the username and email.' ) . '</p></div>';
    266266            break;
    267267        case 'err_new_dup':
    268             echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Duplicated username or email address.' ) . '</p></div>';
     268            echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'Duplicated username or email address.' ) . '</p></div>';
    269269            break;
    270270    }
  • trunk/src/wp-admin/network/sites.php

    r55415 r55418  
    355355
    356356    if ( ! empty( $msg ) ) {
    357         $msg = '<div id="message" class="updated notice is-dismissible"><p>' . $msg . '</p></div>';
     357        $msg = '<div id="message" class="notice notice-success is-dismissible"><p>' . $msg . '</p></div>';
    358358    }
    359359}
  • 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
  • trunk/src/wp-admin/network/user-new.php

    r55415 r55418  
    7878}
    7979
     80$message = '';
    8081if ( isset( $_GET['update'] ) ) {
    81     $messages = array();
    8282    if ( 'added' === $_GET['update'] ) {
    8383        $edit_link = '';
     
    9494            $message .= sprintf( ' <a href="%s">%s</a>', $edit_link, __( 'Edit user' ) );
    9595        }
    96 
    97         $messages[] = $message;
    9896    }
    9997}
     
    108106<h1 id="add-new-user"><?php _e( 'Add New User' ); ?></h1>
    109107<?php
    110 if ( ! empty( $messages ) ) {
    111     foreach ( $messages as $msg ) {
    112         echo '<div id="message" class="updated notice is-dismissible"><p>' . $msg . '</p></div>';
    113     }
     108if ( '' !== $message ) {
     109    echo '<div id="message" class="notice notice-success is-dismissible"><p>' . $message . '</p></div>';
    114110}
    115111
    116112if ( isset( $add_user_errors ) && is_wp_error( $add_user_errors ) ) {
    117113    ?>
    118     <div class="error">
     114    <div id="message" class="notice notice-error is-dismissible">
    119115        <?php
    120         foreach ( $add_user_errors->get_error_messages() as $message ) {
    121             echo "<p>$message</p>";
     116        foreach ( $add_user_errors->get_error_messages() as $error ) {
     117            echo "<p>$error</p>";
    122118        }
    123119        ?>
  • trunk/src/wp-admin/network/users.php

    r55415 r55418  
    256256if ( isset( $_REQUEST['updated'] ) && 'true' == $_REQUEST['updated'] && ! empty( $_REQUEST['action'] ) ) {
    257257    ?>
    258     <div id="message" class="updated notice is-dismissible"><p>
     258    <div id="message" class="notice notice-success is-dismissible"><p>
    259259        <?php
    260260        switch ( $_REQUEST['action'] ) {
Note: See TracChangeset for help on using the changeset viewer.