Ticket #56068: 56068.2.diff
File 56068.2.diff, 2.0 KB (added by , 2 years ago) |
---|
-
src/wp-includes/class-wp.php
407 407 * If showing a feed, it will also send Last-Modified, ETag, and 304 status if needed. 408 408 * 409 409 * @since 2.0.0 410 * @since 4.4.0 `X-Pingback` header is added conditionally after posts have been queried in handle_404(). 410 * @since 4.4.0 `X-Pingback` header is added conditionally for single posts that allow pings. 411 * @since 6.1.0 Runs after posts have been queried. 411 412 */ 412 413 public function send_headers() { 413 414 $headers = array(); … … 503 504 } 504 505 } 505 506 507 if ( is_singular() ) { 508 $post = isset( $wp_query->post ) ? $wp_query->post : null; 509 510 // Only set X-Pingback for single posts that allow pings. 511 if ( $post && pings_open( $post ) ) { 512 $headers['X-Pingback'] = get_bloginfo( 'pingback_url', 'display' ); 513 } 514 } 515 506 516 /** 507 517 * Filters the HTTP headers before they're sent to the browser. 508 518 * … … 700 710 701 711 if ( is_singular() ) { 702 712 $post = isset( $wp_query->post ) ? $wp_query->post : null; 713 $next = '<!--nextpage-->'; 703 714 704 // Only set X-Pingback for single posts that allow pings.705 if ( $post && pings_open( $post ) && ! headers_sent() ) {706 header( 'X-Pingback: ' . get_bloginfo( 'pingback_url', 'display' ) );707 }708 709 715 // Check for paged content that exceeds the max number of pages. 710 $next = '<!--nextpage-->';711 716 if ( $post && ! empty( $this->query_vars['page'] ) ) { 712 717 // Check if content is actually intended to be paged. 713 718 if ( false !== strpos( $post->post_content, $next ) ) { … … 769 774 770 775 $parsed = $this->parse_request( $query_args ); 771 776 772 $this->send_headers();773 774 777 if ( $parsed ) { 775 778 $this->query_posts(); 776 779 $this->handle_404(); … … 777 780 $this->register_globals(); 778 781 } 779 782 783 $this->send_headers(); 784 780 785 /** 781 786 * Fires once the WordPress environment has been set up. 782 787 *