1. Go to this page and download the library: Download arnaud-ritti/wp-hook 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/ */
arnaud-ritti / wp-hook example snippets
namespace My\CoolNamespace;
use Ari\WpHook\HookRegistry;
use Ari\WpHook\Models\Action;
class MyClass
{
public function __construct(HookRegistry $hookRegistry)
{
$hookRegistry->bootstrap($this);
}
/**
* @Action(tag="init")
*/
#[Action(tag: "init")]
public function doSomething()
{
// do something
}
}