Changeset 59899 for trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php
- Timestamp:
- 03/02/2025 10:05:08 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php
r58452 r59899 110 110 */ 111 111 public function get_items( $request ) { 112 if ( $request->is_method( 'HEAD' ) ) { 113 // Return early as this handler doesn't add any response headers. 114 return new WP_REST_Response(); 115 } 116 112 117 $data = array(); 113 118 $types = get_post_types( array( 'show_in_rest' => true ), 'objects' ); … … 178 183 // Restores the more descriptive, specific name for use within this method. 179 184 $post_type = $item; 185 186 // Don't prepare the response body for HEAD requests. 187 if ( $request->is_method( 'HEAD' ) ) { 188 /** This filter is documented in wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php */ 189 return apply_filters( 'rest_prepare_post_type', new WP_REST_Response(), $post_type, $request ); 190 } 180 191 181 192 $taxonomies = wp_list_filter( get_object_taxonomies( $post_type->name, 'objects' ), array( 'show_in_rest' => true ) );
Note: See TracChangeset
for help on using the changeset viewer.