Skip to content

Commit

Permalink
Revert "Add TODO comments about future optimization"
Browse files Browse the repository at this point in the history
This reverts commit 6ca25eac8c060c69e32ff946fc586a2570aae749.
  • Loading branch information
ockham committed May 12, 2020
1 parent 4d83b44 commit bba8729
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
4 changes: 0 additions & 4 deletions lib/template-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,6 @@ function gutenberg_find_template_post_and_parts( $template_type, $template_hiera

$current_template_post = $template_query->have_posts() ? $template_query->next_post() : null;

// TODO: We could consider moving the following logic to a hook like `posts_results` that is run
// after query results have been fetched. That might allow us to absorb filtering logic
// (as e.g. found in `filter_rest_wp_template_query`) into the generic querying logic.

// Build map of template slugs to their priority in the current hierarchy.
$slug_priorities = array_flip( $slugs );

Expand Down
4 changes: 0 additions & 4 deletions lib/templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,6 @@ function filter_rest_wp_template_query( $args, $request ) {
continue;
}

// TODO: gutenberg_find_template_post_and_parts() internally performs a query.
// This means that there's room for optimization, and we might be able to
// generalize the logic found here into something that runs upon every `wp_template`
// query (not just those coming from the REST API).
$current_template = gutenberg_find_template_post_and_parts( $template_type );
if ( isset( $current_template ) ) {
$template_ids[ $current_template['template_post']->post_name ] = $current_template['template_post']->ID;
Expand Down

0 comments on commit bba8729

Please sign in to comment.