Automattic\WooCommerce\Internal\Admin\Onboarding
OnboardingThemes::get_paid_theme_by_slug()
Get puchasable theme by slug.
Метод класса: OnboardingThemes{}
Хуков нет.
Возвращает
Массив|null
.
Использование
$result = OnboardingThemes::get_paid_theme_by_slug( $slug );
- $slug(строка) (обязательный)
- from theme.
Код OnboardingThemes::get_paid_theme_by_slug() OnboardingThemes::get paid theme by slug WC 8.7.0
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; }