-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.php
executable file
·191 lines (148 loc) · 6.93 KB
/
init.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<?php
$defaults = array(
'portfolio_post_type' => '0',
'pricing_post_type' => '0',
'team_post_type' => '0',
'client_post_type' => '0',
'events_post_type' => '0',
'service_post_type' => '0',
'testimonial_post_type' => '0',
'faq_post_type' => '0',
//Metaboxes
'rwmbmetabox' => '0',
//Demo Importer
'demo_importer' => '0',
// Victor
'victor_shortcode_blocks' => '0',
'victor_shortcodes' => '0',
// Owlfolio
'owlfolio_shortcode_blocks' => '0',
'owlfolio_shortcodes' => '0',
// AA WP
'aa_shortcode_blocks' => '0',
'aa_shortcodes' => '0',
// Bronx WP
'bronx_shortcode_blocks' => '0',
'bronx_shortcodes' => '0',
);
$jeweltheme_options = wp_parse_args( get_option('jeweltheme_options'), $defaults);
/**
* Register Post Types
*/
if( '1' == $jeweltheme_options['portfolio_post_type'] ){
add_action( 'init', 'jeweltheme_essentials_register_portfolio', 10 );
add_action( 'init', 'jeweltheme_essentials_create_portfolio_taxonomies', 10 );
}
if( '1' == $jeweltheme_options['pricing_post_type'] ){
add_action( 'init', 'jeweltheme_essentials_register_pricing', 10 );
add_action( 'init', 'jeweltheme_essentials_create_pricing_taxonomies', 10 );
}
if( '1' == $jeweltheme_options['team_post_type'] ){
add_action( 'init', 'jeweltheme_essentials_register_team', 10 );
add_action( 'init', 'jeweltheme_essentials_create_team_taxonomies', 10 );
}
if( '1' == $jeweltheme_options['client_post_type'] ){
add_action( 'init', 'jeweltheme_essentials_register_client', 10 );
add_action( 'init', 'jeweltheme_essentials_create_client_taxonomies', 10 );
}
if( '1' == $jeweltheme_options['events_post_type'] ){
add_action( 'init', 'jeweltheme_essentials_register_events', 10 );
add_action( 'init', 'jeweltheme_essentials_create_events_taxonomies', 10 );
}
if( '1' == $jeweltheme_options['service_post_type'] ){
add_action( 'init', 'jeweltheme_essentials_register_services', 10 );
}
if( '1' == $jeweltheme_options['testimonial_post_type'] ){
add_action( 'init', 'jeweltheme_essentials_register_testimonial', 10 );
add_action( 'init', 'jeweltheme_essentials_create_testimonial_taxonomies', 10 );
}
if( '1' == $jeweltheme_options['faq_post_type'] ){
add_action( 'init', 'jeweltheme_essentials_register_faq', 10 );
add_action( 'init', 'jeweltheme_essentials_create_faq_taxonomies', 10 );
}
if( '1' == $jeweltheme_options['demo_importer'] ){
require_once( JEWELTHEME_ESSENTIAL_PATH . 'inc/demo-importer/one-click-demo-import.php' );
}
if( '1' == $jeweltheme_options['victor_shortcodes'] ){
require_once( JEWELTHEME_ESSENTIAL_PATH . 'themes/victor.php' );
}
if( '1' == $jeweltheme_options['owlfolio_shortcodes'] ){
require_once( JEWELTHEME_ESSENTIAL_PATH . 'themes/owlfolio.php' );
}
if( '1' == $jeweltheme_options['aa_shortcodes'] ){
require_once( JEWELTHEME_ESSENTIAL_PATH . 'themes/aa-wp.php' );
}
if( '1' == $jeweltheme_options['bronx_shortcodes'] ){
require_once( JEWELTHEME_ESSENTIAL_PATH . 'themes/bronx-wp.php' );
}
/*
* RWMB Metabox
* @author http://www.deluxeblogtips.com/meta-box
*/
if( '1' == $jeweltheme_options['rwmbmetabox'] ){
require_once( JEWELTHEME_ESSENTIAL_PATH . 'meta-box/meta-box.php' );
}
/*===================================================================================
* Custom Posts Query with Sorting Order
* =================================================================================*/
function js_essential_get_custom_posts($type, $limit = 20, $order = "DESC"){
wp_reset_postdata();
$args = array(
"posts_per_page" => $limit,
"post_type" => $type,
'orderby' => 'menu_order',
"order" => $order,
);
$custom_posts = get_posts($args);
return $custom_posts;
}
// Victor Shortcodes
if( '1' == $jeweltheme_options['victor_shortcode_blocks'] ){
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/victor/header-section.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/victor/work.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/victor/counter.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/victor/carousel.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/victor/promo.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/victor/about_content.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/victor/blog.php' );
}
// Owlfolio Shortcodes
if( '1' == $jeweltheme_options['owlfolio_shortcode_blocks'] ){
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/owlfolio/section-title.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/owlfolio/maps.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/owlfolio/animated-text.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/owlfolio/services.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/owlfolio/team.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/owlfolio/client-logos.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/owlfolio/portfolio.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/owlfolio/testimonial.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/owlfolio/blog.php' );
}
// AA WP Shortcodes
if( '1' == $jeweltheme_options['aa_shortcode_blocks'] ){
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/aa/section-title.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/aa/maps.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/aa/contact-details.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/aa/pricing.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/aa/quotes.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/aa/about_content.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/aa/features.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/aa/counter.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/aa/skills.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/aa/banner.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/aa/blog.php' );
// require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/aa/animated-text.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/aa/services.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/aa/team.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/aa/client-logos.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/aa/portfolio.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/aa/testimonial.php' );
// require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/aa/blog.php' );
}
// Bronx Shortcodes
if( '1' == $jeweltheme_options['bronx_shortcode_blocks'] ){
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/bronx/blog.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/bronx/counter.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/bronx/client-logos.php' );
require_once( JEWELTHEME_ESSENTIAL_PATH . 'shortcodes/bronx/portfolio.php' );
}