Description
The gform_ability_categories filter controls the ability categories registered with WordPress. Use it to add one for your own abilities, keyed by slug with a label and description.
Usage
add_filter( 'gform_ability_categories', 'your_function_name' );
Parameters
| Parameter | Type | Description |
|---|---|---|
| $categories | array | The registered ability categories, keyed by slug. Each value is an array with label and description keys. |
Example
Register a Custom Category
add_filter( 'gform_ability_categories', function ( $categories ) {
$categories['gravityforms-myaddon'] = array(
'label' => 'My Add-On',
'description' => 'Tools registered by My Add-On.',
);
return $categories;
} );
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?
Source Code
This filter is located in gravityforms/includes/abilities/class-gf-abilities-service-provider.php
Since
The filter was added in Gravity Forms 3.1.0