forked from primozcigler/wordpress-one-click-demo-install
-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.php
77 lines (64 loc) · 1.71 KB
/
example.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
/**
* Version 0.0.2
*
* This file is just the example, do to require it directly. Instead copy it to your theme and modify by your own needs.
*/
require_once get_template_directory() . '/path/to/radium-importer.php' ; //load admin theme data importer
class Radium_Theme_Demo_Data_Importer extends Radium_Theme_Importer {
/**
* Holds a copy of the object for easy reference.
*
* @since 0.0.1
*
* @var object
*/
private static $instance;
/**
* Set the key to be used to store theme options
*
* @since 0.0.2
*
* @var object
*/
public $theme_option_name = 'my_theme_options_name'; //set theme options name here
public $theme_options_file_name = 'theme_options.txt';
public $widgets_file_name = 'widgets.json';
public $content_demo_file_name = 'content.xml';
/**
* Holds a copy of the widget settings
*
* @since 0.0.2
*
* @var object
*/
public $widget_import_results;
/**
* Constructor. Hooks all interactions to initialize the class.
*
* @since 0.0.1
*/
public function __construct() {
$this->demo_files_path = dirname(__FILE__) . '/demo-files/';
self::$instance = $this;
parent::__construct();
}
/**
* Add menus
*
* @since 0.0.1
*/
public function set_demo_menus(){
// Menus to Import and assign - you can remove or add as many as you want
$top_menu = get_term_by('name', 'Top Menu', 'nav_menu');
$main_menu = get_term_by('name', 'Main Menu', 'nav_menu');
$footer_menu = get_term_by('name', 'Main Menu', 'nav_menu');
set_theme_mod( 'nav_menu_locations', array(
'top-menu' => $top_menu->term_id,
'primary' => $main_menu->term_id,
'footer-menu' => $footer_menu->term_id
)
);
}
}
new Radium_Theme_Demo_Data_Importer;