Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/agence-adeliom/lumberjack-hooks

[READ-ONLY] Register WordPress hooks, filters and shortcodes with PHP Attributes into Lumberjack
https://github.com/agence-adeliom/lumberjack-hooks

hooks lumberjack php-attributes timber wordpress

Last synced: 24 days ago
JSON representation

[READ-ONLY] Register WordPress hooks, filters and shortcodes with PHP Attributes into Lumberjack

Awesome Lists containing this project

README

        

# [READ-ONLY] Lumberjack Hooks

Register WordPress hooks, filters and shortcodes with PHP Attributes

## Requirements

* PHP 8.0 or greater
* Composer
* Lumberjack

## Installation

```bash
composer require agence-adeliom/lumberjack-hooks

# Copy the configuration file
cp vendor/agence-adeliom/lumberjack-hooks/config/hooks.php web/app/themes/YOUR_THEME/config/hooks.php
```

#### Register the service provider into web/app/themes/YOUR_THEME/config/app.php

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

## Usage

Create your hook class :

```php
[
...
App\Hooks\MyClass::class
],
];
```

And you're done!

# API

```php
#[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)]
```

## License
Lumberjack Hooks is released under [the MIT License](LICENSE).