1. 首页
  2. WordPress 函数手册

privacy_ping_filter()

privacy_ping_filter( mixed $sites )

在返回站点之前检查博客是否是公共的。
Check whether blog is public before returning sites.

目录锚点:#参数#返回#源码


参数(Parameters)

参数 类型 必填 说明
$sites (mixed) 必需 如果博客是公开的,将返回;如果不公开,将不返回。

返回(Return)

(mixed)如果blog不是公共的,则返回空string;如果site是公共的,则返回$sites。


源码(Source)

/**
 * Check whether blog is public before returning sites.
 *
 * @since 2.1.0
 *
 * @param mixed $sites Will return if blog is public, will not return if not public.
 * @return mixed Empty string if blog is not public, returns $sites, if site is public.
 */
function privacy_ping_filter($sites) {
	if ( '0' != get_option('blog_public') )
		return $sites;
	else
		return '';
}
更新版本 源码位置 使用 被使用
2.1.0 wp-includes/comment.php:2908 0 1 function

privacy_ping_filter() 为WP2原创文章,链接:https://www.wp2.cn/functions/privacy_ping_filter/