site_admin_notice()
Displays an admin notice to upgrade all sites after a core upgrade.
Хуков нет.
Возвращает
null|false
. Void on success. False if the current user is not a super admin.
Использование
site_admin_notice();
Заметки
- Global. int. $wp_db_version WordPress database version.
- Global. Строка. $pagenow The filename of the current screen.
Список изменений
С версии 3.0.0 | Введена. |
Код site_admin_notice() site admin notice WP 6.4.3
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 ) { $upgrade_network_message = 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' ) ) ); wp_admin_notice( $upgrade_network_message, array( 'type' => 'warning', 'additional_classes' => array( 'update-nag', 'inline' ), 'paragraph_wrap' => false, ) ); } }