pings_open

函数
pings_open ( $post = null )
参数
  • (int|WP_Post) $post Post ID or WP_Post object. Default current post.
    Required:
    Default: null
返回值
  • (bool) True if pings are accepted
定义位置
相关方法
comments_openwp_doing_cronwp_insert_commentis_homeis_page
引入
1.5.0
弃用
-

pings_open: 这个函数用来检查当前文章的pingbacks是否开放。它返回一个布尔值。

确定当前文章是否开放供ping。

关于这个和类似主题功能的更多信息,请查看《主题开发者手册》中的{@link Conditional Tags}文章。

function pings_open( $post = null ) {
	$_post = get_post( $post );

	$post_id = $_post ? $_post->ID : 0;
	$open    = ( $_post && ( 'open' === $_post->ping_status ) );

	/**
	 * Filters whether the current post is open for pings.
	 *
	 * @since 2.5.0
	 *
	 * @param bool $open    Whether the current post is open for pings.
	 * @param int  $post_id The post ID.
	 */
	return apply_filters( 'pings_open', $open, $post_id );
}

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-14 15:36:34

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: