Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance: Disable lazy term meta loading render_block_core_template_part. #48000

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Disable lazy term meta loading render_block_core_template_part.
  • Loading branch information
spacedmonkey committed Feb 13, 2023
commit 5031b6bd7dc29507de3683ca4c23a63265cf8c2b
13 changes: 7 additions & 6 deletions packages/block-library/src/template-part/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,19 @@ function render_block_core_template_part( $attributes ) {
$template_part_id = $attributes['theme'] . '//' . $attributes['slug'];
$template_part_query = new WP_Query(
array(
'post_type' => 'wp_template_part',
'post_status' => 'publish',
'post_name__in' => array( $attributes['slug'] ),
'tax_query' => array(
'post_type' => 'wp_template_part',
'post_status' => 'publish',
'post_name__in' => array( $attributes['slug'] ),
'tax_query' => array(
array(
'taxonomy' => 'wp_theme',
'field' => 'name',
'terms' => $attributes['theme'],
),
),
'posts_per_page' => 1,
'no_found_rows' => true,
'posts_per_page' => 1,
'no_found_rows' => true,
'lazy_load_term_meta' => false,
spacedmonkey marked this conversation as resolved.
Show resolved Hide resolved
)
);
$template_part_post = $template_part_query->have_posts() ? $template_part_query->next_post() : null;
Expand Down