3

I'd like to make good use of the ole pingback on a multi-author site, but with some alterations and concerns.

  1. They should be only available internally, no external pingbacks accepted. If I understand right, disabling them in the general options while leaving them open on each post should do it - is this correct?

  2. I want to alter their format. Right now the reffering page title becomes the author which is not cool. I'd rather have the actual post author as author and the_title() / <h1> as headline (new field), with the snippet staying in place as content. I didn't find much about this, is there a documented API (non-obsolete) or some hook/filter that could accomplish it?

Note: I suppose that something should rather happen on the sending end, like passing the post id for later use. I have an idea on how to do it but it involes adding the post id on the visible content (like url) and I'm reluctant to do that.

  1. Is the pingback functionality going to be supported long-term in Wordpress or is it likely to be deprecated. In case it's going anywhere, is it likely to have a sort of legacy enabling like the 'links' do, or will my pingbacks end up in limbo?

  2. Webmentions a better idea or a dead/er end?

1

Actually, it turned out quite easy, as the post can be retrieved from the slug:

// get the url of the reffering post
$ping_slug = $comment->comment_author_url;
// keep just the slug
$ping_slug = trim(parse_url($ping_slug, PHP_URL_PATH), '/');
// get the post from the slug
$ping_post = get_page_by_path($ping_slug, OBJECT, 'post');
// find the post author data
$ping_author = get_userdata($ping_post->post_author);
// display the author name
echo $ping_author->display_name;
// so on, so forth
  • Glad you found a solution, may you elaborate on why you want to have pingbacks only work internally? I'm curious to know what you are using this for since I disable the functionality altogether. – Ethan Jinks O'Sullivan Aug 29 '16 at 21:28
  • Basically, I think it's quite useful for readers to see whatever links to a post, and them being internal is like a 'related posts ' functionality of sorts. External pingbacks come with lots of downsides though: 1. readers leave the site. 2. they are mostly litter and need intensive curation. 3. the format is unintuitive. Internal ones don't have problems #1 and #2 and now #3 is figured out as well. – Lucian Davidescu Aug 29 '16 at 21:51
  • I see, interesting use for internal pingbacks. – Ethan Jinks O'Sullivan Aug 29 '16 at 23:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.