Ticket #56840: 56840.2.diff
File 56840.2.diff, 1.2 KB (added by , 23 months ago) |
---|
-
src/wp-includes/class-wp.php
410 410 * @since 2.0.0 411 411 * @since 4.4.0 `X-Pingback` header is added conditionally for single posts that allow pings. 412 412 * @since 6.1.0 Runs after posts have been queried. 413 * 414 * @global WP_Query $wp_query WordPress Query object. 413 415 */ 414 416 public function send_headers() { 417 global $wp_query; 418 415 419 $headers = array(); 416 420 $status = null; 417 421 $exit_required = false; -
tests/phpunit/tests/wp/sendHeaders.php
19 19 20 20 $this->go_to( home_url() ); 21 21 } 22 23 /** 24 * @ticket 56840 25 */ 26 public function test_send_headers_sets_x_pingback_for_single_posts_that_allow_pings() { 27 add_action( 28 'wp_headers', 29 function ( $headers ) { 30 $this->assertArrayHasKey( 'X-Pingback', $headers ); 31 } 32 ); 33 34 $post_id = self::factory()->post->create(); 35 $this->go_to( get_permalink( $post_id ) ); 36 } 22 37 }