Class CMB2_Boxes
A CMB2 object instance registry for storing every CMB2 instance.
Methods summary
public static
|
#
add( CMB2 $cmb_instance )
Add a CMB2 instance object to the registry.
Add a CMB2 instance object to the registry.
Parameters
- $cmb_instance
- CMB2 instance.
Since
1.X.X
|
public static
|
#
remove( string $cmb_id )
Remove a CMB2 instance object from the registry.
Remove a CMB2 instance object from the registry.
Parameters
- $cmb_id
- A CMB2 instance id.
Since
1.X.X
|
public static
CMB2 |boolean
|
#
get( string $cmb_id )
Retrieve a CMB2 instance by cmb id.
Retrieve a CMB2 instance by cmb id.
Parameters
- $cmb_id
- A CMB2 instance id.
Returns
CMB2 |boolean False or CMB2 object instance.
Since
1.X.X
|
public static
CMB2[]
|
#
get_all( )
Retrieve all CMB2 instances registered.
Retrieve all CMB2 instances registered.
Returns
CMB2[] Array of all registered cmb2 instances.
Since
1.X.X
|
public static
CMB2[]
|
#
get_by( string $property, mixed $compare = 'nocompare' )
Retrieve all CMB2 instances that have the specified property set.
Retrieve all CMB2 instances that have the specified property set.
Parameters
- $property
- Property name.
- $compare
- (Optional) The value to compare.
Returns
CMB2[] Array of matching cmb2 instances.
Since
2.4.0
|
public static
CMB2[]
|
#
filter_by( string $property, mixed $to_ignore = null )
Retrieve all CMB2 instances as long as they do not include the ignored property.
Retrieve all CMB2 instances as long as they do not include the ignored property.
Parameters
- $property
- Property name.
- $to_ignore
- The value to ignore.
Returns
CMB2[] Array of matching cmb2 instances.
Since
2.4.0
|
public static
CMB2[]
|
#
get_by_property( string $property, mixed $to_ignore = null )
Deprecated and left for back-compatibility. The original get_by_property
method was misnamed and never actually used by CMB2 core.
Deprecated and left for back-compatibility. The original get_by_property
method was misnamed and never actually used by CMB2 core.
Parameters
- $property
- Property name.
- $to_ignore
- The value to ignore.
Returns
CMB2[] Array of matching cmb2 instances.
Since
2.2.3
|
Properties summary
protected static
array
|
$cmb2_instances
Array of all metabox objects.
Array of all metabox objects.
Since
2.0.0
|
|