mirror of
https://github.com/proelements/proelements.git
synced 2026-04-18 01:52:20 +00:00
v3.34.0
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user