[wp-trac] [WordPress Trac] #63766: REST API fails if subtype CPT doesnt exist in Search Endpoint
WordPress Trac
noreply at wordpress.org
Wed Jul 30 14:10:49 UTC 2025
#63766: REST API fails if subtype CPT doesnt exist in Search Endpoint
-------------------------+------------------------------
Reporter: SirLouen | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version:
Severity: normal | Resolution:
Keywords: 2nd-opinion | Focuses:
-------------------------+------------------------------
Comment (by mindctrl):
This appears to be intentional. The `other-type` is not a valid enum
option if it's not a valid post type. See
`WP_REST_Post_Search_Handler::__construct()` where it calls
`get_post_types()` to define the subtypes.
Reference: https://github.com/WordPress/wordpress-
develop/blob/965ee6152caa8a3e2bea2bf18e405220e45c53df/src/wp-includes
/rest-api/search/class-wp-rest-post-search-handler.php#L28-L39
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63766#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list