pings_open()
pings_open( int|WP_Post $post_id = null ) 确定当前日志是否为ping…
pings_open( int|WP_Post $post_id = null )
确定当前日志是否为ping打开。
Determines whether the current post is open for pings.
确定当前日志是否为ping打开。
Determines whether the current post is open for pings.
目录锚点:#说明#参数#返回#源码
说明(Description)
有关此主题函数和类似主题函数的更多信息,请参阅主题开发人员手册中的条件标记文章。
参数(Parameters)
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| $post_id | (int | WP_Post) | 可选 | Post ID或WP_Post对象。默认当前职位。 |
返回(Return)
(bool)如果ping被接受,则为True
源码(Source)
/**
* Whether the current post is open for pings.
*
* @since 1.5.0
*
* @param int|WP_Post $post_id Post ID or WP_Post object. Default current post.
* @return bool True if pings are accepted
*/
function pings_open( $post_id = null ) {
$_post = get_post($post_id);
$open = ( 'open' == $_post->ping_status );
/**
* Filter 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|WP_Post $post_id The post ID or WP_Post object.
*/
return apply_filters( 'pings_open', $open, $post_id );
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 1.5.0 | wp-includes/comment-template.php:1263 | 6 | 3 |
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

还没有任何评论,赶紧来占个楼吧!