Make WordPress Core

Changeset 34442


Ignore:
Timestamp:
09/22/2015 06:46:43 PM (9 years ago)
Author:
wonderboymusic
Message:

PINGBACKS: rather than sending the X-Pingback HTTP header on every single request for fun, perhaps only send it on single posts with pings open.

See #20226.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp.php

    r34247 r34442  
    366366     */
    367367    public function send_headers() {
    368         $headers = array('X-Pingback' => get_bloginfo('pingback_url'));
     368        $headers = array();
    369369        $status = null;
    370370        $exit_required = false;
     
    596596        // Never 404 for the admin, robots, or if we found posts.
    597597        if ( is_admin() || is_robots() || $wp_query->posts ) {
     598
     599            // Only set X-Pingback for single posts.
     600            if ( is_single() ) {
     601                $p = get_queried_object();
     602                if ( $p && pings_open( $p ) ) {
     603                    @header( 'X-Pingback: ' . get_bloginfo( 'pingback_url' ) );
     604                }
     605            }
     606
    598607            status_header( 200 );
    599608            return;
Note: See TracChangeset for help on using the changeset viewer.