On this page
site_admin_notice(): void|false
Displays an admin notice to upgrade all sites after a core upgrade.
Return
void|false Void on success. False if the current user is not a super admin.
Source
File: wp-admin/includes/ms.php. View all references
function site_admin_notice() {
global $wp_db_version, $pagenow;
if ( ! current_user_can( 'upgrade_network' ) ) {
return false;
}
if ( 'upgrade.php' === $pagenow ) {
return;
}
if ( (int) get_site_option( 'wpmu_upgrade_site' ) !== $wp_db_version ) {
echo "<div class='update-nag notice notice-warning inline'>" . sprintf(
/* translators: %s: URL to Upgrade Network screen. */
__( 'Thank you for Updating! Please visit the <a href="%s">Upgrade Network</a> page to update all your sites.' ),
esc_url( network_admin_url( 'upgrade.php' ) )
) . '</div>';
}
}
Related
Uses
| Uses | Description |
|---|---|
| network_admin_url() wp-includes/link-template.php | Retrieves the URL to the admin area for the network. |
| current_user_can() wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| __() wp-includes/l10n.php | Retrieves the translation of $text. |
| esc_url() wp-includes/formatting.php | Checks and cleans a URL. |
| get_site_option() wp-includes/option.php | Retrieve an option value for the current network based on name of option. |
Changelog
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/site_admin_notice