Gravity_Forms\Gravity_Forms\Config\GF_Config_Collection
Collection to hold GF_Config items and provide their structured data when needed.
Since: 2.6
Source: includes/config/class-gf-config-collection.php:15
Details
- Kind:
class - Namespace:
Gravity_Forms\Gravity_Forms\Config
Methods
| Method | Description |
|---|---|
add_config() | Add a config to the collection. |
handle() | Handle outputting the config data. |
sort_by_priority() | usort() callback to sort the configs by their $priority. |
Method Reference
add_config()
public function add_config( GF_Config $config )
Add a config to the collection.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$config | GF_Config |
Source: includes/config/class-gf-config-collection.php:27
handle()
public function handle( $localize=true, $args=null )
Handle outputting the config data.
If $localize is true, data is actually localized via wp_localize_script, otherwise
data is simply returned as an array.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$localize | bool | true | Whether to localize the data, or simply return it. |
$args | null |
Returns
array
Since: 2.6
Source: includes/config/class-gf-config-collection.php:43
sort_by_priority()
public function sort_by_priority( GF_Config $a, GF_Config $b )
usort() callback to sort the configs by their $priority.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$a | GF_Config | ||
$b | GF_Config |
Returns
int
Source: includes/config/class-gf-config-collection.php:223