函数原型
get_to_ping( int|WP_Post $post ): string[]|false
函数描述
Retrieves URLs that need to be pinged.
是否弃用
未弃用
函数参数
-
$post
int|WP_Post
Required - Post ID or post object.
函数返回值
string[]|false List of URLs yet to ping.
函数位置
File: wp-includes/post.php.
函数源码
function get_to_ping( $post ) {
$post = get_post( $post );
if ( ! $post ) {
return false;
}
$to_ping = sanitize_trackback_urls( $post->to_ping );
$to_ping = preg_split( '/\s/', $to_ping, -1, PREG_SPLIT_NO_EMPTY );
/**
* Filters the list of URLs yet to ping for the given post.
*
* @since 2.0.0
*
* @param string[] $to_ping List of URLs yet to ping.
*/
return apply_filters( 'get_to_ping', $to_ping );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 4.7.0 | $post can be a WP_Post object. |
| 1.5.0 | Introduced. |

