Problem with importing widgets to custom sidebars
-
Hello,
After updated the plugin to the latest version observed problem that widgets are not imported to custom sidebars.
Before importing widgets using “pt-ocdi/before_widgets_import” I am adding custom sidebars, settings different options and importing Revolution Slider this way:
function custom_theme_ocdi_import_start( $selected_import ) { if ( 'Main demo' === $selected_import['import_file_name'] ) { /*add custom sidebars*/ $custom_sidebar[] = 'sidebar1'; $custom_sidebar[] = 'sidebar2'; $custom_sidebar[] = 'sidebar3'; $custom_sidebar[] = 'sidebar4'; update_option( 'custom_sidebar', $custom_sidebar ); /*import revolution slider before importing xml*/ if ( is_plugin_active( 'revslider/revslider.php' ) ) { $absolute_path = __FILE__; $path_to_file = explode( 'wp-content', $absolute_path ); $path_to_wp = $path_to_file[0]; require_once( $path_to_wp.'/wp-load.php' ); require_once( $path_to_wp.'/wp-includes/functions.php'); require_once(ABSPATH . 'wp-admin/includes/file.php'); echo ' Import Files loaded'; echo ' Import Slider'; $slider_array = array(get_template_directory()."/dummy-data/revslider.zip"); $slider = new RevSlider(); foreach($slider_array as $filepath){ $slider->importSliderFromPost(true,true,$filepath); } echo ' Slider processed'; } } } add_action( 'pt-ocdi/before_widgets_import', 'custom_theme_ocdi_import_start' );
Sidebars are correctly added but the problem is that widgets are not imported. No errors reported. Widgets are imported correctly to static sidebars like default sidebar or footer sidebar. After run the import second time widgets are imported. Observed the issue only in the latest version, before update it worked fine. Did you observe it also?
Thanks!
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Problem with importing widgets to custom sidebars’ is closed to new replies.