Skip to content

Instantly share code, notes, and snippets.

@alexkingorg
Created August 24, 2011 05:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexkingorg/1167389 to your computer and use it in GitHub Desktop.
Save alexkingorg/1167389 to your computer and use it in GitHub Desktop.
Filter in a URL to the pingback stack in WordPress
<?php
function pingback_format_link_url($post_links, $post_id) {
$url = get_post_meta($post_id, '_format_link_url', true);
if (!empty($url) && !in_array($url, $post_links)) {
$post_links[] = $url;
}
return $post_links;
}
add_filter('pre_ping_post_links', 'pingback_format_link_url', 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment