Skip to content

Instantly share code, notes, and snippets.

@fahidjavid
Created June 14, 2017 09:07
Show Gist options
  • Select an option

  • Save fahidjavid/cb423a2cf2fa9bd6fe9c0ff3136503a6 to your computer and use it in GitHub Desktop.

Select an option

Save fahidjavid/cb423a2cf2fa9bd6fe9c0ff3136503a6 to your computer and use it in GitHub Desktop.
Add a pingback url auto-discovery header for singularly identifiable articles.
<?php
if ( ! function_exists( 'prefix_pingback_header' ) ) {
/**
* Add a pingback url auto-discovery header for singularly identifiable articles.
*/
function prefix_pingback_header() {
if ( is_singular() && pings_open() ) {
printf( '<link rel="pingback" href="%s">' . "\n", get_bloginfo( 'pingback_url' ) );
}
}
add_action( 'wp_head', 'prefix_pingback_header' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment