Skip to content

Commit 8f09dfb

Browse files
update
1 parent f7b9367 commit 8f09dfb

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

inc/admin/template-importer.php

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __construct() {
3939
add_action( 'wp_ajax_aaeaddon_wishlist_option', [ $this, 'wishlist' ] );
4040

4141
$this->plugin_installer = new WCF_Plugin_Installer(true);
42-
add_filter('wcf_addons_dashboard_config', [ $this, 'include_user_wishlist']);
42+
add_filter('wcf_addons_dashboard_config', [ $this, 'include_user_wishlist']);
4343
}
4444

4545
public function include_user_wishlist($config) {
@@ -130,7 +130,7 @@ public function template_installer(){
130130
// Include the necessary plugin.php file
131131
$progress = '20';
132132
require_once ABSPATH . 'wp-admin/includes/plugin.php';
133-
133+
do_action('aaeaddon/starter-template/import/before/wp_options');
134134
if(is_array($user_plugins) && $user_plugins){
135135
if(isset($template_data['dependencies']['plugins']) && is_array($template_data['dependencies']['plugins'])){
136136
if ( current_user_can( 'install_plugins' ) ) {
@@ -154,7 +154,7 @@ public function template_installer(){
154154
}
155155
}
156156
update_option('aaeaddon_template_import_state', esc_html__( 'Plugin Installation Done' , 'animation-addons-for-elementor' ));
157-
}
157+
}
158158
}
159159
$template_data['next_step'] = 'install-wp-options';
160160
}elseif(isset($template_data['next_step']) && $template_data['next_step'] == 'check-template-status'){
@@ -220,12 +220,12 @@ public function template_installer(){
220220

221221
$template_data['next_step'] = 'check-template-status';
222222
$progress = '30';
223-
$msg = esc_html__('Checking Template Content', 'animation-addons-for-elementor');
223+
$msg = esc_html__('Downloading Template', 'animation-addons-for-elementor');
224224
if(isset($template_data['wp_options']) && is_array($template_data['wp_options'])){
225225
$this->install_options($template_data['wp_options']);
226226
}
227227
do_action('aaeaddon/starter-template/import/step/wp_options');
228-
update_option('aaeaddon_template_import_state', 'done');
228+
update_option('aaeaddon_template_import_state', $msg);
229229
}elseif(isset($template_data['next_step']) && $template_data['next_step'] == 'fail'){
230230
$msg = esc_html__('Template Demo Import fail', 'animation-addons-for-elementor');
231231
}else{
@@ -301,7 +301,15 @@ public function install_options( $settings ) {
301301
foreach ( $xml->option as $opt ) {
302302
$option_name = sanitize_text_field( (string) $opt->name );
303303
$serialized_data = sanitize_text_field( (string) $opt->value );
304-
304+
if (preg_match('/^aae_cpts_(\d{6})$/', $option_name, $m)) {
305+
$cpts = get_option($option_name);
306+
if (is_array($cpts)) {
307+
$cpts[] = $serialized_data;
308+
$serialized_data = serialize($cpts);
309+
} else {
310+
$serialized_data = serialize([$serialized_data]);
311+
}
312+
}
305313
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared
306314
$wpdb->update(
307315
$wpdb->options,
@@ -322,8 +330,9 @@ public function install_options( $settings ) {
322330
}
323331
}
324332
}
325-
}
326-
333+
}
334+
335+
327336
public function installElementorKit($elementor){
328337
$activeKitId = get_option( 'elementor_active_kit' );
329338
$kit_data = json_decode( $elementor, true );

inc/class-wcf-custom-css.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ class WCF_Custom_CSS {
1414

1515
public static function init() {
1616
add_action( 'elementor/element/after_section_end', [ __CLASS__, 'register_controls' ], 10, 2 );
17-
add_action( 'elementor/element/parse_css', [ __CLASS__, 'add_post_css' ], 10, 2 );
18-
17+
add_action( 'elementor/element/parse_css', [ __CLASS__, 'add_post_css' ], 10, 2 );
1918
}
2019

2120
/**

0 commit comments

Comments
 (0)