Make WordPress Core


Ignore:
Timestamp:
10/22/2025 07:05:24 AM (5 months ago)
Author:
gziolo
Message:

Abilities API: Add Ability Categories REST API controller

Introduces a new REST API endpoint at wp-abilities/v1/categories to expose
ability categories through the WordPress REST API.

The new WP_REST_Abilities_V1_Categories_Controller provides:

  • GET /wp-abilities/v1/categories - Lists all ability categories with pagination
  • GET /wp-abilities/v1/categories/{slug} - Retrieves a single category by slug

Both endpoints require the read capability and return category data including
slug, label, description, and metadata. The collection endpoint supports pagination
with page and per_page parameters (default: 50, max: 100).

Developed in https://github.com/WordPress/wordpress-develop/pull/10380.

Follow-up [61032].

Props gziolo, jason_the_adams, timothyblynjacobs.
Fixes #64098.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api.php

    r61036 r61045  
    486486
    487487    // Abilities.
     488    $abilities_categories_controller = new WP_REST_Abilities_V1_Categories_Controller();
     489    $abilities_categories_controller->register_routes();
    488490    $abilities_run_controller = new WP_REST_Abilities_V1_Run_Controller();
    489491    $abilities_run_controller->register_routes();
Note: See TracChangeset for help on using the changeset viewer.