diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php index bfb1b098eec4d..8ec983de65b52 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php @@ -33,6 +33,7 @@ public function __construct() { * * @see register_rest_route() */ + #[\Override] public function register_routes() { register_rest_route( @@ -80,6 +81,7 @@ public function register_routes() { * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ + #[\Override] public function get_items_permissions_check( $request ) { if ( 'edit' === $request['context'] ) { $types = get_post_types( array( 'show_in_rest' => true ), 'objects' ); @@ -108,6 +110,7 @@ public function get_items_permissions_check( $request ) { * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ + #[\Override] public function get_items( $request ) { $data = array(); $types = get_post_types( array( 'show_in_rest' => true ), 'objects' ); @@ -132,6 +135,7 @@ public function get_items( $request ) { * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ + #[\Override] public function get_item( $request ) { $obj = get_post_type_object( $request['type'] ); @@ -174,6 +178,7 @@ public function get_item( $request ) { * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response Response object. */ + #[\Override] public function prepare_item_for_response( $item, $request ) { // Restores the more descriptive, specific name for use within this method. $post_type = $item; @@ -299,6 +304,7 @@ protected function prepare_links( $post_type ) { * * @return array Item schema data. */ + #[\Override] public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); @@ -421,6 +427,7 @@ public function get_item_schema() { * * @return array Collection parameters. */ + #[\Override] public function get_collection_params() { return array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ),