Created
August 24, 2011 05:52
-
-
Save alexkingorg/1167389 to your computer and use it in GitHub Desktop.
Filter in a URL to the pingback stack in WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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