Data file = not defined!
-
Hey there,
Thanks for your great plugin!
For some reason I can’t get it work with predefined sample data files. In the same time everything works great with manual upload. I’m using next code for predefined sample data files:
function mytheme_import_files() { return array( array( 'import_file_name' => esc_html__( 'Default', 'mytheme' ), 'categories' => array( 'Default' ), 'local_import_file' => trailingslashit( get_template_directory() . '/inc/demo/content.xml' ), 'local_import_widget_file' => trailingslashit( get_template_directory() . '/inc/demo/widgets.json' ), 'import_preview_image_url' => get_template_directory_uri() . '/screenshot.png', ), ); } add_filter( 'pt-ocdi/import_files', 'mytheme_import_files' );And this is a log file
---Downloaded files--- The import files for: Default were successfully downloaded! Initial max execution time = 30 Files info: Site URL = http://localhost/test/mytheme Data file = not defined! Widget file = not defined! Customizer file = not defined! Redux files: not defined! ---pt-ocdi/after_import---So it says that everything was imported but basically it’s not.
Hope you can give some hints.
Best Regards!
Ramzesimus
Viewing 2 replies - 1 through 2 (of 2 total)
-
My fault 🙂
I wrapped the whole string with trailingslashit() instead of get_template_directory() So it should betrailingslashit( get_template_directory() ) . '/inc/demo/content.xml'Everything works now!
Best Regards!
RamzesimusHi,
I’m glad you spotted and solved the issue 🙂
Have a nice day!
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Data file = not defined!’ is closed to new replies.