Make WordPress Core

Ticket #20226: 20226.diff

File 20226.diff, 826 bytes (added by wonderboymusic, 9 years ago)
  • src/wp-includes/class-wp.php

     
    365365         * @since 2.0.0
    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;
    371371
     
    595595
    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;
    600609                }