Changeset 63343 for trunk/src/wp-includes/abilities-api.php
- Timestamp:
- 08/24/2026 07:42:56 AM (4 weeks ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/abilities-api.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/abilities-api.php
r62737 r63343 129 129 * add_action( 'wp_abilities_api_init', 'my_plugin_register_abilities' ); 130 130 * 131 * On failure, this function returns `null` and calls `_doing_it_wrong()` with the reason. 132 * By default, the resulting notice is displayed when `WP_DEBUG` is enabled. 133 * 131 134 * ### Naming Conventions 132 135 * … … 139 142 * ### Categories 140 143 * 141 * Abilities must be organized into categories. Ability categories provide better 142 * discoverability and must be registered before the abilities that reference them: 144 * Abilities can be organized into categories. If no category is provided, the ability is 145 * assigned to the built-in `uncategorized` category. Custom categories must be registered 146 * before the abilities that reference them: 143 147 * 144 148 * function my_plugin_register_categories(): void { … … 229 233 * 230 234 * @since 6.9.0 235 * @since 7.2.0 The `category` argument is now optional and defaults to `uncategorized`. 231 236 * 232 237 * @see WP_Abilities_Registry::register() … … 243 248 * @type string $description Required. A detailed description of what the ability does 244 249 * and when it should be used. 245 * @type string $category Required. The ability category slug this ability belongs to.246 * The ability category must be registered via `wp_register_ability_category()`247 * before registering the ability.250 * @type string $category Optional. The ability category slug this ability belongs to. 251 * Defaults to `uncategorized`. Custom categories must be registered 252 * via `wp_register_ability_category()` before registering the ability. 248 253 * @type callable $execute_callback Required. A callback function to execute when the ability is invoked. 249 254 * Receives optional mixed input data and must return either a result … … 608 613 * 609 614 * Ability categories provide a way to organize and group related abilities for better 610 * discoverability and management. Ability categories must be registered before abilities 611 * that reference them. 615 * discoverability and management. Custom categories must be registered before abilities 616 * that reference them. Abilities that omit a category are assigned to the built-in 617 * `uncategorized` category, which is intended as an escape hatch for simple or transitional 618 * registrations. 612 619 * 613 620 * Ability categories must be registered on the `wp_abilities_api_categories_init` action hook. … … 625 632 * } 626 633 * add_action( 'wp_abilities_api_categories_init', 'my_plugin_register_categories' ); 634 * 635 * On failure, this function returns `null` and calls `_doing_it_wrong()` with the reason. 636 * By default, the resulting notice is displayed when `WP_DEBUG` is enabled. 627 637 * 628 638 * @since 6.9.0
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)