[wp-hackers] Filtering pingbacks and trackbacks

Kimmo Suominen kimmo+key+wordpress.c4f53f at suominen.com
Thu Aug 3 06:14:20 GMT 2006

On Wed, Aug 02, 2006 at 10:43:30PM +0100, Peter Westwood wrote:
> Kimmo Suominen wrote:
> > Hi!
> > 
> > It looks like there are no filters for the contents of the outgoing
> > pingbacks and trackbacks.  Have I just not looked in the right place?
> There are no filters for trackbacks apart from the default content and
> excerpt ones which won't really help.
> > I'd like to be able to convert the contents of outgoing pingbacks and
> > trackbacks to UTF-8 using iconv().
> You can't do this for pingbacks.

I should've read the code more carefully -- I must admit I was surprised
when I came to the (wrong) conclusion that the whole post content is
sent out in the ping...  :)

So basically the "fix" is to teach function pingback.ping in xmlrp.php
to look at the charset of the content it is retrieving, and converting
it when necessary.  Then wait 10 years for everyone else to adopt that
in their software...

I guess the best place is to add a filter in wp_remote_fopen() so I can
have access to $http_response_header and use curl options to build a
similar array.

And I see that receiving trackbacks already does the right thing using
mb_convert_encoding(), so I can just follow that example (as opposed to
using iconv() as I had planned).

Best regards,
+ Kimmo
<A HREF="http://kimmo.suominen.com/">Kimmo Suominen</A>

More information about the wp-hackers mailing list