WordPress函数文档do_all_pings()
调用do_all_pings的hook钩子 描述 译文 该函数执行所有pingback、enclosure、t…
调用do_all_pings的hook钩子
描述
译文
该函数执行所有pingback、enclosure、trackback,并将其发送到pingback服务中。
原文
Perform all pingbacks, enclosures, trackbacks, and send to pingback services.
用法
<?php do_all_pings() ?>
返回值
(void)
This function does not return a value.
注意
- See Reads from the _posts table from the database.
- 使用到: $wpdb
- 使用到: pingback()
- 使用到: do_enclose()
- 使用到: do_trackbacks()
- 使用到: generic_ping()
- 使用到 global: (object) $wpdb
历史
添加于 版本: 2.1.0
源文件
do_all_pings() 函数的代码位于 wp-includes/comment.php
.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
/* ———————————-
* wordpress函数 kim收集
* ———————————- */
/**
* Perform all pingbacks, enclosures, trackbacks, and send to pingback services.
*
* @since 2.1.0
*
* @global wpdb $wpdb WordPress database abstraction object.
*/
function do_all_pings() {
global $wpdb;
// Do pingbacks
while ($ping = $wpdb->get_row(“SELECT ID, post_content, meta_id FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = ‘_pingme’ LIMIT 1”)) {
delete_metadata_by_mid( ‘post’, $ping->meta_id );
pingback( $ping->post_content, $ping->ID );
}
// Do Enclosures
while ($enclosure = $wpdb->get_row(“SELECT ID, post_content, meta_id FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = ‘_encloseme’ LIMIT 1”)) {
delete_metadata_by_mid( ‘post’, $enclosure->meta_id );
do_enclose( $enclosure->post_content, $enclosure->ID );
}
// Do Trackbacks
$trackbacks = $wpdb->get_col(“SELECT ID FROM $wpdb->posts WHERE to_ping <> ” AND post_status = ‘publish’”);
if ( is_array($trackbacks) )
foreach ( $trackbacks as $trackback )
do_trackbacks($trackback);
//Do Update Services/Generic Pings
generic_ping();
}
|
- 原文:http://codex.wordpress.org/Function_Reference/do_all_pings
类别:WordPress函数文档、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。
评论功能已经关闭!