Conversation
| } | ||
|
|
||
| $theme_data = WP_Theme_JSON_Resolver::get_theme_data()->get_custom_templates(); | ||
| $theme_data = WP_Theme_JSON_Resolver::get_theme_data( array(), array( 'with_supports' => false ) )->get_custom_templates(); |
There was a problem hiding this comment.
@felixarntz @desrosj @peterwilsoncc This work, because, supports are not needed here. You just need a WP_Theme_Json object. Adding these params, means that it hits a cache that it would not before. This function is called 300+ times a page load, there some serious savings here.
|
Closing in favour of #3624 |
|
Though I'm not super familiar with this code, the suggested change looks like an easy win. I was wondering about |
felixarntz
left a comment
There was a problem hiding this comment.
@spacedmonkey Looks great, only pending @SergeyBiryukov's question.
| function _add_block_template_part_area_info( $template_info ) { | ||
| if ( WP_Theme_JSON_Resolver::theme_has_support() ) { | ||
| $theme_data = WP_Theme_JSON_Resolver::get_theme_data()->get_template_parts(); | ||
| $theme_data = WP_Theme_JSON_Resolver::get_theme_data( array(), array( 'with_supports' => false ) )->get_template_parts(); |
@felixarntz Actioned the feedback. |
|
Committed. |
Trac ticket: https://core.trac.wordpress.org/ticket/57077
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.