WC_Helper::get_local_themespublic staticWC 1.0

Get locally installed themes.

Метод класса: WC_Helper{}

Хуков нет.

Возвращает

Массив.

Использование

$result = WC_Helper::get_local_themes();

Код WC_Helper::get_local_themes() WC 9.9.4

public static function get_local_themes() {
	if ( ! function_exists( 'wp_get_themes' ) ) {
		require_once ABSPATH . 'wp-admin/includes/theme.php';
	}
	$themes = wp_get_themes();

	$output_themes = array();
	foreach ( $themes as $theme ) {
		array_push(
			$output_themes,
			array(
				'_filename'   => $theme->get_stylesheet() . '/style.css',
				'_stylesheet' => $theme->get_stylesheet(),
				'_type'       => 'theme',
				'slug'        => $theme->get_stylesheet(),
				'Version'     => $theme->get( 'Version' ),
			)
		);
	}
	return $output_themes;
}