wp_register_ability_category_args
Filters the ability category arguments before they are validated and used to instantiate the ability category.
Использование
add_filter( 'wp_register_ability_category_args', 'wp_kama_register_ability_category_args_filter', 10, 2 ); /** * Function for `wp_register_ability_category_args` filter-hook. * * @param array$args { ```php The arguments used to instantiate the ability category.
@type string $label The human-readable label for the ability category. @type string $description A description of the ability category. @type array<string, mixed> $meta Optional. Additional metadata for the ability category.
}
- @param string $slug The slug of the ability category.
-
@return array<string,
*/
function wp_kama_register_ability_category_args_filter( $args, $slug ){// filter...
return $args;
}
- $args(array<string,)
- mixed> $args {
php The arguments used to instantiate the ability category.
@type string $label The human-readable label for the ability category. @type string $description A description of the ability category. @type array<string, mixed> $meta Optional. Additional metadata for the ability category.
}
- $slug(строка)
- The slug of the ability category.
Список изменений
| С версии 6.9.0 | Введена. |
Где вызывается хук
wp_register_ability_category_args
wp-includes/abilities-api/class-wp-ability-categories-registry.php 91
$args = apply_filters( 'wp_register_ability_category_args', $args, $slug );