PHP code example of agence-adeliom / lumberjack-hooks

1. Go to this page and download the library: Download agence-adeliom/lumberjack-hooks library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

agence-adeliom / lumberjack-hooks example snippets


'providers' => [
    ...
    \Adeliom\Lumberjack\Hooks\HookProvider::class
]



namespace App\Hooks;

use Adeliom\Lumberjack\Hooks\Models\Action;
use Adeliom\Lumberjack\Hooks\Models\Filter;

class MyClass
{

    #[Action(tag: "init")]
    public function doSomethingAtInit()
    {
        // do something
    }
    
    #[Filter(tag: "enter_title_here")]
    public function alterEnterTitleHere()
    {
        // do something
    }
}

return [
    'register' => [
        ...
        App\Hooks\MyClass::class
    ],
];

#[Action(tag: "the hook name", priority: 1, accepted_args: 1)]
#[Filter(tag: "the filter name", priority: 1, accepted_args: 1)]
#[Shortcode(tag: "the shortcode code", priority: 1, accepted_args: 1)]
bash
composer configuration file
cp vendor/agence-adeliom/lumberjack-hooks/config/hooks.php web/app/themes/YOUR_THEME/config/hooks.php