Automattic\WooCommerce\EmailEditor\Engine

Site_Style_Sync_Controller::get_themepublicWC 1.0

Getter for site theme.

Method of the class: Site_Style_Sync_Controller{}

No Hooks.

Returns

?WP_Theme_JSON. Synced site theme.

Usage

$Site_Style_Sync_Controller = new Site_Style_Sync_Controller();
$Site_Style_Sync_Controller->get_theme( ?WP_Theme_JSON $base_theme ): ?WP_Theme_JSON;
?WP_Theme_JSON $base_theme
.
Default: null

Site_Style_Sync_Controller::get_theme() code WC 10.7.0

public function get_theme( ?WP_Theme_JSON $base_theme = null ): ?WP_Theme_JSON {
	if ( ! $this->is_sync_enabled() ) {
		return null;
	}

	$synced_data = $this->sync_site_styles( $base_theme );

	if ( empty( $synced_data ) || ! isset( $synced_data['version'] ) ) {
		return null;
	}

	return new WP_Theme_JSON( $synced_data, 'theme' );
}