diff --git a/lib/templates.php b/lib/templates.php index af41251f720dc6..62bea3fb39642e 100644 --- a/lib/templates.php +++ b/lib/templates.php @@ -183,7 +183,7 @@ function filter_rest_wp_template_collection_params( $query_params ) { function filter_rest_wp_template_query( $args, $request ) { if ( $request['resolved'] ) { $template_ids = array( 0 ); // Return nothing by default (the 0 is needed for `post__in`). - $template_types = $request['slug'] ? array( $request['slug'] ) : get_template_types(); + $template_types = $request['slug'] ? $request['slug'] : get_template_types(); foreach ( $template_types as $template_type ) { // Skip 'embed' for now because it is not a regular template type.