As of WordPress 6.1, the send_headers hook has been moved to slightly later in the WordPress loading routine (ticket). Historically, all the is_ functions (like is_singular) wouldn’t work when you were determining which headers to send. With this change, moving `send_headers` to after WordPress parses the query, those functions now work properly.
People can now have more control over things like:
rel=preload headersCurrently, these types of scenarios are often filtered in late actions like template_redirect; which is semantically confusing, and inefficient.
There’s a good example of code that becomes easier with this. In fact, it has already been changed in this ticket: the X-Pingback HTTP header only needs to be sent for posts, and can now be sent at the right time (commit).
Let’s see what it means in terms of load order:
This should not affect any of your existing code negatively unless you were using send_headers to do things that really should have been happening on wp_loaded or parse_request. So please check your code for that! If you were doing that, just changing to an earlier hook should fix your problem.
For new code, you can now happily use all the is_ functions.
Props to @jonoaldersonwp, @sergeybiryukov, @aristath, @milana_cap for reviewing this post.
Mercantile, the official swag store of the WordPress project, has a newly redesigned storefront with…
Applications are now open for the 2026 Kim Parsell Memorial Scholarship, which supports one active…
This post recaps how the WordPress project’s five Global Partners — Jetpack, WordPress.com, WooCommerce, Bluehost,…
The full chat log is available beginning here on Slack. WordPress Performance Trac tickets @westonruter…
WordCamp Europe, the biggest WordPress conference in Europe, spent the first week of June in…
tl;dr: Temporary 24-hour cooldown period for plugin/theme releases before auto-updates. AI can give defenders an…