From 326d349cd3d571734c019669639b2cfa2611728d Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Wed, 13 May 2020 19:26:43 +0200 Subject: [PATCH] Fix logic --- lib/templates.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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.