site_admin_notice() - WordPress 函数参考中文文档

返回介绍

site_admin_notice()

发布于 2017-09-11 字数1527 浏览 969 评论 0

site_admin_notice()

Displays an admin notice to upgrade all sites after a core upgrade.


描述


返回值

(false) False if the current user is not a super admin.


源代码

File: wp-admin/includes/ms.php

function site_admin_notice() {
	global $wp_db_version, $pagenow;

	if ( ! current_user_can( 'upgrade_network' ) ) {
		return false;
	}

	if ( 'upgrade.php' == $pagenow ) {
		return;
	}

	if ( get_site_option( 'wpmu_upgrade_site' ) != $wp_db_version ) {
		echo "<div class='update-nag'>" . sprintf( __( '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>";
	}
}

更新日志

Version 描述
3.0.0 Introduced.

相关函数

Uses

  • wp-includes/capabilities.php:
    current_user_can()
  • wp-includes/l10n.php:
    __()
  • wp-includes/formatting.php:
    esc_url()
  • wp-includes/link-template.php:
    network_admin_url()
  • wp-includes/option.php:
    get_site_option()

User Contributed Notes

上一篇:single_term_title()

下一篇:site_icon_url()

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!