Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_register_ability_category_args

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
82            * @param array<string, mixed> $args {
83            *     The arguments used to instantiate the ability category.
84            *
85            *     @type string               $label       The human-readable label for the ability category.
86            *     @type string               $description A description of the ability category.
87            *     @type array<string, mixed> $meta        Optional. Additional metadata for the ability category.
88            * }
89            * @param string               $slug The slug of the ability category.
90            */
91           $args = apply_filters( 'wp_register_ability_category_args', $args, $slug );
92
93           try {
94                // WP_Ability_Category::prepare_properties() will throw an exception if the properties are invalid.
95                $category = new WP_Ability_Category( $slug, $args );
96           } catch ( InvalidArgumentException $e ) {
97                _doing_it_wrong(
98                     __METHOD__,
99                     $e->getMessage(),
100                     '6.9.0'