Hook::let()

Deletes hooks by its container name.

Table of Contents
  1. Description
  2. Example

Description

Hook::let(?array|string $name = null, ?callable $fn = null): void;

This method deletes all hooks that have been added into the specified container. If this method is executed before a particular hook is added to the container, then this method works to prevent that hook from being added to the container.

Example

Hook::let(); // Deletes all hooks
Hook::let('content'); // Deletes all `content` hooks
Hook::let('content', 'hook_1'); // Deletes `content` hook that contains a function named `hook_1` only
Hook::let(['content', 'type']); // Deletes all `content` and `type` hooks

Hook::is()

Checks the hook name that is being executed.

Hook::let()

Deletes hooks by its container name.