WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Платформа для конвертации и монетизации трафика
функция не описана

Automattic\WooCommerce\Admin\Features

Onboarding::get_themes() public WC 1.0

Get a list of themes for the onboarding wizard.

{} Это метод класса: Onboarding{}

Хуки из метода
Возвращает

Массив.

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

$result = Onboarding::get_themes();

Код Onboarding::get_themes() WC 4.7.1

<?php
public static function get_themes() {
	$themes = get_transient( self::THEMES_TRANSIENT );
	if ( false === $themes ) {
		$theme_data = wp_remote_get( 'https://woocommerce.com/wp-json/wccom-extensions/1.0/search?category=themes' );
		$themes     = array();

		if ( ! is_wp_error( $theme_data ) ) {
			$theme_data    = json_decode( $theme_data['body'] );
			$woo_themes    = property_exists( $theme_data, 'products' ) ? $theme_data->products : array();
			$sorted_themes = self::sort_woocommerce_themes( $woo_themes );

			foreach ( $sorted_themes as $theme ) {
				$slug                                       = sanitize_title_with_dashes( $theme->slug );
				$themes[ $slug ]                            = (array) $theme;
				$themes[ $slug ]['is_installed']            = false;
				$themes[ $slug ]['has_woocommerce_support'] = true;
				$themes[ $slug ]['slug']                    = $slug;
			}
		}

		$installed_themes = wp_get_themes();
		$active_theme     = get_option( 'stylesheet' );

		foreach ( $installed_themes as $slug => $theme ) {
			$theme_data       = self::get_theme_data( $theme );
			$installed_themes = wp_get_themes();
			$themes[ $slug ]  = $theme_data;
		}

		// Add the WooCommerce support tag for default themes that don't explicitly declare support.
		if ( function_exists( 'wc_is_wp_default_theme_active' ) && wc_is_wp_default_theme_active() ) {
			$themes[ $active_theme ]['has_woocommerce_support'] = true;
		}

		$themes = array( $active_theme => $themes[ $active_theme ] ) + $themes;

		set_transient( self::THEMES_TRANSIENT, $themes, DAY_IN_SECONDS );
	}

	$themes = apply_filters( 'woocommerce_admin_onboarding_themes', $themes );
	return array_values( $themes );
}