Automattic\WooCommerce\Admin\Features\Blueprint
Init::get_themes_for_export_group
Get themes for export group.
Method of the class: Init{}
No Hooks.
Returns
Array. $themes
Usage
$Init = new Init(); $Init->get_themes_for_export_group();
Init::get_themes_for_export_group() Init::get themes for export group code WC 10.5.0
public function get_themes_for_export_group() {
$themes = $this->get_installed_wp_org_themes();
$active_theme = $this->wp_get_theme();
$themes = array_map(
function ( $theme ) use ( $active_theme ) {
return array(
'id' => $theme->get_stylesheet(),
'label' => $theme->get( 'Name' ),
'checked' => $theme->get_stylesheet() === $active_theme->get_stylesheet(),
);
},
$themes
);
usort(
$themes,
function ( $a, $b ) {
return $b['checked'] <=> $a['checked'];
}
);
return array_values( $themes );
}