mirror of
https://github.com/proelements/proelements.git
synced 2026-04-05 20:13:47 +00:00
31 lines
721 B
PHP
31 lines
721 B
PHP
<?php
|
|
namespace ElementorPro\Modules\Woocommerce\ImportExportCustomization;
|
|
|
|
use Elementor\App\Modules\ImportExportCustomization\Runners\Revert\Revert_Runner_Base;
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
exit;
|
|
}
|
|
|
|
class Woocommerce_Settings_Revert extends Revert_Runner_Base {
|
|
|
|
public static function get_name(): string {
|
|
return 'woocommerce-settings';
|
|
}
|
|
|
|
public function should_revert( array $data ): bool {
|
|
return isset( $data['runners'][ static::get_name() ] );
|
|
}
|
|
|
|
public function revert( array $data ) {
|
|
$runner_data = $data['runners'][ static::get_name() ];
|
|
|
|
$previous_pages = $runner_data['previous_pages'] ?? [];
|
|
|
|
foreach ( $previous_pages as $key => $value ) {
|
|
update_option( $key, $value );
|
|
}
|
|
}
|
|
}
|
|
|