[wp-hackers] Collecting Pings sent to Front Page

Mark Jaquith mark.wordpress at txfx.net
Mon Mar 14 19:21:48 GMT 2005


Scott Merrill wrote:

>pingback_post _would_ the hook to leverage to do this in a plugin.
>pingback_post is given the comment ID; but it gets called _after_ the
>comment is added to the database.
>
>preprocess_comment is probably where a plugin should get involved to
>solve this problem.  It's a filter that gets executed first thing in the
>wp_new_comment() function, and is passed the entire comment data array.
>
Scott, I don't think it would get that far without a valid post ID.  It 
doesn't get to wp_new_comment() unless there is a valid post ID, the 
pingback hasn't already been registered for that post ID, etc.

> 1141          $sql = 'SELECT post_author FROM '.$wpdb->posts.' WHERE 
> ID = '.$post_ID;
> 1142          $result = $wpdb->get_results($sql);
> 1143  
> 1144          if (!$wpdb->num_rows) {
> 1145              // Post_ID not found
> 1146                return new IXR_Error(33, 'The specified target URI 
> cannot be used as a target. It either doesn\'t exist, or it is not a 
> pingback-enabled resource.');
> 1147          }




More information about the wp-hackers mailing list