# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cwicly.com/blocks/hook.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
