Automattic\WooCommerce\Admin\Features\Blueprint\Exporters

ExportWCTaskOptions{}WC 1.0

Class ExportWCTaskOptions

This class exports WooCommerce task options and implements the StepExporter and HasAlias interfaces.

No Hooks.

Usage

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

Methods

  1. public export()
  2. public get_alias()
  3. public get_step_name()

Notes

  • Package: Automattic\WooCommerce\Admin\Features\Blueprint\Exporters

ExportWCTaskOptions{} code WC 9.6.1

class ExportWCTaskOptions implements StepExporter, HasAlias {
	use UseWPFunctions;

	/**
	 * Export WooCommerce task options.
	 *
	 * @return SetSiteOptions
	 */
	public function export() {
		$step = new SetSiteOptions(
			array(
				'woocommerce_admin_customize_store_completed' => $this->wp_get_option( 'woocommerce_admin_customize_store_completed', 'no' ),
				'woocommerce_task_list_tracked_completed_actions' => $this->wp_get_option( 'woocommerce_task_list_tracked_completed_actions', array() ),
			)
		);

		$step->set_meta_values(
			array(
				'plugin' => 'woocommerce',
				'alias'  => $this->get_alias(),
			)
		);

		return $step;
	}

	/**
	 * Get the name of the step.
	 *
	 * @return string
	 */
	public function get_step_name() {
		return 'setOptions';
	}

	/**
	 * Get the alias for this exporter.
	 *
	 * @return string
	 */
	public function get_alias() {
		return 'setWCTaskOptions';
	}
}