PluginProbe
ERP: Complete HR, Accounting & CRM Suite Built for WooCommerce / 1.2.6
ERP: Complete HR, Accounting & CRM Suite Built for WooCommerce v1.2.6
1.17.9 1.17.8 1.17.7 1.17.6 1.17.5 1.17.4 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.3.0 1.3.1 1.3.11 1.3.12 1.3.13 1.3.14 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 All 143 releases
erp / includes / framework / traits / Hooker.php

Hooker.php in ERP: Complete HR, Accounting & CRM Suite Built for WooCommerce 1.2.6, at includes/framework/traits/Hooker.php

33 lines 833 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php namespace WeDevs\ERP\Framework\Traits;
2
3 /**
4 * Class Hooker
5 *
6 * @package WeDevs\ERP\Framework\Traits
7 */
8 trait Hooker {
9
10 /**
11 * Hooks a function on to a specific action.
12 *
13 * @param $tag
14 * @param $function
15 * @param int $priority
16 * @param int $accepted_args
17 */
18 public function action( $tag, $function, $priority = 10, $accepted_args = 1 ) {
19 add_action( $tag, [ $this, $function ], $priority, $accepted_args );
20 }
21
22 /**
23 * Hooks a function on to a specific filter.
24 *
25 * @param $tag
26 * @param $function
27 * @param int $priority
28 * @param int $accepted_args
29 */
30 public function filter( $tag, $function, $priority = 10, $accepted_args = 1 ) {
31 add_filter( $tag, [ $this, $function ], $priority, $accepted_args );
32 }
33 }