Without boring you with the details of “why” to keep a long story short, I need to change the domain that my site uses when it sends pings. I went and searched the WP source for where this gets set, and I see the domain is set in weblog_ping() in wp-includes/comment.php. Unfortunately this has no filters or actions, so no dice. It does use home_url() which ultimately has a filter, but I only want to filter it when it’s being called for use in a ping. Anyone have any thoughts on how I might accomplish that?
… And as I was about to hit post, I had an idea of how I might do this. I’ll post it as an answer, but I’d still love to hear what others have to suggest.
Thanks!
Here’s what I came up with to accomplish this. I’m not naive enough to think this is the best way, but it works. Again, still interested to know if others have any better ideas. Ultimately, the reason why I needed to do this was because I use the domain mapping plugin, and I have it set to redirect admin requests to the original domain (the multisite subdomain). Now WordPress pings with the mapped domain and not e.g. child.parent.com