Skip to content

Commit

Permalink
show header only on single pages and if pings are open
Browse files Browse the repository at this point in the history
  • Loading branch information
pfefferle committed Nov 30, 2016
1 parent d88dec1 commit e0223f6
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions includes/class-webmention-receiver.php
Expand Up @@ -461,18 +461,22 @@ public static function publish_post_hook( $post_id ) {
* The Webmention autodicovery meta-tags
*/
public static function html_header() {
// backwards compatibility with v0.1
printf( '<link rel="http://webmention.org/" href="%s" />', get_webmention_endpoint() ) . PHP_EOL;
printf( '<link rel="webmention" href="%s" />', get_webmention_endpoint() ) . PHP_EOL;
if ( is_singular() && pings_open() ) {
// backwards compatibility with v0.1
printf( '<link rel="http://webmention.org/" href="%s" />' . PHP_EOL, get_webmention_endpoint() );
printf( '<link rel="webmention" href="%s" />' . PHP_EOL, get_webmention_endpoint() );
}
}

/**
* The Webmention autodicovery http-header
*/
public static function http_header() {
// backwards compatibility with v0.1
header( sprintf( 'Link: <%s>; rel="http://webmention.org/"', get_webmention_endpoint() ), false );
header( sprintf( 'Link: <%s>; rel="webmention"', get_webmention_endpoint() ), false );
if ( is_singular() && pings_open() ) {
// backwards compatibility with v0.1
header( sprintf( 'Link: <%s>; rel="http://webmention.org/"', get_webmention_endpoint() ), false );
header( sprintf( 'Link: <%s>; rel="webmention"', get_webmention_endpoint() ), false );
}
}

/**
Expand Down

0 comments on commit e0223f6

Please sign in to comment.