Make WordPress Core

Opened 13 months ago

Closed 12 months ago

Last modified 11 months ago

#58230 closed enhancement (fixed)

Disable lazy loading term meta get_block_templates.

Reported by: spacedmonkey's profile spacedmonkey Owned by: spacedmonkey's profile spacedmonkey
Milestone: 6.3 Priority: normal
Severity: normal Version:
Component: Editor Keywords: gutenberg-merge has-patch
Focuses: performance Cc:


Backport from

There is no need to lazy load in get_block_templates

Change History (8)

This ticket was mentioned in Slack in #core-editor by spacedmonkey. View the logs.

13 months ago

This ticket was mentioned in PR #4411 on WordPress/wordpress-develop by @spacedmonkey.

13 months ago

  • Keywords has-patch added

#3 @spacedmonkey
13 months ago

Ping @hellofromtonya

@oandregal commented on PR #4411:

13 months ago

Added Andrei as reviewer. If the original reviewers can be tagged in wordpress-develop, I suggest adding them here, as they know best about the changes. It also helps the review load to be distributed among everyone.

Code-wise the changes are the same from the original PR. There are no test instructions in any place I've checked (here, trac ticket, or the original PR), so I don't know what I should test or what I need to look at. I'll leave space for others to comment here (happy to help if test instructions are provided).

@spacedmonkey commented on PR #4411:

12 months ago

@oandregal As this is a performance improvement, there is no functional change. So that is not to test other than if the code make sense.

#6 @spacedmonkey
12 months ago

  • Owner set to spacedmonkey
  • Resolution set to fixed
  • Status changed from new to closed

In 55817:

Editor: Disable lazy loading term meta in get_block_templates.

Pass false to the lazy_load_term_meta parameter given to the WP_Query found in get_block_templates. Template post types only ever have one term assigned to them. So priming term meta, does not help performance as lazy loading term meta is only useful if loading multiple terms. As get_block_templates is run multiple times on a block theme request, this saves processing time.

Props spacedmonkey, andraganescu, ntsekouras, oandregal, westonruter.
Fixes #58230.

Note: See TracTickets for help on using tickets.