-
Notifications
You must be signed in to change notification settings - Fork 23
Add Abilities API bridge for WP Feature API #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Implements a bridge between WordPress.org Abilities API and WP Feature API, allowing abilities to be automatically registered as features when enabled.
- Change config from useAbilitiesBackend boolean to backend string ('features' | 'abilities')
- Remove unnecessary wp.data availability checks (it's a dependency)
- Fix demo ability registration with proper JSON schema for OpenAI compatibility
- Remove configure() function - config is read once at module load
- Simplify string comparison for wp_localize_script values
|
This is great! Once we publish |
- Add key: 'name' to abilities entity config for core-data - Map ability fields correctly to Feature interface - Fix resolver to handle abilities using name instead of id
|
We are closer to the finish line to make it happen. The last remaining task is to publish a composer package, which is tracked in: |
|
The initial v0.1.0 release for Abilities API is ready. It should get published on Packagist as |
|
https://packagist.org/packages/wordpress/abilities-api – it's ready for testing! |
|
Awesome! I'll retest this against the composer version Monday and get this merged 🎉 |
|
Should we close this one and archive the project on GitHub redirecting folks to use Abilities API v0.2+? |
|
@gziolo Yes good call. I'll archive this repo a bit later today and update the README. |
Implements client-side integration between the WordPress Abilities API and the WP Feature API, enabling the Feature API client to use Abilities as the backend for server-side features.
Why
The WordPress Abilities API provides a standardized way to register and manage server capabilities now, and is slated for WordPress core inclusion. This integration allows the Feature API client to leverage abilities as its backend, while still allowing client features to be used (until the Abilities API supports client abilities).
How
When enabled via the
WP_FEATURE_API_ABILITIES_BACKENDconstant or via JS, the Feature API client:/wp/v2/featuresto/wp/v2/abilitiesThe integration is purely client-side - plugins can migrate from
wp_register_feature()towp_register_ability()directly.Testing Steps
define( 'WP_FEATURE_API_ABILITIES_BACKEND', true );in wp-config.phpdefine( 'WP_FEATURE_API_LOAD_DEMO', true );in wp-config.php/wp-admin/options-general.php?page=wp-ai-api-proxy-settingsability/demo/site-infois called