Glossary H Hooks

Hooks

Hooks are an integral part of WordPress development that deliver different bits of PHP logic to different hook locations to change, add, or remove to the pre-existing functionality.

For example, the wp_head hook is located within your site’s <head> tag and makes adding custom meta HTML tags easy. Instead of editing the entire head template, you can use a hook to insert a meta tag from any PHP file. As an example:

function md_child_custom_meta() { ?>
    <meta>Meta tag</meta>
<?php }
add_action( 'wp_head', 'md_child_custom_meta' );