mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-30 16:17:56 +02:00
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. Built from https://develop.svn.wordpress.org/trunk@34442 git-svn-id: http://core.svn.wordpress.org/trunk@34406 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
32358bbcdd
commit
3bbd53c717
@ -365,7 +365,7 @@ class WP {
|
|||||||
* @since 2.0.0
|
* @since 2.0.0
|
||||||
*/
|
*/
|
||||||
public function send_headers() {
|
public function send_headers() {
|
||||||
$headers = array('X-Pingback' => get_bloginfo('pingback_url'));
|
$headers = array();
|
||||||
$status = null;
|
$status = null;
|
||||||
$exit_required = false;
|
$exit_required = false;
|
||||||
|
|
||||||
@ -595,6 +595,15 @@ class WP {
|
|||||||
|
|
||||||
// Never 404 for the admin, robots, or if we found posts.
|
// Never 404 for the admin, robots, or if we found posts.
|
||||||
if ( is_admin() || is_robots() || $wp_query->posts ) {
|
if ( is_admin() || is_robots() || $wp_query->posts ) {
|
||||||
|
|
||||||
|
// Only set X-Pingback for single posts.
|
||||||
|
if ( is_single() ) {
|
||||||
|
$p = get_queried_object();
|
||||||
|
if ( $p && pings_open( $p ) ) {
|
||||||
|
@header( 'X-Pingback: ' . get_bloginfo( 'pingback_url' ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
status_header( 200 );
|
status_header( 200 );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.4-alpha-34441';
|
$wp_version = '4.4-alpha-34442';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user