From ac8cccac67a8f61e74824716507851e237826f4d Mon Sep 17 00:00:00 2001 From: Jorge Costa Date: Thu, 22 Sep 2022 11:31:35 +0000 Subject: [PATCH] REST API: Fix check for has_archive inclusion. Props dlh, audrasjb, mukesh27. Fixes #56618. git-svn-id: https://develop.svn.wordpress.org/trunk@54288 602fd350-edb4-49c9-b593-d223f7449a82 --- .../rest-api/endpoints/class-wp-rest-post-types-controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 02a03cd1a5..bfb1b098ee 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 @@ -198,7 +198,7 @@ class WP_REST_Post_Types_Controller extends WP_REST_Controller { $data['hierarchical'] = $post_type->hierarchical; } - if ( rest_is_field_included( 'hierarchical', $fields ) ) { + if ( rest_is_field_included( 'has_archive', $fields ) ) { $data['has_archive'] = $post_type->has_archive; }