forked from mirror/_s
Merge pull request #853 from jrfnl/feature/conditional-pingback-header
Only generate pingback url header tag when relevant.
This commit is contained in:
commit
ff4b374d6b
|
@ -15,7 +15,6 @@
|
|||
<meta charset="<?php bloginfo( 'charset' ); ?>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="profile" href="http://gmpg.org/xfn/11">
|
||||
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
|
||||
|
||||
<?php wp_head(); ?>
|
||||
</head>
|
||||
|
|
|
@ -27,3 +27,13 @@ function _s_body_classes( $classes ) {
|
|||
return $classes;
|
||||
}
|
||||
add_filter( 'body_class', '_s_body_classes' );
|
||||
|
||||
/**
|
||||
* Add a pingback url auto-discovery header for singularly identifiable articles.
|
||||
*/
|
||||
function _s_pingback_header() {
|
||||
if ( is_singular() && pings_open() ) {
|
||||
echo '<link rel="pingback" href="', bloginfo( 'pingback_url' ), '">';
|
||||
}
|
||||
}
|
||||
add_action( 'wp_head', '_s_pingback_header' );
|
||||
|
|
Reference in New Issue