WC_Admin_Addons::output_storefront_button()public staticWC 1.0

Устарела с версии 5.9.0. Больше не поддерживается и может быть удалена. Используйте d in In-App Marketplace.

Handles the outputting of a contextually aware Storefront link (points to child themes if Storefront is already active).

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$result = WC_Admin_Addons::output_storefront_button();

Список изменений

Устарела с 5.9.0 No longer used in In-App Marketplace

Код WC_Admin_Addons::output_storefront_button() WC 8.7.0

public static function output_storefront_button() {
	$template   = get_option( 'template' );
	$stylesheet = get_option( 'stylesheet' );

	if ( 'storefront' === $template ) {
		if ( 'storefront' === $stylesheet ) {
			$url         = 'https://woo.com/product-category/themes/storefront-child-theme-themes/';
			$text        = __( 'Need a fresh look? Try Storefront child themes', 'woocommerce' );
			$utm_content = 'nostorefrontchildtheme';
		} else {
			$url         = 'https://woo.com/product-category/themes/storefront-child-theme-themes/';
			$text        = __( 'View more Storefront child themes', 'woocommerce' );
			$utm_content = 'hasstorefrontchildtheme';
		}
	} else {
		$url         = 'https://woo.com/storefront/';
		$text        = __( 'Need a theme? Try Storefront', 'woocommerce' );
		$utm_content = 'nostorefront';
	}

	$url = add_query_arg(
		array(
			'utm_source'   => 'addons',
			'utm_medium'   => 'product',
			'utm_campaign' => 'woocommerceplugin',
			'utm_content'  => $utm_content,
		),
		$url
	);

	echo '<a href="' . esc_url( $url ) . '" class="page-title-action">' . esc_html( $text ) . '</a>' . "\n";
}