mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-05 07:07:04 +00:00
Themes: Reduce usage of wp_get_theme function.
Calling the `wp_get_theme` function creates a instance of the `WP_Theme` class. This can be a performance issue, if all you need is one property of the class instance. This change replaces the usage of `wp_get_theme()->get_stylesheet()` with `get_stylesheet()` to improve performance. Props spacedmonkey, flixos90, peterwilsoncc, desrosj. Fixes #57057. git-svn-id: https://develop.svn.wordpress.org/trunk@54817 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -22,7 +22,7 @@ function render_block_core_template_part( $attributes ) {
|
||||
if (
|
||||
isset( $attributes['slug'] ) &&
|
||||
isset( $attributes['theme'] ) &&
|
||||
wp_get_theme()->get_stylesheet() === $attributes['theme']
|
||||
get_stylesheet() === $attributes['theme']
|
||||
) {
|
||||
$template_part_id = $attributes['theme'] . '//' . $attributes['slug'];
|
||||
$template_part_query = new WP_Query(
|
||||
|
||||
Reference in New Issue
Block a user