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

Add usages of `wp_admin_notice()` and `wp_get_admin_notice()` on `.notice-[type]` in the root level of `/wp-admin/includes`. Ongoing task to implement new function across core.

Props costdev, joedolson.
See #57791.
Built from https://develop.svn.wordpress.org/trunk@56571


git-svn-id: http://core.svn.wordpress.org/trunk@56083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
joedolson
2023-09-14 01:13:20 +00:00
parent 0f4010bd49
commit 008a32110f
14 changed files with 186 additions and 117 deletions

View File

@@ -2497,13 +2497,17 @@ function paused_plugins_notice() {
return;
}
printf(
'<div class="notice notice-error"><p><strong>%s</strong><br>%s</p><p><a href="%s">%s</a></p></div>',
$message = sprintf(
'<strong>%s</strong><br>%s</p><p><a href="%s">%s</a>',
__( 'One or more plugins failed to load properly.' ),
__( 'You can find more details and make changes on the Plugins screen.' ),
esc_url( admin_url( 'plugins.php?plugin_status=paused' ) ),
__( 'Go to the Plugins screen' )
);
wp_admin_notice(
$message,
array( 'type' => 'error' )
);
}
/**
@@ -2571,8 +2575,8 @@ function deactivated_plugins_notice() {
);
}
printf(
'<div class="notice notice-warning"><p><strong>%s</strong><br>%s</p><p><a href="%s">%s</a></p></div>',
$message = sprintf(
'<strong>%s</strong><br>%s</p><p><a href="%s">%s</a>',
sprintf(
/* translators: %s: Name of deactivated plugin. */
__( '%s plugin deactivated during WordPress upgrade.' ),
@@ -2582,6 +2586,7 @@ function deactivated_plugins_notice() {
esc_url( admin_url( 'plugins.php?plugin_status=inactive' ) ),
__( 'Go to the Plugins screen' )
);
wp_admin_notice( $message, array( 'type' => 'warning' ) );
}
// Empty the options.