Precisely -what- data is sent to/from a wordpress blog when you enable trackbacks and pingbacks? Can I capture this data?
The Introduction To Blogging post on WordPress states that more data is being sent besides the URL, but precisely -what-… and how can I control it? ie. is the post excerpt being sent? Are the comments from the linking blog being received (and if so, how do I capture them?)
That blog post says that one uses HTTP and the other XML-RPC so I wonder if there is a single mechanism for capturing both types of data.
For pingbacks, it seems only the linked page/post and the page/post it linked
from are sent. Check out the
pingback() function, specifically this line:
$client->query( 'pingback.ping', $pagelinkedfrom, $pagelinkedto );
$client is an instance of
query method uses
IXR_Request to package up a simple XML document:
<?xml version="1.0"?> <methodCall> <methodName>pingback.ping</methodName> <params> <param> <value> <string>[pagelinkedfrom]</string> </value> </param> <param> <value> <string>[pagelinkedto]</string> </value> </param> </params> </methodCall>
… which is then sent to the pingback server URL (passed in when
$client is instantiated).
Trackbacks, little more straightforward, and with a bit more data – see
$options['body'] = array( 'title' => $title, 'url' => get_permalink($ID), 'blog_name' => get_option('blogname'), 'excerpt' => $excerpt ); // WP_Http will automatically convert body to a HTTP query string $response = wp_safe_remote_post( $trackback_url, $options );
As for handling/intercepting the responses, check out the source of
wp-includes/class-wp-xmlrpc-server.php for pings, and the file
wp-trackback.php for trackbacks.
You’ll quickly see what actions/filters you have available, and how much you can interact with (& alter) the responses.