1 | <?php |
||
12 | class CMB2_Boxes { |
||
|
|||
13 | |||
14 | /** |
||
15 | * Array of all metabox objects. |
||
16 | * |
||
17 | * @since 2.0.0 |
||
18 | * @var array |
||
19 | */ |
||
20 | protected static $cmb2_instances = array(); |
||
21 | |||
22 | /** |
||
23 | * Add a CMB2 instance object to the registry. |
||
24 | * |
||
25 | * @since 1.X.X |
||
26 | * |
||
27 | * @param CMB2 $cmb_instance CMB2 instance. |
||
28 | */ |
||
29 | 48 | public static function add( CMB2 $cmb_instance ) { |
|
32 | |||
33 | /** |
||
34 | * Remove a CMB2 instance object from the registry. |
||
35 | * |
||
36 | * @since 1.X.X |
||
37 | * |
||
38 | * @param string $cmb_id A CMB2 instance id. |
||
39 | */ |
||
40 | public static function remove( $cmb_id ) { |
||
45 | |||
46 | /** |
||
47 | * Retrieve a CMB2 instance by cmb id. |
||
48 | * |
||
49 | * @since 1.X.X |
||
50 | * |
||
51 | * @param string $cmb_id A CMB2 instance id. |
||
52 | * |
||
53 | * @return CMB2|bool False or CMB2 object instance. |
||
54 | */ |
||
55 | 34 | public static function get( $cmb_id ) { |
|
62 | |||
63 | /** |
||
64 | * Retrieve all CMB2 instances registered. |
||
65 | * |
||
66 | * @since 1.X.X |
||
67 | * @return CMB2[] Array of all registered cmb2 instances. |
||
68 | */ |
||
69 | 1 | public static function get_all() { |
|
72 | |||
73 | /** |
||
74 | * Retrieve all CMB2 instances that have the specified property set. |
||
75 | * |
||
76 | * @since 2.2.3 |
||
77 | * @param string $property Property name. |
||
78 | * @param mixed $ignore The value to ignore. |
||
79 | * @return CMB2[] Array of matching cmb2 instances. |
||
80 | */ |
||
81 | public static function get_by_property( $property, $ignore = null ) { |
||
95 | |||
96 | } |
||
97 |
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.