Created
June 14, 2017 09:07
-
-
Save fahidjavid/cb423a2cf2fa9bd6fe9c0ff3136503a6 to your computer and use it in GitHub Desktop.
Add a pingback url auto-discovery header for singularly identifiable articles.
This file contains hidden or 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 | |
| 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