ExportWCCoreProfilerOptions.php
1 year ago
ExportWCPaymentGateways.php
1 year ago
ExportWCSettings.php
11 months ago
ExportWCSettingsAccount.php
1 year ago
ExportWCSettingsAdvanced.php
1 year ago
ExportWCSettingsEmails.php
1 year ago
ExportWCSettingsGeneral.php
1 year ago
ExportWCSettingsIntegrations.php
1 year ago
ExportWCSettingsProducts.php
1 year ago
ExportWCSettingsShipping.php
1 year ago
ExportWCSettingsSiteVisibility.php
1 year ago
ExportWCSettingsTax.php
11 months ago
ExportWCTaskOptions.php
1 year ago
ExportWCTaskOptions.php
81 lines
| 1 | <?php |
| 2 | |
| 3 | declare( strict_types = 1); |
| 4 | |
| 5 | namespace Automattic\WooCommerce\Admin\Features\Blueprint\Exporters; |
| 6 | |
| 7 | use Automattic\WooCommerce\Blueprint\Exporters\HasAlias; |
| 8 | use Automattic\WooCommerce\Blueprint\Exporters\StepExporter; |
| 9 | use Automattic\WooCommerce\Blueprint\Steps\SetSiteOptions; |
| 10 | use Automattic\WooCommerce\Blueprint\UseWPFunctions; |
| 11 | |
| 12 | /** |
| 13 | * Class ExportWCTaskOptions |
| 14 | * |
| 15 | * This class exports WooCommerce task options. |
| 16 | * |
| 17 | * @package Automattic\WooCommerce\Admin\Features\Blueprint\Exporters |
| 18 | */ |
| 19 | class ExportWCTaskOptions implements StepExporter, HasAlias { |
| 20 | use UseWPFunctions; |
| 21 | |
| 22 | /** |
| 23 | * Export WooCommerce task options. |
| 24 | * |
| 25 | * @return SetSiteOptions |
| 26 | */ |
| 27 | public function export() { |
| 28 | return new SetSiteOptions( |
| 29 | array( |
| 30 | 'woocommerce_admin_customize_store_completed' => $this->wp_get_option( 'woocommerce_admin_customize_store_completed', 'no' ), |
| 31 | 'woocommerce_task_list_tracked_completed_actions' => $this->wp_get_option( 'woocommerce_task_list_tracked_completed_actions', array() ), |
| 32 | ) |
| 33 | ); |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Get the name of the step. |
| 38 | * |
| 39 | * @return string |
| 40 | */ |
| 41 | public function get_step_name() { |
| 42 | return 'setOptions'; |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * Get the alias for this exporter. |
| 47 | * |
| 48 | * @return string |
| 49 | */ |
| 50 | public function get_alias() { |
| 51 | return 'setWCTaskOptions'; |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * Return label used in the frontend. |
| 56 | * |
| 57 | * @return string |
| 58 | */ |
| 59 | public function get_label() { |
| 60 | return __( 'Task Configurations', 'woocommerce' ); |
| 61 | } |
| 62 | |
| 63 | /** |
| 64 | * Return description used in the frontend. |
| 65 | * |
| 66 | * @return string |
| 67 | */ |
| 68 | public function get_description() { |
| 69 | return __( 'Includes the task configurations for WooCommerce.', 'woocommerce' ); |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * Check if the current user has the required capabilities for this step. |
| 74 | * |
| 75 | * @return bool True if the user has the required capabilities. False otherwise. |
| 76 | */ |
| 77 | public function check_step_capabilities(): bool { |
| 78 | return current_user_can( 'manage_woocommerce' ); |
| 79 | } |
| 80 | } |
| 81 |