Make WordPress Core


Ignore:
Timestamp:
05/23/2024 04:12:31 PM (11 months ago)
Author:
joemcgill
Message:

Editor: Remove additional calls to WP_Theme_JSON::_construct.

This improves performance of the WP_Theme_JSON_Resolver class by avoiding redundant construction of WP_Theme_JSON objects for each origin.

Props thekt12, joemcgill, swissspidy, audrasjb, oandregal.
Fixes #61112.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-theme-json-data.php

    r56547 r58185  
    7070        return $this->theme_json->get_raw_data();
    7171    }
     72
     73    /**
     74     * Returns theme JSON object.
     75     *
     76     * @since 6.6.0
     77     *
     78     * @return WP_Theme_JSON The theme JSON structure stored in this data object.
     79     */
     80    public function get_theme_json() {
     81        return $this->theme_json;
     82    }
    7283}
Note: See TracChangeset for help on using the changeset viewer.