Make WordPress Core


Ignore:
Timestamp:
09/17/2023 03:21:07 PM (10 months ago)
Author:
costdev
Message:

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

Adds further usages of wp_admin_notice() in /wp-admin/includes/ on .notice-error, .notice-warning, .error, and .updated.

Ongoing task to implement new function across core.

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

Props joedolson, mukesh27, costdev.
See #57791.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ms.php

    r56549 r56599  
    693693
    694694    if ( (int) get_site_option( 'wpmu_upgrade_site' ) !== $wp_db_version ) {
    695         echo "<div class='update-nag notice notice-warning inline'>" . sprintf(
     695        $upgrade_network_message = sprintf(
    696696            /* translators: %s: URL to Upgrade Network screen. */
    697697            __( 'Thank you for Updating! Please visit the <a href="%s">Upgrade Network</a> page to update all your sites.' ),
    698698            esc_url( network_admin_url( 'upgrade.php' ) )
    699         ) . '</div>';
     699        );
     700
     701        wp_admin_notice(
     702            $upgrade_network_message,
     703            array(
     704                'type'               => 'warning',
     705                'additional_classes' => array( 'update-nag', 'inline' ),
     706                'paragraph_wrap'     => false,
     707            )
     708        );
    700709    }
    701710}
Note: See TracChangeset for help on using the changeset viewer.