Automattic\WooCommerce\EmailEditor\Engine

Site_Style_Sync_Controller::get_site_themeprivateWC 1.0

Get site theme data

Method of the class: Site_Style_Sync_Controller{}

No Hooks.

Returns

WP_Theme_JSON.

Usage

// private - for code of main (parent) class only
$result = $this->get_site_theme(): WP_Theme_JSON;

Site_Style_Sync_Controller::get_site_theme() code WC 10.5.0

private function get_site_theme(): WP_Theme_JSON {
	if ( null === $this->site_theme ) {
		// Get only the theme and user customizations (e.g. from site editor).
		$this->site_theme = new WP_Theme_JSON();
		$this->site_theme->merge( WP_Theme_JSON_Resolver::get_theme_data() );
		$this->site_theme->merge( WP_Theme_JSON_Resolver::get_user_data() );

		if ( isset( $this->site_theme->get_raw_data()['styles'] ) ) {
			$this->site_theme = WP_Theme_JSON::resolve_variables( $this->site_theme );
		}
	}
	return $this->site_theme;
}