WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Action Reference/send headers

This page is marked as incomplete. You can help Codex by expanding it.

Description

This action hook is used to add additional headers to the outgoing HTTP response.

Example

As an example: HTML5 Boilerplate provides an X-UA-Compatible meta element by default. This element breaks validation, but can be moved to a header. Adding the following to functions.php fixes the validation issue and provides IE users a better experience.

add_action( 'send_headers', 'add_header_xua' );
function add_header_xua() {
	header( 'X-UA-Compatible: IE=edge,chrome=1' );
}

Source File

The 'send_headers' hook is found in /wp-includes/class-wp.php, within the send_headers() method of the WP() class.