Import demo data from theme and plugin
-
Hi, great theme thanks!
I have a theme that provides a bunch of demos perfectly.
I’m working on a plugin that offers a themed set of demos to add to the list of available demos.I cant get my plugin demos to append to the list of available demos.
Theme code:
function wpcake_import_files() { return array( array( 'import_file_name' => __('Restaurant', 'wpcake'), 'categories' => array( __('Food', 'wpcake'), __('Business', 'wpcake') ), 'import_file_url' => 'https://www.wpcakedemos.com/demo_data/restaurant/content.xml', 'import_widget_file_url' => 'https://www.wpcakedemos.com/demo_data/restaurant/widgets.wie', 'import_customizer_file_url' => 'https://www.wpcakedemos.com/demo_data/restaurant/customizer.dat', 'import_preview_image_url' => 'https://www.wpcakedemos.com/demo_data/restaurant/screenshot.png', 'preview_url' => 'https://www.wpcakedemos.com/restaurant/', ),... ); } add_filter( 'pt-ocdi/import_files', 'wpcake_import_files' );
Plugin code:
function wpcake_extra_import_files() { $demos = array( array( 'import_file_name' => __('Bubble Cake', 'wpcake-extra'), 'categories' => array( __('Cake', 'wpcake-extra'), __('Startup', 'wpcake-extra') ), 'import_file_url' => 'https://www.wpcakedemos.com/demo_data/restaurant/content.xml', 'import_widget_file_url' => 'https://www.wpcakedemos.com/demo_data/restaurant/widgets.wie', 'import_customizer_file_url' => 'https://www.wpcakedemos.com/demo_data/restaurant/customizer.dat', 'import_preview_image_url' => 'https://www.wpcakedemos.com/demo_data/restaurant/screenshot.png', 'preview_url' => 'https://www.wpcakedemos.com/restaurant/', ),... ); } add_filter( 'pt-ocdi/import_files', 'wpcake_extra_import_files' );
Will
pt-ocdi/import_files
run twice?
Do I have to setup demos differently in plugins?Thanks
S
- The topic ‘Import demo data from theme and plugin’ is closed to new replies.