> For the complete documentation index, see [llms.txt](https://docs.cwicly.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cwicly.com/blocks/hook.md).

# Hook

<figure><img src="/files/ZJv8JW0GBRDs1FYjVo9I" alt=""><figcaption></figcaption></figure>

The `hook` block is a function that allows you to include a WordPress Action to change what WordPress is doing by default.

It currently accepts one parameter: the Hook name.

You can add show/hide conditions to your Hook from the Primary tab as required.

![](https://lh5.googleusercontent.com/DrelAsB-Tl31SxUmpwUsyVEZ5W5pXGtX2mgkcumiwObkMRcfSJx_AVwZTweDnyz7b1VtyxnzScCH9BmeAj0u62NLTdKAVxpxTf5CmxnNADv-46ocdbXvkKi0LNepffmDAEK6pPoP-mE39LNFEqXprj-V5tWzwx6y_2dUFEji25J3z3lmA5SaSZDCdzLr3Q)![](https://lh6.googleusercontent.com/dzCb6QqTgWSQvR9fQ8Lg42o-aTGNpRt1r5naz91HAVHh7inQ0xbIIqxtgEO1CxeGRU5M9eu3KPoZG8p8HxD7ZlaOLInAPLfHMd5RqNIr4cs_Xi53MBWlOgbtEKyaD7Kd1Td7gDOl_dbqja-SJMx903nxGEnlCGqD5dHx6jv3GfDO6e1wfoGqn6hcFKbDBQ)

## Add

The easiest way to add a Heading is through the Cwicly [Quick Inserter](/cwicly/quick-inserter.md).

* Enable the [Quick Inserter](/cwicly/quick-inserter.md).
* Find the Quick Inserter to the left of the editor and search for Hook.
* Click to add to the page.

<figure><img src="/files/tVI5ju7ShJ7vuA4kPxlR" alt=""><figcaption></figcaption></figure>

You can call actions created by WordPress or third-party plugins by simply entering the hook's name in the appropriate field.

* With the Hook block selected, open the Primary tab.
* Input Hook name.

<figure><img src="/files/eT3WZL7MDIPwx2rVQuuG" alt=""><figcaption></figcaption></figure>

Or, you can create your own action through your theme's functions.php file or a code snippet plugin.

{% code title="functions.php" %}

```php
// Your function and custom name
function cwicly_custom_action()
{
    echo 'This is simply echoing simple text...';
}

// This is the action that outputs the function above into the Cwicly Hook block.
// The first parameter is the name of the action, which you will use in the Cwicly hook
// The second parameter is the name of the callback function (which is run wherever the block is placed)
// The third parameter specifies the order/priority in which the functions associated with a particular action are executed.
add_action('cwicly_hook_action', 'cwicly_custom_action', 999);
```

{% endcode %}
