File: /mnt/data/truelysell-wp-demo/catering/wp-content/themes/truelysell/inc/truelysell-demo-content.php
<?php
function truelysell_import_files() {
return [
[
'import_file_name' => 'Truelysell Main',
'categories' => '',
'local_import_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-main/content.xml',
'local_import_widget_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-main/widgets.wie',
'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-main/truelysell-export.dat',
'import_preview_image_url' => get_stylesheet_directory_uri() . '/demo-content/demo-main/screenshot.png',
'preview_url' => 'https://truelysell-wp.dreamstechnologies.com/',
'local_import_redux' => [
[
'file_path' => trailingslashit( get_template_directory() ) . 'demo-content/demo-main/redux.json',
'option_name' => 'truelysell_theme_options',
],
],
],
[
'import_file_name' => 'Truelysell Electrical',
'categories' => '',
'local_import_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-electrical/content.xml',
'local_import_widget_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-electrical/widgets.wie',
'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-electrical/truelysell-export.dat',
'import_preview_image_url' => get_stylesheet_directory_uri() . '/demo-content/demo-electrical/screenshot.png',
'preview_url' => 'https://truelysell-wp.dreamstechnologies.com/electrical/',
'local_import_redux' => [
[
'file_path' => trailingslashit( get_template_directory() ) . 'demo-content/demo-electrical/redux.json',
'option_name' => 'truelysell_theme_options',
],
],
],
[
'import_file_name' => 'Truelysell Multipurpose',
'categories' => '',
'local_import_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-multipurpose/content.xml',
'local_import_widget_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-multipurpose/widgets.wie',
'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-multipurpose/truelysell-export.dat',
'import_preview_image_url' => get_stylesheet_directory_uri() . '/demo-content/demo-multipurpose/screenshot.png',
'preview_url' => 'https://truelysell-wp.dreamstechnologies.com/multipurpose/',
'local_import_redux' => [
[
'file_path' => trailingslashit( get_template_directory() ) . 'demo-content/demo-multipurpose/redux.json',
'option_name' => 'truelysell_theme_options',
],
],
],
[
'import_file_name' => 'Truelysell Saloon',
'categories' => '',
'local_import_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-saloon/content.xml',
'local_import_widget_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-saloon/widgets.wie',
'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-saloon/truelysell-export.dat',
'import_preview_image_url' => get_stylesheet_directory_uri() . '/demo-content/demo-saloon/screenshot.png',
'preview_url' => 'https://truelysell-wp.dreamstechnologies.com/saloon/',
'local_import_redux' => [
[
'file_path' => trailingslashit( get_template_directory() ) . 'demo-content/demo-saloon/redux.json',
'option_name' => 'truelysell_theme_options',
],
],
],
[
'import_file_name' => 'Truelysell Catering',
'categories' => '',
'local_import_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-catering/content.xml',
'local_import_widget_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-catering/widgets.wie',
'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-catering/truelysell-export.dat',
'import_preview_image_url' => get_stylesheet_directory_uri() . '/demo-content/demo-catering/screenshot.png',
'preview_url' => 'https://truelysell-wp.dreamstechnologies.com/catering/',
'local_import_redux' => [
[
'file_path' => trailingslashit( get_template_directory() ) . 'demo-content/demo-catering/redux.json',
'option_name' => 'truelysell_theme_options',
],
],
],
[
'import_file_name' => 'Truelysell Carwash',
'categories' => '',
'local_import_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-carwash/content.xml',
'local_import_widget_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-carwash/widgets.wie',
'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-carwash/truelysell-export.dat',
'import_preview_image_url' => get_stylesheet_directory_uri() . '/demo-content/demo-carwash/screenshot.png',
'preview_url' => 'https://truelysell-wp.dreamstechnologies.com/carwash/',
'local_import_redux' => [
[
'file_path' => trailingslashit( get_template_directory() ) . 'demo-content/demo-carwash/redux.json',
'option_name' => 'truelysell_theme_options',
],
],
],
[
'import_file_name' => 'Truelysell Cleaning',
'categories' => '',
'local_import_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-cleaning/content.xml',
'local_import_widget_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-cleaning/widgets.wie',
'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-cleaning/truelysell-export.dat',
'import_preview_image_url' => get_stylesheet_directory_uri() . '/demo-content/demo-cleaning/screenshot.png',
'preview_url' => 'https://truelysell-wp.dreamstechnologies.com/cleaning/',
'local_import_redux' => [
[
'file_path' => trailingslashit( get_template_directory() ) . 'demo-content/demo-cleaning/redux.json',
'option_name' => 'truelysell_theme_options',
],
],
],
[
'import_file_name' => 'Truelysell House Problem',
'categories' => '',
'local_import_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-houseproblem/content.xml',
'local_import_widget_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-houseproblem/widgets.wie',
'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-houseproblem/truelysell-export.dat',
'import_preview_image_url' => get_stylesheet_directory_uri() . '/demo-content/demo-houseproblem/screenshot.png',
'preview_url' => 'https://truelysell-wp.dreamstechnologies.com/house-problem/',
'local_import_redux' => [
[
'file_path' => trailingslashit( get_template_directory() ) . 'demo-content/demo-houseproblem/redux.json',
'option_name' => 'truelysell_theme_options',
],
],
],
[
'import_file_name' => 'Truelysell Pet Grooming',
'categories' => '',
'local_import_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-petgrooming/content.xml',
'local_import_widget_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-petgrooming/widgets.wie',
'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-petgrooming/truelysell-export.dat',
'import_preview_image_url' => get_stylesheet_directory_uri() . '/demo-content/demo-petgrooming/screenshot.png',
'preview_url' => 'https://truelysell-wp.dreamstechnologies.com/pet-grooming/',
'local_import_redux' => [
[
'file_path' => trailingslashit( get_template_directory() ) . 'demo-content/demo-petgrooming/redux.json',
'option_name' => 'truelysell_theme_options',
],
],
],
[
'import_file_name' => 'Truelysell Mechanic',
'categories' => '',
'local_import_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-mechanic/content.xml',
'local_import_widget_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-mechanic/widgets.wie',
'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'demo-content/demo-mechanic/truelysell-export.dat',
'import_preview_image_url' => get_stylesheet_directory_uri() . '/demo-content/demo-mechanic/screenshot.png',
'preview_url' => 'https://truelysell-wp.dreamstechnologies.com/mechanic/',
'local_import_redux' => [
[
'file_path' => trailingslashit( get_template_directory() ) . 'demo-content/demo-mechanic/redux.json',
'option_name' => 'truelysell_theme_options',
],
],
],
];
}
add_filter( 'ocdi/import_files', 'truelysell_import_files' );
function truelysell_after_import_setup() {
// Assign menus to their locations.
$header_menu = get_term_by( 'name', 'Header menu', 'nav_menu' );
set_theme_mod( 'nav_menu_locations', [
'header_menu' => $header_menu->term_id,
]);
// Assign front page and posts page (blog page).
$front_page_id = get_page_by_title( 'Home' );
$blog_page_id = get_page_by_title( 'Blog' );
update_option( 'show_on_front', 'page' );
update_option( 'page_on_front', $front_page_id->ID );
update_option( 'page_for_posts', $blog_page_id->ID );
}
add_action( 'ocdi/after_import', 'truelysell_after_import_setup' );
function truelysell_after_import_form_options($selected_import) {
if ( 'Truelysell Main' === $selected_import['import_file_name'] ) {
$form_data = 'a:2:{s:15:"keyword_search1";a:16:{s:4:"type";s:8:"texticon";s:4:"name";s:15:"keyword_search1";s:11:"placeholder";s:19:"Car Repair Services";s:9:"css_class";s:6:"style2";s:10:"icon_class";s:16:"fas fa-tv bficon";s:7:"default";s:0:"";s:9:"labeltext";s:30:"What are you looking for? test";s:5:"multi";b:0;s:8:"priority";i:0;s:5:"place";s:4:"main";s:8:"taxonomy";s:0:"";s:3:"max";s:0:"";s:3:"min";s:0:"";s:14:"options_source";s:0:"";s:10:"options_cb";s:0:"";s:7:"options";a:0:{}}s:16:"location_search1";a:16:{s:4:"type";s:12:"locationhome";s:4:"name";s:16:"location_search1";s:11:"placeholder";s:13:"United States";s:9:"css_class";s:6:"style2";s:10:"icon_class";s:28:"fas fa-location-arrow bficon";s:7:"default";s:0:"";s:9:"labeltext";s:8:"Location";s:5:"multi";b:0;s:8:"priority";i:1;s:5:"place";s:4:"main";s:8:"taxonomy";s:0:"";s:3:"max";s:0:"";s:3:"min";s:0:"";s:14:"options_source";s:0:"";s:10:"options_cb";s:0:"";s:7:"options";a:0:{}}}';
}
elseif ( 'Truelysell Multipurpose' === $selected_import['import_file_name'] ) {
$form_data = 'a:2:{s:15:"keyword_search1";a:16:{s:4:"type";s:8:"texticon";s:4:"name";s:15:"keyword_search1";s:11:"placeholder";s:19:"Car Repair Services";s:9:"css_class";s:6:"style2";s:10:"icon_class";s:16:"fas fa-tv bficon";s:7:"default";s:0:"";s:9:"labeltext";s:30:"What are you looking for? test";s:5:"multi";b:0;s:8:"priority";i:0;s:5:"place";s:4:"main";s:8:"taxonomy";s:0:"";s:3:"max";s:0:"";s:3:"min";s:0:"";s:14:"options_source";s:0:"";s:10:"options_cb";s:0:"";s:7:"options";a:0:{}}s:16:"location_search1";a:16:{s:4:"type";s:12:"locationhome";s:4:"name";s:16:"location_search1";s:11:"placeholder";s:13:"United States";s:9:"css_class";s:6:"style2";s:10:"icon_class";s:28:"fas fa-location-arrow bficon";s:7:"default";s:0:"";s:9:"labeltext";s:8:"Location";s:5:"multi";b:0;s:8:"priority";i:1;s:5:"place";s:4:"main";s:8:"taxonomy";s:0:"";s:3:"max";s:0:"";s:3:"min";s:0:"";s:14:"options_source";s:0:"";s:10:"options_cb";s:0:"";s:7:"options";a:0:{}}}';
}
elseif ( 'Truelysell Electrical' === $selected_import['import_file_name'] ) {
$form_data = 'a:2:{s:15:"keyword_search1";a:16:{s:4:"type";s:8:"texticon";s:4:"name";s:15:"keyword_search1";s:11:"placeholder";s:25:"What are you looking for?";s:9:"css_class";s:6:"style1";s:10:"icon_class";s:14:"feather-search";s:7:"default";s:0:"";s:9:"labeltext";s:25:"What are you looking for?";s:5:"multi";b:0;s:8:"priority";i:0;s:5:"place";s:4:"main";s:8:"taxonomy";s:0:"";s:3:"max";s:0:"";s:3:"min";s:0:"";s:14:"options_source";s:0:"";s:10:"options_cb";s:0:"";s:7:"options";a:0:{}}s:16:"location_search1";a:16:{s:4:"type";s:12:"locationhome";s:4:"name";s:16:"location_search1";s:11:"placeholder";s:9:"Location ";s:9:"css_class";s:6:"style1";s:10:"icon_class";s:15:"feather-map-pin";s:7:"default";s:0:"";s:9:"labeltext";s:8:"Location";s:5:"multi";b:0;s:8:"priority";i:1;s:5:"place";s:4:"main";s:8:"taxonomy";s:0:"";s:3:"max";s:0:"";s:3:"min";s:0:"";s:14:"options_source";s:0:"";s:10:"options_cb";s:0:"";s:7:"options";a:0:{}}}';
}
elseif ('Truelysell Saloon' === $selected_import['import_file_name']){
$form_data = 'a:2:{s:15:"keyword_search1";a:16:{s:4:"type";s:8:"texticon";s:4:"name";s:15:"keyword_search1";s:11:"placeholder";s:19:"Car Repair Services";s:9:"css_class";s:6:"style2";s:10:"icon_class";s:16:"fas fa-tv bficon";s:7:"default";s:0:"";s:9:"labeltext";s:25:"What are you looking for?";s:5:"multi";b:0;s:8:"priority";i:0;s:5:"place";s:4:"main";s:8:"taxonomy";s:0:"";s:3:"max";s:0:"";s:3:"min";s:0:"";s:14:"options_source";s:0:"";s:10:"options_cb";s:0:"";s:7:"options";a:0:{}}s:16:"location_search1";a:16:{s:4:"type";s:12:"locationhome";s:4:"name";s:16:"location_search1";s:11:"placeholder";s:13:"United States";s:9:"css_class";s:6:"style2";s:10:"icon_class";s:15:"feather-map-pin";s:7:"default";s:0:"";s:9:"labeltext";s:8:"Location";s:5:"multi";b:0;s:8:"priority";i:1;s:5:"place";s:4:"main";s:8:"taxonomy";s:0:"";s:3:"max";s:0:"";s:3:"min";s:0:"";s:14:"options_source";s:0:"";s:10:"options_cb";s:0:"";s:7:"options";a:0:{}}}';
}
elseif ('Truelysell Catering' === $selected_import['import_file_name']){
$form_data = 'a:2:{s:15:"keyword_search1";a:16:{s:4:"type";s:8:"texticon";s:4:"name";s:15:"keyword_search1";s:11:"placeholder";s:19:"Car Repair Services";s:9:"css_class";s:6:"style2";s:10:"icon_class";s:16:"fas fa-tv bficon";s:7:"default";s:0:"";s:9:"labeltext";s:25:"What are you looking for?";s:5:"multi";b:0;s:8:"priority";i:0;s:5:"place";s:4:"main";s:8:"taxonomy";s:0:"";s:3:"max";s:0:"";s:3:"min";s:0:"";s:14:"options_source";s:0:"";s:10:"options_cb";s:0:"";s:7:"options";a:0:{}}s:16:"location_search1";a:16:{s:4:"type";s:12:"locationhome";s:4:"name";s:16:"location_search1";s:11:"placeholder";s:13:"United States";s:9:"css_class";s:6:"style2";s:10:"icon_class";s:15:"feather-map-pin";s:7:"default";s:0:"";s:9:"labeltext";s:8:"Location";s:5:"multi";b:0;s:8:"priority";i:1;s:5:"place";s:4:"main";s:8:"taxonomy";s:0:"";s:3:"max";s:0:"";s:3:"min";s:0:"";s:14:"options_source";s:0:"";s:10:"options_cb";s:0:"";s:7:"options";a:0:{}}}';
}
elseif ('Truelysell Carwash' === $selected_import['import_file_name']){
$form_data = 'a:2:{s:15:"keyword_search1";a:16:{s:4:"type";s:8:"texticon";s:4:"name";s:15:"keyword_search1";s:11:"placeholder";s:19:"Car Repair Services";s:9:"css_class";s:6:"style2";s:10:"icon_class";s:16:"fas fa-tv bficon";s:7:"default";s:0:"";s:9:"labeltext";s:25:"What are you looking for?";s:5:"multi";b:0;s:8:"priority";i:0;s:5:"place";s:4:"main";s:8:"taxonomy";s:0:"";s:3:"max";s:0:"";s:3:"min";s:0:"";s:14:"options_source";s:0:"";s:10:"options_cb";s:0:"";s:7:"options";a:0:{}}s:16:"location_search1";a:16:{s:4:"type";s:12:"locationhome";s:4:"name";s:16:"location_search1";s:11:"placeholder";s:13:"United States";s:9:"css_class";s:6:"style2";s:10:"icon_class";s:15:"feather-map-pin";s:7:"default";s:0:"";s:9:"labeltext";s:8:"Location";s:5:"multi";b:0;s:8:"priority";i:1;s:5:"place";s:4:"main";s:8:"taxonomy";s:0:"";s:3:"max";s:0:"";s:3:"min";s:0:"";s:14:"options_source";s:0:"";s:10:"options_cb";s:0:"";s:7:"options";a:0:{}}}';
}
elseif ('Truelysell Cleaning' === $selected_import['import_file_name']){
$form_data = 'a:2:{s:15:"keyword_search1";a:16:{s:4:"type";s:8:"texticon";s:4:"name";s:15:"keyword_search1";s:11:"placeholder";s:19:"Car Repair Services";s:9:"css_class";s:6:"style2";s:10:"icon_class";s:16:"fas fa-tv bficon";s:7:"default";s:0:"";s:9:"labeltext";s:25:"What are you looking for?";s:5:"multi";b:0;s:8:"priority";i:0;s:5:"place";s:4:"main";s:8:"taxonomy";s:0:"";s:3:"max";s:0:"";s:3:"min";s:0:"";s:14:"options_source";s:0:"";s:10:"options_cb";s:0:"";s:7:"options";a:0:{}}s:16:"location_search1";a:16:{s:4:"type";s:12:"locationhome";s:4:"name";s:16:"location_search1";s:11:"placeholder";s:13:"United States";s:9:"css_class";s:6:"style2";s:10:"icon_class";s:15:"feather-map-pin";s:7:"default";s:0:"";s:9:"labeltext";s:8:"Location";s:5:"multi";b:0;s:8:"priority";i:1;s:5:"place";s:4:"main";s:8:"taxonomy";s:0:"";s:3:"max";s:0:"";s:3:"min";s:0:"";s:14:"options_source";s:0:"";s:10:"options_cb";s:0:"";s:7:"options";a:0:{}}}';
}
elseif ('Truelysell House Problem' === $selected_import['import_file_name']){
$form_data = 'a:2:{s:15:"keyword_search1";a:16:{s:4:"type";s:8:"texticon";s:4:"name";s:15:"keyword_search1";s:11:"placeholder";s:19:"Car Repair Services";s:9:"css_class";s:6:"style2";s:10:"icon_class";s:16:"fas fa-tv bficon";s:7:"default";s:0:"";s:9:"labeltext";s:25:"What are you looking for?";s:5:"multi";b:0;s:8:"priority";i:0;s:5:"place";s:4:"main";s:8:"taxonomy";s:0:"";s:3:"max";s:0:"";s:3:"min";s:0:"";s:14:"options_source";s:0:"";s:10:"options_cb";s:0:"";s:7:"options";a:0:{}}s:16:"location_search1";a:16:{s:4:"type";s:12:"locationhome";s:4:"name";s:16:"location_search1";s:11:"placeholder";s:13:"United States";s:9:"css_class";s:6:"style2";s:10:"icon_class";s:15:"feather-map-pin";s:7:"default";s:0:"";s:9:"labeltext";s:8:"Location";s:5:"multi";b:0;s:8:"priority";i:1;s:5:"place";s:4:"main";s:8:"taxonomy";s:0:"";s:3:"max";s:0:"";s:3:"min";s:0:"";s:14:"options_source";s:0:"";s:10:"options_cb";s:0:"";s:7:"options";a:0:{}}}';
}
elseif ('Truelysell Pet Grooming' === $selected_import['import_file_name']){
$form_data = 'a:2:{s:15:"keyword_search1";a:16:{s:4:"type";s:8:"texticon";s:4:"name";s:15:"keyword_search1";s:11:"placeholder";s:19:"Car Repair Services";s:9:"css_class";s:6:"style2";s:10:"icon_class";s:16:"fas fa-tv bficon";s:7:"default";s:0:"";s:9:"labeltext";s:25:"What are you looking for?";s:5:"multi";b:0;s:8:"priority";i:0;s:5:"place";s:4:"main";s:8:"taxonomy";s:0:"";s:3:"max";s:0:"";s:3:"min";s:0:"";s:14:"options_source";s:0:"";s:10:"options_cb";s:0:"";s:7:"options";a:0:{}}s:16:"location_search1";a:16:{s:4:"type";s:12:"locationhome";s:4:"name";s:16:"location_search1";s:11:"placeholder";s:13:"United States";s:9:"css_class";s:6:"style2";s:10:"icon_class";s:15:"feather-map-pin";s:7:"default";s:0:"";s:9:"labeltext";s:8:"Location";s:5:"multi";b:0;s:8:"priority";i:1;s:5:"place";s:4:"main";s:8:"taxonomy";s:0:"";s:3:"max";s:0:"";s:3:"min";s:0:"";s:14:"options_source";s:0:"";s:10:"options_cb";s:0:"";s:7:"options";a:0:{}}}';
}
elseif ('Truelysell Mechanic' === $selected_import['import_file_name']){
$form_data = 'a:2:{s:15:"keyword_search1";a:16:{s:4:"type";s:8:"texticon";s:4:"name";s:15:"keyword_search1";s:11:"placeholder";s:19:"Car Repair Services";s:9:"css_class";s:6:"style2";s:10:"icon_class";s:16:"fas fa-tv bficon";s:7:"default";s:0:"";s:9:"labeltext";s:25:"What are you looking for?";s:5:"multi";b:0;s:8:"priority";i:0;s:5:"place";s:4:"main";s:8:"taxonomy";s:0:"";s:3:"max";s:0:"";s:3:"min";s:0:"";s:14:"options_source";s:0:"";s:10:"options_cb";s:0:"";s:7:"options";a:0:{}}s:16:"location_search1";a:16:{s:4:"type";s:12:"locationhome";s:4:"name";s:16:"location_search1";s:11:"placeholder";s:13:"United States";s:9:"css_class";s:6:"style2";s:10:"icon_class";s:15:"feather-map-pin";s:7:"default";s:0:"";s:9:"labeltext";s:8:"Location";s:5:"multi";b:0;s:8:"priority";i:1;s:5:"place";s:4:"main";s:8:"taxonomy";s:0:"";s:3:"max";s:0:"";s:3:"min";s:0:"";s:14:"options_source";s:0:"";s:10:"options_cb";s:0:"";s:7:"options";a:0:{}}}';
}
$serialized_data = unserialize($form_data);
update_option( 'truelysell_search_on_home_page_form_fields', $serialized_data );
}
add_action( 'ocdi/after_import', 'truelysell_after_import_form_options' );