Skip to content

Instantly share code, notes, and snippets.

@dgaitan
Created July 10, 2022 19:11
Show Gist options
  • Save dgaitan/6fb9d11719c0f199c298504be0eac96c to your computer and use it in GitHub Desktop.
Save dgaitan/6fb9d11719c0f199c298504be0eac96c to your computer and use it in GitHub Desktop.
WordPress Hooks
<?php
/**
* An action hook recives four params.
*
* @param string $hook_name - The name of the hook
* @param callable $callback - The callback where we are going to add our logic.
* @param int $priority - The priority of the hook. Used to specify the order in which the functions associated with a particular action are executed.
* @param int $params - The number of arguments the function accepts
*/
add_action( 'action_hook_name', 'callback_name', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment