pre_ping
pre_ping is a filter run during the pingback() function. It passes an array of references... the first to the array of links in the post, and the second to the array of already pinged URIs. Contrary to what the code says, it is a filter... it acts on references to the original $post_links and $pung variables.
For WordPress 2.0
Due to the bizarre placement of the hook, anything that uses it will be run multiple times, with the post link array growing bigger each time as additional link are added. You might want to hold off from using this hook, as its behavior might change later on.
For WordPress 2.0.1
This plugin's behavior has been fixed, and the new context is as follows.
Context:
File: wp-includes/comment-functions.php
foreach($post_links_temp[0] as $link_test) :
if ( !in_array($link_test, $pung) && (url_to_postid($link_test) != $post_ID) // If we haven't pung it already and it isn't a link to itself
&& !is_local_attachment($link_test) ) : // Also, let's never ping local attachments.
$test = parse_url($link_test);
if (isset($test['query']))
$post_links[] = $link_test;
elseif(($test['path'] != '/') && ($test['path'] != ''))
$post_links[] = $link_test;
endif;
endforeach;
do_action('pre_ping', array(&$post_links, &$pung));
This hook can pass multiple parameters. In order to get additional parameters (up to 2 for this hook) passed to your function, you will have to hook in like this: add_filter('pre_ping', 'your_function', 10, 2); where 10 is your function's priority, and 2 is the number of parameters you want your function to accept. Note that your function should only return the first parameter.
This hook is a filter which means that information is passed through it, and then used by WordPress. Your function needs to accept that information, and return it. Using add_filter('pre_ping', 'your_function'); helps you to remember this distinction. When you are passing an ID, it is assumed that you will return the ID as it was given to you. With filters that pass strings or arrays, you may manipulate the information before passing it along.
This hook was introduced in WordPress 2.0, and will not work in earlier versions.