1 | <?php |
||
13 | abstract class CMB2_Hookup_Base { |
||
|
|||
14 | |||
15 | /** |
||
16 | * @var CMB2 object |
||
17 | * @since 2.0.2 |
||
18 | */ |
||
19 | protected $cmb; |
||
20 | |||
21 | /** |
||
22 | * The object type we are performing the hookup for |
||
23 | * |
||
24 | * @var string |
||
25 | * @since 2.0.9 |
||
26 | */ |
||
27 | protected $object_type = 'post'; |
||
28 | |||
29 | /** |
||
30 | * Constructor |
||
31 | * |
||
32 | * @since 2.0.0 |
||
33 | * @param CMB2 $cmb The CMB2 object to hookup |
||
34 | */ |
||
35 | public function __construct( CMB2 $cmb ) { |
||
36 | $this->cmb = $cmb; |
||
37 | $this->object_type = $this->cmb->mb_object_type(); |
||
38 | } |
||
39 | |||
40 | abstract public function universal_hooks(); |
||
41 | |||
42 | /** |
||
43 | * Ensures WordPress hook only gets fired once per object. |
||
44 | * |
||
45 | * @since 2.0.0 |
||
46 | * @param string $action The name of the filter to hook the $hook callback to. |
||
47 | * @param callback $hook The callback to be run when the filter is applied. |
||
48 | * @param integer $priority Order the functions are executed |
||
49 | * @param int $accepted_args The number of arguments the function accepts. |
||
50 | */ |
||
51 | public function once( $action, $hook, $priority = 10, $accepted_args = 1 ) { |
||
70 | |||
71 | } |
||
72 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.