Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Releases: WordPress/abilities-api

v0.4.0

30 Oct 08:47
0759075

Choose a tag to compare

This release syncs all the changes that are going to be included in the WordPress 6.9 release.

What's Changed

Breaking Changes

  • All WP hooks got prefixed with wp_.
    • wp_abilities_api_categories_init
    • wp_abilities_api_init
    • wp_before_execute_ability
    • wp_after_execute_ability
    • wp_register_ability_category_args
    • wp_register_ability_args
  • Ability categories and abilities can only be registered after the init action has fired.
  • check_permissions() on the WP_Ability class no longer validates the input. There is now a new public method validate_input() that has to be called explicitly.
  • REST API endpoints have a new URL structure with wp-abilities/v1 namespace, example: https://example.com/wp-json/wp-abilities/v1/categories

New Contributors

Full Changelog: v0.3.0...v0.4.0

v0.3.0

20 Oct 07:21
a6805fb

Choose a tag to compare

What's Changed

Breaking Changes

  • It's now mandatory to provide a registered category with wp_register_ability_category() when registering an ability with wp_register_ability().
  • It's also mandatory to provide a category name when registering the ability on the client with wp.abilities.registerAbility.
  • By default, all abilities are no longer exposed through the REST API. To opt into the old behavior, provide meta containing [ 'show_in_rest' => true ].
  • Meta annotations were introduced to control which HTTP method, GET vs POST, is used to execute an ability through the REST API. In particular, if you want to use GET, then make sure to include in meta the following override [ 'annotations' => [ 'readonly' => true ] ].

New Contributors

Full Changelog: v0.2.0...v0.3.0-rc.2

v0.2.0

03 Oct 12:38
fa5b4b0

Choose a tag to compare

What's Changed

  • Refactor the usage of $properties param to $args to align with WordPress usage by @gziolo in #59
  • Add HEAD method support for performance optimization by @Ref34t in #71
  • Fix $input type hint in WP_Ability by @gziolo in #61
  • chore: update dev-deps to latest by @justlevine in #72
  • fix: use link_header instead of add_link for pagination responses by @emdashcodes in #81
  • Update CONTRIBUTING.md by @akkspros in #80
  • Docs: REST API Reference by @gziolo in #77
  • Add execute actions to the ability object by @gziolo in #56
  • dev: Bump the PHPStan testing to PHP 8.4 by @johnbillion in #82
  • feat!: make permission_callback arg required by @justlevine in #73
  • Add client-side package for Abilities API by @emdashcodes in #60
  • dev: add register_ability_args filter [Proposal] by @justlevine in #74
  • docs: Fix the variable name by @mrabbani in #92
  • Fix has_permission() return type inconsistency (Issue #67) by @Ref34t in #76
  • Docs/semantic headings by @jonathanbossenger in #96
  • Rename check_permission() to check_permissions() on WP_Ability by @gziolo in #94
  • Fix backwards compatibility with WP_REST_Request API by @budzanowski in #98
  • Prepare the branch for v0.2.0 release by @gziolo in #90
  • Include JS build files in the Composer package in v0.2.0 release by @gziolo in #100

Braking changes

They are primarily included in the WP_Ability object:

  • permission_callback is now mandatory when registering an ability with wp_register_ability.
  • has_permission was deprecated in favor of check_permissions.
  • execute and check_permissions (previously has_permission) methods no longer accept only arrays. It's now possible to provide any input type, and it defaults to null.
  • When no input schema is provided, then permission_callback and execute_callback get executed with no arguments.
  • Some other protected methods, like validate_input and do_execute, also have different method signatures because of the input parameter changes.

New Contributors

Full Changelog: v0.1.1...v0.2.0-rc

v0.1.1

05 Sep 07:34
21af812

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.1.0...v0.1.1

Initial release

29 Aug 07:00
e0423b4

Choose a tag to compare

What's Included

New Contributors

Full Changelog: https://github.com/WordPress/abilities-api/commits/v0.1.0