generic_ping()

将Pings发送给所有ping网站服务

用法

<?php generic_ping( $post_id ) ?>

参数

$post_id

(integer) (可选) Post ID. Only used as a return velue.

默认值: 0

返回值

(integer) 

Returns $post_id unaltered.

注意

The $post_id and return values do not have to be an integer data types, but in WordPress $post_id is always an integer data type.

使用到: get_option() to get all ping sites.

使用到: weblog_ping() for each ping site.

历史

添加于 版本: 1.2.0

源文件

generic_ping() 函数的代码位于 wp-includes/comment.php.

/**
* Sends pings to all of the ping site services.
*
* @since 1.2.0
*
* @param int $post_id Post ID.
* @return int Same as Post ID from parameter
*/

function generic_ping( $post_id = 0 ) {

$services = get_option(‘ping_sites’);

$services = explode(“

“, $services);

foreach ( (array) $services as $service ) {

$service = trim($service);

if ( ” != $service )

weblog_ping($service);

}

return $post_id;

}
0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索