wp-includes/rest-api/endpoints/class-wp-rest-abilities-v1-list-controller.php:88Retrieves all abilities.
$requestWP_REST_RequestWP_REST_Response public function get_items( $request ) { $abilities = array_filter( wp_get_abilities(), static function ( $ability ) { return $ability->get_meta_item( 'show_in_rest' ); } ); // Filter by ability category if specified. $category = $request['category']; if ( ! empty( $category ) ) { $abilities = array_filter( $abilities, static function ( $ability ) use ( $category ) { return $ability->get_category() === $category; } ); // Reset array keys after filtering. $abilities = array_values( $abilities ); } $page = $request['page']; $per_page = $request['per_page']; $offset = ( $page - 1 ) * $per_page; $total_abilities = count( $abilities ); $max_pages = (int) ceil( $total_abilities / $per_page ); if ( $request->get_method() === 'HEAD' ) { $response = new WP_REST_Response( array() ); } else { $abilities = array_slice( $abilities, $offset, $per_page ); $data = array(); foreach ( $abilities as $ability ) { $item = $this->prepare_item_for_response( $ability, $request ); $data[] = $this->prepare_response_for_collection( $item ); } $response = rest_ensure_response( $data ); } $response->header( 'X-WP-Total', (string) $total_abilities ); $response->header( 'X-WP-TotalPages', (string) $max_pages ); $query_params = $request->get_query_params(); $base = add_query_arg( urlencode_deep( $query_params ), rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) ); if ( $page > 1 ) { $prev_page = $page - 1; $prev_link = add_query_arg( 'page', $prev_page, $base ); $response->link_header( 'prev', $prev_link ); } if ( $page < $max_pages ) { $next_page = $page + 1; $next_link = add_query_arg( 'page', $next_page, $base ); $response->link_header( 'next', $next_link ); } return $response; }Introduced in 6.9.0. Unchanged from 6.9.7 through 7.1.0.
Signature, return type and hooks compared across 3 parsed releases.
src/wp-includes/rest-api/endpoints/class-wp-rest-abilities-v1-list-controller.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.