Changeset 54250
- Timestamp:
- 09/20/2022 01:10:24 PM (8 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp.php
r54133 r54250 409 409 * 410 410 * @since 2.0.0 411 * @since 4.4.0 `X-Pingback` header is added conditionally after posts have been queried in handle_404(). 411 * @since 4.4.0 `X-Pingback` header is added conditionally for single posts that allow pings. 412 * @since 6.1.0 Runs after posts have been queried. 412 413 */ 413 414 public function send_headers() { … … 505 506 } 506 507 508 if ( is_singular() ) { 509 $post = isset( $wp_query->post ) ? $wp_query->post : null; 510 511 // Only set X-Pingback for single posts that allow pings. 512 if ( $post && pings_open( $post ) ) { 513 $headers['X-Pingback'] = get_bloginfo( 'pingback_url', 'display' ); 514 } 515 } 516 507 517 /** 508 518 * Filters the HTTP headers before they're sent to the browser. … … 702 712 if ( is_singular() ) { 703 713 $post = isset( $wp_query->post ) ? $wp_query->post : null; 704 705 // Only set X-Pingback for single posts that allow pings. 706 if ( $post && pings_open( $post ) && ! headers_sent() ) { 707 header( 'X-Pingback: ' . get_bloginfo( 'pingback_url', 'display' ) ); 708 } 714 $next = '<!--nextpage-->'; 709 715 710 716 // Check for paged content that exceeds the max number of pages. 711 $next = '<!--nextpage-->';712 717 if ( $post && ! empty( $this->query_vars['page'] ) ) { 713 718 // Check if content is actually intended to be paged. … … 771 776 $parsed = $this->parse_request( $query_args ); 772 777 773 $this->send_headers();774 775 778 if ( $parsed ) { 776 779 $this->query_posts(); … … 779 782 } 780 783 784 $this->send_headers(); 785 781 786 /** 782 787 * Fires once the WordPress environment has been set up.
Note: See TracChangeset
for help on using the changeset viewer.