Automattic\WooCommerce\Internal\Admin\Onboarding

OnboardingThemes::get_paid_theme_by_slug()public staticWC 1.0

Get puchasable theme by slug.

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

Хуков нет.

Возвращает

Массив|null.

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

$result = OnboardingThemes::get_paid_theme_by_slug( $slug );
$slug(строка) (обязательный)
from theme.

Код OnboardingThemes::get_paid_theme_by_slug() WC 6.6.1

public static function get_paid_theme_by_slug( $slug ) {
	$themes    = self::get_themes();
	$theme_key = array_search( $slug, array_column( $themes, 'slug' ), true );
	$theme     = false !== $theme_key ? $themes[ $theme_key ] : null;
	if ( $theme && isset( $theme['id'] ) && isset( $theme['price'] ) ) {
		$price = self::get_price_from_string( $theme['price'] );
		if ( $price && $price > 0 ) {
			return $themes[ $theme_key ];
		}
	}
	return null;
}