wp_head WordPress Action Hook

The wp_head hook is a hook that is called when the section of a WordPress document is being generated. This hook can be used to add custom code to the section, such as CSS or JavaScript.

do_action( 'wp_head' ) #

Prints scripts or data in the head tag on the front end.


More Information

The wp_head action hook is triggered within the <head></head> section of the theme’s header.php template by the wp_head() function.

Although this is theme-dependent, it is one of the most essential theme hooks, so it is widely supported. See the Plugin API Hooks page on the Theme handbook for more information.

WordPress core uses this hook to perform many actions. Most of default actions into the 'wp-head' hook by WordPress core are set up in wp-includes/default-filters.php. If you need to remove a default hook, this file will give you the priority for which to use to remove the hook.


Top ↑

Source

File: wp-includes/general-template.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
1.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by the Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More