site_admin_notice

函数


site_admin_notice ( No parameters )
返回值
  • (void|false) Void on success. False if the current user is not a super admin.
定义位置
  • wp-admin/includes/ms.php
    , line 677
引入
3.0.0
弃用

显示一个管理员通知,在核心升级后升级所有站点。

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 "
" . sprintf( /* translators: %s: URL to Upgrade Network screen. */ __( 'Thank you for Updating! Please visit the Upgrade Network page to update all your sites.' ), esc_url( network_admin_url( 'upgrade.php' ) ) ) . '
'; } }