Skip to content

Commit

Permalink
Fix filter_rest_wp_template_query
Browse files Browse the repository at this point in the history
  • Loading branch information
ockham committed May 12, 2020
1 parent 93e1fe1 commit 4d83b44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ 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_type = $request['slug'] ? array( $request['slug'] ) : get_template_types();
$template_types = $request['slug'] ? array( $request['slug'] ) : get_template_types();

foreach ( get_template_types() as $template_type ) {
foreach ( $template_types as $template_type ) {
// Skip 'embed' for now because it is not a regular template type.
// Skip 'index' because it's a fallback that we handle differently.
if ( in_array( $template_type, array( 'embed', 'index' ), true ) ) {
Expand Down

0 comments on commit 4d83b44

Please sign in to comment.