Adding some hooks, fixes #1489
git-svn-id: http://svn.automattic.com/wordpress/trunk@2743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0e15d15f9b
commit
5ebbcc659b
|
@ -447,6 +447,7 @@ function pingback($content, $post_ID) {
|
||||||
$post_links[] = $link_test;
|
$post_links[] = $link_test;
|
||||||
elseif(($test['path'] != '/') && ($test['path'] != ''))
|
elseif(($test['path'] != '/') && ($test['path'] != ''))
|
||||||
$post_links[] = $link_test;
|
$post_links[] = $link_test;
|
||||||
|
do_action('pre_ping', &$post_links, &$pung);
|
||||||
endif;
|
endif;
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
|
|
|
@ -581,6 +581,7 @@ function get_pung($post_id) { // Get URIs already pung for a post
|
||||||
$pung = $wpdb->get_var("SELECT pinged FROM $wpdb->posts WHERE ID = $post_id");
|
$pung = $wpdb->get_var("SELECT pinged FROM $wpdb->posts WHERE ID = $post_id");
|
||||||
$pung = trim($pung);
|
$pung = trim($pung);
|
||||||
$pung = preg_split('/\s/', $pung);
|
$pung = preg_split('/\s/', $pung);
|
||||||
|
$pung = apply_filters('get_pung', $pung);
|
||||||
return $pung;
|
return $pung;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -588,18 +589,18 @@ function get_enclosed($post_id) { // Get enclosures already enclosed for a post
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
$custom_fields = get_post_custom( $post_id );
|
$custom_fields = get_post_custom( $post_id );
|
||||||
$pung = array();
|
$pung = array();
|
||||||
if( is_array( $custom_fields ) ) {
|
if ( !is_array( $custom_fields ) )
|
||||||
while( list( $key, $val ) = each( $custom_fields ) ) {
|
return $pung;
|
||||||
if( $key == 'enclosure' ) {
|
|
||||||
if (is_array($val)) {
|
foreach ( $custom_fields as $key => $val ) {
|
||||||
foreach($val as $enc) {
|
if ( 'enclosure' != $key || !is_array( $val ) )
|
||||||
|
continue;
|
||||||
|
foreach( $val as $enc ) {
|
||||||
$enclosure = split( "\n", $enc );
|
$enclosure = split( "\n", $enc );
|
||||||
$pung[] = trim( $enclosure[ 0 ] );
|
$pung[] = trim( $enclosure[ 0 ] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
$pung = apply_filters('get_enclosed', $pung);
|
||||||
}
|
|
||||||
}
|
|
||||||
return $pung;
|
return $pung;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -608,6 +609,7 @@ function get_to_ping($post_id) { // Get any URIs in the todo list
|
||||||
$to_ping = $wpdb->get_var("SELECT to_ping FROM $wpdb->posts WHERE ID = $post_id");
|
$to_ping = $wpdb->get_var("SELECT to_ping FROM $wpdb->posts WHERE ID = $post_id");
|
||||||
$to_ping = trim($to_ping);
|
$to_ping = trim($to_ping);
|
||||||
$to_ping = preg_split('/\s/', $to_ping, -1, PREG_SPLIT_NO_EMPTY);
|
$to_ping = preg_split('/\s/', $to_ping, -1, PREG_SPLIT_NO_EMPTY);
|
||||||
|
$to_ping = apply_filters('get_to_ping', $to_ping);
|
||||||
return $to_ping;
|
return $to_ping;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -618,6 +620,7 @@ function add_ping($post_id, $uri) { // Add a URI to those already pung
|
||||||
$pung = preg_split('/\s/', $pung);
|
$pung = preg_split('/\s/', $pung);
|
||||||
$pung[] = $uri;
|
$pung[] = $uri;
|
||||||
$new = implode("\n", $pung);
|
$new = implode("\n", $pung);
|
||||||
|
$new = apply_filters('add_ping', $new);
|
||||||
return $wpdb->query("UPDATE $wpdb->posts SET pinged = '$new' WHERE ID = $post_id");
|
return $wpdb->query("UPDATE $wpdb->posts SET pinged = '$new' WHERE ID = $post_id");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue