Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

TourInAppMarketplace{}WC 1.0

Tour In-App Marketplace task

Хуков нет.

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

$TourInAppMarketplace = new TourInAppMarketplace();
// use class methods

Методы

  1. public get_action_url()
  2. public get_content()
  3. public get_id()
  4. public get_record_view_event()
  5. public get_time()
  6. public get_title()
  7. public is_complete()

Код TourInAppMarketplace{} WC 7.3.0

class TourInAppMarketplace extends Task {
	/**
	 * ID.
	 *
	 * @return string
	 */
	public function get_id() {
		return 'tour-in-app-marketplace';
	}

	/**
	 * Title.
	 *
	 * @return string
	 */
	public function get_title() {
		return __(
			'Discover where to find powerful store add-ons and integrations, with a WooCommerce Marketplace tour',
			'woocommerce'
		);
	}

	/**
	 * Content.
	 *
	 * @return string
	 */
	public function get_content() {
		return '';
	}

	/**
	 * Time.
	 *
	 * @return string
	 */
	public function get_time() {
		return '';
	}

	/**
	 * Task completion.
	 *
	 * @return bool
	 */
	public function is_complete() {
		return get_option( 'woocommerce_admin_dismissed_in_app_marketplace_tour' ) === 'yes';
	}

	/**
	 * Action URL.
	 *
	 * @return string
	 */
	public function get_action_url() {
		return admin_url( 'admin.php?page=wc-addons&tutorial=true' );
	}

	/**
	 * Check if should record event when task is viewed
	 *
	 * @return bool
	 */
	public function get_record_view_event(): bool {
		return true;
	}
}