Title: Data file = not defined!
Last modified: July 28, 2017

---

# Data file = not defined!

 *  Resolved [Roman Perevala](https://wordpress.org/support/users/ramzesimus/)
 * (@ramzesimus)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/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)

 *  Thread Starter [Roman Perevala](https://wordpress.org/support/users/ramzesimus/)
 * (@ramzesimus)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/data-file-not-defined/#post-9361131)
 * My fault 🙂
    I wrapped the whole string with trailingslashit() instead of get_template_directory()
   So it should be
 * `trailingslashit( get_template_directory() ) . '/inc/demo/content.xml'`
 * Everything works now!
 * Best Regards!
    Ramzesimus
 *  Plugin Author [Gregor Capuder](https://wordpress.org/support/users/capuderg/)
 * (@capuderg)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/data-file-not-defined/#post-9365529)
 * Hi,
 * 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.

 * ![](https://ps.w.org/one-click-demo-import/assets/icon-256x256.png?rev=2506685)
 * [One Click Demo Import](https://wordpress.org/plugins/one-click-demo-import/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/one-click-demo-import/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/one-click-demo-import/)
 * [Active Topics](https://wordpress.org/support/plugin/one-click-demo-import/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/one-click-demo-import/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/one-click-demo-import/reviews/)

## Tags

 * [Import](https://wordpress.org/support/topic-tag/import/)
 * [widget](https://wordpress.org/support/topic-tag/widget/)

 * 2 replies
 * 2 participants
 * Last reply from: [Gregor Capuder](https://wordpress.org/support/users/capuderg/)
 * Last activity: [8 years, 8 months ago](https://wordpress.org/support/topic/data-file-not-defined/#post-9365529)
 * Status: resolved