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.
WordCamp Asia 2026 brought the global WordPress community to Mumbai, India, from April 9–11, gathering…
WordCamp Asia 2026 will be available to watch live across three days of streaming, making…
April 9-11, 2026 | Jio World Convention Centre, Mumbai, India WordCamp Asia 2026 brings the…
The second Release Candidate (“RC2”) for WordPress 7.0 is ready for download and testing! This…
When WP Engine acquired WPackagist on March 12, the WordPress developer community faced a familiar…
The first Release Candidate (“RC1”) for WordPress 7.0 is ready for download and testing! This…