mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
Bootstrap/Load: Correct sending the X-Pingback header in WP::send_headers().
The logic for sending the `X-Pingback` header for single posts that allow pings was recently moved from `WP::handle_404()` to a more appropriate place in `WP::send_headers()`. To check whether pings are open for a particular post, that logic relies on the `$wp_query` global, which is declared in `WP::handle_404()`, but not in `WP::send_headers()` This commit ensures that `$wp_query` is globalized in `WP::send_headers()` too, so that the check works as expected. Follow-up to [54250]. Props strategio, sabernhardt, dlh, davidbaumwald, SergeyBiryukov. Fixes #56840. git-svn-id: https://develop.svn.wordpress.org/trunk@54636 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -410,8 +410,12 @@ class WP {
|
||||
* @since 2.0.0
|
||||
* @since 4.4.0 `X-Pingback` header is added conditionally for single posts that allow pings.
|
||||
* @since 6.1.0 Runs after posts have been queried.
|
||||
*
|
||||
* @global WP_Query $wp_query WordPress Query object.
|
||||
*/
|
||||
public function send_headers() {
|
||||
global $wp_query;
|
||||
|
||||
$headers = array();
|
||||
$status = null;
|
||||
$exit_required = false;
|
||||
|
||||
Reference in New Issue
Block a user