函数原型
generic_ping( int $post_id ): int
函数描述
Sends pings to all of the ping site services.
是否弃用
未弃用
函数参数
-
$post_id
int
Required - Post ID.
函数返回值
int Same post ID as provided.
函数位置
File: wp-includes/comment.php.
函数源码
function generic_ping( $post_id = 0 ) {
$services = get_option( 'ping_sites' );
$services = explode( "\n", $services );
foreach ( (array) $services as $service ) {
$service = trim( $service );
if ( '' !== $service ) {
weblog_ping( $service );
}
}
return $post_id;
}
源码链接
变更日志
| Version | Description |
|---|---|
| 1.2.0 | Introduced. |

