PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.5.13
Shortcodes and extra features for Phlox theme v2.5.13
2.17.21 2.17.20 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.6 1.0.9 1.1.0 1.3.0 1.3.1 1.3.10 1.3.14 1.3.2 1.3.3 1.3.6 1.4.0 1.4.1 1.4.2 1.5.0 1.5.2 1.6.0 1.6.2 1.6.4 1.7.0 1.7.2 2.10.0 2.10.1 2.10.3 2.10.5 2.10.7 2.10.8 2.10.9 2.11.0 2.11.1 2.11.2 2.12.0 2.14.0 2.15.0 2.15.2 2.15.4 2.15.5 2.15.6 2.15.7 2.15.8 2.15.9 2.16.0 2.16.1 2.16.2 2.16.3 2.16.4 2.17.0 2.17.1 2.17.12 2.17.13 2.17.14 2.17.15 2.17.16 2.17.2 2.17.3 2.17.4 2.17.5 2.17.6 2.17.8 2.17.9 2.4.12 2.4.13 2.4.14 2.4.16 2.4.18 2.4.19 2.4.9 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.14 2.5.15 2.5.16 2.5.17 2.5.19 2.5.2 2.5.20 2.5.3 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.10 2.6.12 2.6.13 2.6.14 2.6.15 2.6.16 2.6.17 2.6.19 2.6.2 2.6.20 2.6.4 2.6.5 2.6.7 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.9 2.9.0 2.9.12 2.9.14 2.9.15 2.9.16 2.9.17 2.9.18 2.9.19 2.9.2 2.9.20 2.9.21 2.9.22 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8
auxin-elements / includes / general-hooks.php
auxin-elements / includes Last commit date
classes 6 years ago elementor 6 years ago elements 6 years ago define.php 6 years ago general-functions.php 6 years ago general-hooks.php 6 years ago general-shortcodes.php 9 years ago index.php 7 years ago
general-hooks.php
3445 lines
1 <?php
2 /**
3 * Before Single Products Summary Div
4 *
5 *
6 * @package Auxin
7 * @license LICENSE.txt
8 * @author averta
9 * @link http://phlox.pro/
10 * @copyright (c) 2010-2020 averta
11 */
12
13
14
15 /**
16 * Adds a mian css class indicator to body tag
17 *
18 * @param array $classes List of body css classes
19 * @return array The modified list of body css classes
20 */
21 function auxels_body_class( $classes ) {
22 $classes[] = '_auxels';
23
24 return $classes;
25 }
26 add_filter( 'body_class', 'auxels_body_class' );
27
28
29 /**
30 * Add meta custom field types for vc
31 *
32 * @return void
33 */
34 function auxin_add_vc_field_types(){
35
36 if ( defined( 'WPB_VC_VERSION' ) ) {
37
38 // aux_iconpicker field type definition for VC
39 vc_add_shortcode_param( 'aux_iconpicker', 'auxin_aux_iconpicker_settings_field', ADMIN_JS_URL . 'scripts.js' );
40 function auxin_aux_iconpicker_settings_field( $settings, $value ) {
41
42 $font_icons = Auxin()->Font_Icons->get_icons_list('fontastic');
43 $output = '<div class="aux-element-field aux-iconpicker">';
44 $output .= sprintf( '<select name="%1$s" id="%1$s" class="aux-fonticonpicker aux-select wpb_vc_param_value wpb-select ' .
45 esc_attr( $settings['param_name'] ) . ' ' . $settings['type'] . '_field" >', esc_attr($settings['param_name']) );
46 $output .= '<option value="">' . __('Choose ..', 'auxin-elements') . '</option>';
47
48 if( is_array( $font_icons ) ) {
49 foreach ( $font_icons as $icon ) {
50 $icon_id = trim( $icon->classname, '.' );
51 // $output .= '<option value="'. $icon_id .'" '. selected( $instance[$id], $icon_id, false ) .' >'. $icon->name . '</option>';
52 $output .= '<option value="'. $icon_id .'" '. selected( esc_attr( $value ) , $icon_id, false ) .' >'. $icon->name . '</option>';
53
54 }
55 }
56
57 $output .= '</select>';
58 $output .= '</div>';
59
60 return $output; // This is html markup that will be outputted in content elements edit form
61 }
62
63 // aux_visual_select field type definition for VC
64 vc_add_shortcode_param( 'aux_visual_select', 'auxin_aux_visual_select_settings_field', ADMIN_JS_URL . 'scripts.js' );
65 function auxin_aux_visual_select_settings_field( $settings, $value ) {
66
67 $output = '<select name="' . esc_attr($settings['param_name']) .
68 '" class="aux-element-field visual-select-wrapper wpb_vc_param_value wpb-select ' .
69 esc_attr( $settings['param_name'] ) . ' ' . $settings['type'] . '_field" '.
70 ' id="' . esc_attr($settings['param_name']) .
71 '" data-option="' . esc_attr( $value ) . '" >';
72 foreach ( $settings['choices'] as $id => $option_info ) {
73 $active_attr = ( $id == esc_attr( $value ) ) ? 'selected' : '';
74 $data_class = isset( $option_info['css_class'] ) && ! empty( $option_info['css_class'] ) ? 'data-class="'. $option_info['css_class'].'"' : '';
75 $data_symbol = empty( $data_class ) && isset( $option_info['image'] ) && ! empty( $option_info['image'] ) ? 'data-symbol="'. $option_info['image'].'"' : '';
76 $data_video = ! empty( $option_info['video_src'] ) ? 'data-video-src="'. esc_attr( $option_info['video_src'] ).'"' : '';
77 $css_classs = 'class="'. ($id) .'"';
78 $output .= sprintf( '<option value="%s" %s %s %s %s %s>%s</option>', $id,$css_classs, $active_attr, $data_symbol, $data_video, $data_class, $option_info['label'] );
79 }
80 $output .= '</select>';
81
82 return $output; // This is html markup that will be outputted in content elements edit form
83 }
84
85 // aux_select_audio field type definition for VC
86 vc_add_shortcode_param( 'aux_select_audio', 'aux_select_audio_settings_field', ADMIN_JS_URL . 'scripts.js' );
87 function aux_select_audio_settings_field( $settings, $value ) {
88
89 // Store attachment src for avertaAttachMedia field
90 if( !empty( $value) ) {
91 $att_ids = explode( ',', $value );
92 $attach_ids_list = auxin_get_the_resized_attachment_src( $att_ids, 80, 80, true );
93 if(!empty($att_ids)) {
94 printf( "<script>auxin.attachmedia = jQuery.extend( auxin.attachmedia, %s );</script>", wp_json_encode( array_unique( $attach_ids_list ) ) );
95 }
96 }
97 $output = '';
98 $output .= '<div class="aux-element-field av3_container aux_select_image axi-attachmedia-wrapper">'.
99 '<input type="text" class="wpb-multiselect wpb_vc_param_value ' . esc_sql($settings['param_name']) . ' ' . $settings['type'] . '_field" name="' . esc_attr($settings['param_name']) . '" ' . 'id="' . esc_attr($settings['param_name']) . '" '
100 . 'value="' . esc_attr( $value ) . '" data-media-type="audio" data-limit="1" data-multiple="0"'
101 .'data-add-to-list="'.__('Add Audio', 'auxin-elements').'" '
102 .'data-uploader-submit="'.__('Add Audio', 'auxin-elements').'"'
103 .'data-uploader-title="'.__('Select Audio', 'auxin-elements').'"> '
104 .'</div>';
105
106 return $output; // This is html markup that will be outputted in content elements edit form
107 }
108
109 // aux_select_video field type definition for VC
110 vc_add_shortcode_param( 'aux_select_video', 'aux_select_video_settings_field', ADMIN_JS_URL . 'scripts.js' );
111 function aux_select_video_settings_field( $settings, $value ) {
112
113 // Store attachment src for avertaAttachMedia field
114 if( !empty( $value) ) {
115 $att_ids = explode( ',', $value );
116 $attach_ids_list = auxin_get_the_resized_attachment_src( $att_ids, 80, 80, true );
117 if(!empty($att_ids)) {
118 printf( "<script>auxin.attachmedia = jQuery.extend( auxin.attachmedia, %s );</script>", wp_json_encode( array_unique( $attach_ids_list ) ) );
119 }
120 }
121 $output = '';
122 $output .= '<div class="aux-element-field av3_container aux_select_image axi-attachmedia-wrapper">'.
123 '<input type="text" class="wpb-multiselect wpb_vc_param_value ' . esc_sql($settings['param_name']) . ' ' . $settings['type'] . '_field" name="' . esc_attr($settings['param_name']) . '" ' . 'id="' . esc_attr($settings['param_name']) . '" '
124 . 'value="' . esc_attr( $value ) . '" data-media-type="video" data-limit="1" data-multiple="0"'
125 .'data-add-to-list="'.__('Add Video', 'auxin-elements').'" '
126 .'data-uploader-submit="'.__('Add Video', 'auxin-elements').'"'
127 .'data-uploader-title="'.__('Select Video', 'auxin-elements').'"> '
128 .'</div>';
129
130 return $output; // This is html markup that will be outputted in content elements edit form
131 }
132
133 // aux_select2_multiple field type definition for VC
134 vc_add_shortcode_param( 'aux_select2_multiple', 'aux_multiple_selector_settings_field', ADMIN_JS_URL . 'scripts.js' );
135 function aux_multiple_selector_settings_field( $settings, $value ) {
136
137 if( gettype( $value ) === "string" ) {
138 $value = explode( ",", $value);
139 }
140 $select = $value;
141 $output = '';
142 $output .= '<select multiple="multiple" name="' . esc_sql($settings['param_name']) . '" style="width:100%" ' . ' class="wpb-multiselect wpb_vc_param_value aux-select2-multiple ' . esc_sql($settings['param_name']) . ' ' . $settings['type'] . '_field" '. '>';
143 foreach ( $settings['value'] as $id => $option_info ) {
144 $active_attr = in_array( $id, $select) ? 'selected="selected"' : '';
145 $output .= sprintf( '<option value="%s" %s >%s</option>', $id, $active_attr, $option_info );
146 }
147 $output.= '</select>';
148
149 return $output; // This is html markup that will be outputted in content elements edit form
150 }
151
152 // aux_taxonomy field type definition for VC
153 vc_add_shortcode_param( 'aux_taxonomy', 'aux_taxonomy_selector_settings_field', ADMIN_JS_URL . 'scripts.js' );
154 function aux_taxonomy_selector_settings_field( $settings, $value ) {
155
156 $categories = get_terms(
157 array( 'taxonomy' => $settings['taxonomy'],
158 'orderby' => 'count',
159 'hide_empty' => true
160 ));
161
162 $categories_list = array( ' ' => __('All Categories', 'auxin-elements' ) );
163 foreach ( $categories as $key => $value_id ) {
164 $categories_list[$value_id->term_id] = $value_id->name;
165 }
166 if( gettype( $value ) === "string" ) {
167 $value = explode( ",", $value);
168 }
169 $selected = $value;
170 $output = '';
171 $output .= '<select multiple="multiple" name="' . $settings['param_name'] . '" style="width:100%" ' . ' class="wpb-multiselect wpb_vc_param_value aux-select2-multiple ' . esc_sql($settings['param_name']) . ' ' . 'aux-admin-select2 ' . $settings['type'] . '_field" '. '>';
172 foreach ( $categories_list as $id => $options_info ) {
173 $active_attr = in_array( $id, $selected) ? 'selected="selected"' : '';
174 $output .= sprintf( '<option value="%s" %s >%s</option>', $id, $active_attr, $options_info );
175 }
176 $output.= '</select>';
177
178 return $output; // This is html markup that will be outputted in content elements edit form
179 }
180
181 vc_add_shortcode_param( 'aux_switch', 'auxin_aux_switch_settings_field', ADMIN_JS_URL . 'scripts.js' );
182 function auxin_aux_switch_settings_field( $settings, $value ) {
183 $active_attr = auxin_is_true( $value ) ? 'checked="checked"' : '';
184 return '<div class="av3_container aux_switch">'.
185 '<input type="checkbox" name="' . esc_attr( $settings['param_name'] ) . '" class="wpb_vc_param_value wpb_checkbox checkbox '.
186 esc_attr( $settings['param_name'] ) . ' ' .
187 esc_attr( $settings['type'] ) . '_field' .
188 '" value="' . esc_attr( $value ) . '" ' . $active_attr . ' >' .
189 '</div>'; // This is html markup that will be outputted in content elements edit form
190 }
191
192
193
194 }
195
196 /**
197 * Enqueue all my widget's admin scripts
198 */
199 function auxin_widgets_enqueue_scripts(){
200 wp_enqueue_script('auxin_widget');
201
202 }
203 add_action( 'admin_print_scripts-widgets.php', 'auxin_widgets_enqueue_scripts' );
204
205 // Add this to enqueue your scripts on Page Builder too
206 add_action('siteorigin_panel_enqueue_admin_scripts', 'auxin_widgets_enqueue_scripts');
207
208 /**
209 * This part is for adding Auxin font icon to Visual composer icon
210 * this is just temporary and need to move and write in a better manner when it is compelete
211 * TODO: just for now to see it is working
212 */
213
214 // Add Auxin icons to Visual Composer icons
215 $settings = array(
216 'name' => __( 'Auxin Icons', 'auxin-elements' ),
217 'category' => THEME_NAME,
218 'params' => array(
219 array(
220 'type' => 'dropdown',
221 'heading' => __( 'Icon library', 'auxin-elements' ),
222 'value' => array(
223 __( 'Font Awesome', 'auxin-elements' ) => 'fontawesome',
224 __( 'Open Iconic', 'auxin-elements' ) => 'openiconic',
225 __( 'Typicons', 'auxin-elements' ) => 'typicons',
226 __( 'Entypo', 'auxin-elements' ) => 'entypo',
227 __( 'Linecons', 'auxin-elements' ) => 'linecons',
228 __( 'Auxin', 'auxin-elements' ) => 'auxin'
229 ),
230 'admin_label' => true,
231 'param_name' => 'type',
232 'description' => __( 'Select icon library.', 'auxin-elements' )
233 ),
234 array(
235 'type' => 'iconpicker',
236 'heading' => __( 'Icon', 'auxin-elements' ),
237 'param_name' => 'icon_auxin',
238 'value' => 'auxin-icon-basket-1', // default value to backend editor admin_label
239 'settings' => array(
240 'emptyIcon' => false,
241 // default true, display an "EMPTY" icon?
242 'type' => 'auxin',
243 'iconsPerPage' => 4000
244 // default 100, how many icons per/page to display, we use (big number) to display all icons in single page
245 ),
246 'dependency' => array(
247 'element' => 'type',
248 'value' => 'auxin'
249 ),
250 'description' => __( 'Select icon from library.', 'auxin-elements' )
251 ),
252 array(
253 'type' => 'iconpicker',
254 'heading' => __( 'Icon', 'auxin-elements' ),
255 'param_name' => 'icon_fontawesome',
256 'value' => 'fa fa-adjust', // default value to backend editor admin_label
257 'settings' => array(
258 'emptyIcon' => false,
259 // default true, display an "EMPTY" icon?
260 'iconsPerPage' => 4000
261 // default 100, how many icons per/page to display, we use (big number) to display all icons in single page
262 ),
263 'dependency' => array(
264 'element' => 'type',
265 'value' => 'fontawesome'
266 ),
267 'description' => __( 'Select icon from library.', 'auxin-elements' )
268 ),
269 array(
270 'type' => 'iconpicker',
271 'heading' => __( 'Icon', 'auxin-elements' ),
272 'param_name' => 'icon_openiconic',
273 'value' => 'vc-oi vc-oi-dial', // default value to backend editor admin_label
274 'settings' => array(
275 'emptyIcon' => false, // default true, display an "EMPTY" icon?
276 'type' => 'openiconic',
277 'iconsPerPage' => 4000 // default 100, how many icons per/page to display
278 ),
279 'dependency' => array(
280 'element' => 'type',
281 'value' => 'openiconic'
282 ),
283 'description' => __( 'Select icon from library.', 'auxin-elements' )
284 ),
285 array(
286 'type' => 'iconpicker',
287 'heading' => __( 'Icon', 'auxin-elements' ),
288 'param_name' => 'icon_typicons',
289 'value' => 'typcn typcn-adjust-brightness', // default value to backend editor admin_label
290 'settings' => array(
291 'emptyIcon' => false, // default true, display an "EMPTY" icon?
292 'type' => 'typicons',
293 'iconsPerPage' => 4000 // default 100, how many icons per/page to display
294 ),
295 'dependency' => array(
296 'element' => 'type',
297 'value' => 'typicons'
298 ),
299 'description' => __( 'Select icon from library.', 'auxin-elements' )
300 ),
301 array(
302 'type' => 'iconpicker',
303 'heading' => __( 'Icon', 'auxin-elements' ),
304 'param_name' => 'icon_entypo',
305 'value' => 'entypo-icon entypo-icon-note', // default value to backend editor admin_label
306 'settings' => array(
307 'emptyIcon' => false, // default true, display an "EMPTY" icon?
308 'type' => 'entypo',
309 'iconsPerPage' => 4000 // default 100, how many icons per/page to display
310 ),
311 'dependency' => array(
312 'element' => 'type',
313 'value' => 'entypo'
314 ),
315 ),
316 array(
317 'type' => 'iconpicker',
318 'heading' => __( 'Icon', 'auxin-elements' ),
319 'param_name' => 'icon_linecons',
320 'value' => 'vc_li vc_li-heart', // default value to backend editor admin_label
321 'settings' => array(
322 'emptyIcon' => false, // default true, display an "EMPTY" icon?
323 'type' => 'linecons',
324 'iconsPerPage' => 4000 // default 100, how many icons per/page to display
325 ),
326 'dependency' => array(
327 'element' => 'type',
328 'value' => 'linecons'
329 ),
330 'description' => __( 'Select icon from library.', 'auxin-elements' ),
331 ),
332
333 array(
334 'type' => 'colorpicker',
335 'heading' => __( 'Custom color', 'auxin-elements' ),
336 'param_name' => 'custom_color',
337 'description' => __( 'Select custom icon color.', 'auxin-elements' ),
338 'dependency' => array(
339 'element' => 'color',
340 'value' => 'custom'
341 ),
342 ),
343 array(
344 'type' => 'dropdown',
345 'heading' => __( 'Background shape', 'auxin-elements' ),
346 'param_name' => 'background_style',
347 'value' => array(
348 __( 'None', 'auxin-elements' ) => '',
349 __( 'Circle', 'auxin-elements' ) => 'rounded',
350 __( 'Square', 'auxin-elements' ) => 'boxed',
351 __( 'Rounded', 'auxin-elements' ) => 'rounded-less',
352 __( 'Outline Circle', 'auxin-elements' ) => 'rounded-outline',
353 __( 'Outline Square', 'auxin-elements' ) => 'boxed-outline',
354 __( 'Outline Rounded', 'auxin-elements' ) => 'rounded-less-outline'
355 ),
356 'description' => __( 'Select background shape and style for icon.', 'auxin-elements' )
357 ),
358
359 array(
360 'type' => 'colorpicker',
361 'heading' => __( 'Custom background color', 'auxin-elements' ),
362 'param_name' => 'custom_background_color',
363 'description' => __( 'Select custom icon background color.', 'auxin-elements' ),
364 'dependency' => array(
365 'element' => 'background_color',
366 'value' => 'custom'
367 ),
368 ),
369
370 array(
371 'type' => 'dropdown',
372 'heading' => __( 'Icon alignment', 'auxin-elements' ),
373 'param_name' => 'align',
374 'value' => array(
375 __( 'Left', 'auxin-elements' ) => 'left',
376 __( 'Right', 'auxin-elements' ) => 'right',
377 __( 'Center', 'auxin-elements' ) => 'center'
378 ),
379 'description' => __( 'Select icon alignment.', 'auxin-elements' ),
380 ),
381
382 ),
383
384 );
385
386 if ( defined( 'WPB_VC_VERSION' ) ) {
387
388 // vc_map_update('vc_icon', $settings );
389
390 // TODO: This is a sample we need to create an array for all the icons and also enque its css file
391 // add_filter( 'vc_iconpicker-type-auxin', 'vc_iconpicker_type_auxin' );
392 function vc_iconpicker_type_auxin( $icons ) {
393 $auxin_icons = array(
394 "Test" => array(
395 array( 'auxin-icon auxin-icon-2-arrows' => __( 'Arrow', 'auxin-elements' ) ),
396 array( 'auxin-icon auxin-icon-basket-1' => __( 'Arrow', 'auxin-elements' ) ),
397 array( 'auxin-icon auxin-icon-back-pack' => __( 'Back', 'auxin-elements' ) )
398 )
399 );
400
401 return array_merge( $icons, $auxin_icons );
402 }
403
404 // add_action( 'vc_backend_editor_enqueue_js_css', 'auxin_vc_iconpicker_editor_jscss' );
405 // @see Vc_Frontend_Editor::enqueueAdmin (wp-content/plugins/js_composer/include/classes/editors/class-vc-frontend-editor.php),
406 // used to enqueue needed js/css files when frontend editor is rendering
407 // add_action( 'vc_frontend_editor_enqueue_js_css', 'auxin_vc_iconpicker_editor_jscss' );
408 function auxin_vc_iconpicker_editor_jscss () {
409 wp_enqueue_style( 'auxin_font' );
410 }
411
412 // @see Vc_Base::frontCss, used to append actions when frontCss(frontend editor/and real view mode) method called
413 // This action registers all styles(fonts) to be enqueue later
414 add_action( 'vc_base_register_front_css', 'auxin_vc_iconpicker_base_register_css' );
415
416 // @see Vc_Base::registerAdminCss, used to append action when registerAdminCss(backend editor) method called
417 // This action registers all styles(fonts) to be enqueue later
418 add_action( 'vc_base_register_admin_css', 'auxin_vc_iconpicker_base_register_css' );
419 function auxin_vc_iconpicker_base_register_css () {
420 wp_register_style( 'auxin_font', vc_asset_url( 'css/lib/auxin-font/auxin-font.css' ), false, WPB_VC_VERSION, 'screen' );
421 }
422
423
424 }
425
426 }
427 add_action( 'auxin_admin_loaded', 'auxin_add_vc_field_types' );
428
429
430 /**
431 * load custom shortcodes, templates and element in visual composer start
432 *
433 * @return void
434 */
435 function auxin_on_vc_plugin_loaded(){
436 global $vc_manager;
437 if( ! is_null( $vc_manager ) ) {
438 $auxin_shortcodes_template_dir = AUXELS_PUB_DIR . '/templates/vcomposer';
439 $vc_manager->setCustomUserShortcodesTemplateDir( $auxin_shortcodes_template_dir );
440 }
441 }
442 add_action( 'plugins_loaded', 'auxin_on_vc_plugin_loaded' );
443
444
445
446 function auxin_add_theme_options_in_plugin( $fields_sections_list ){
447
448 // Sub section - Custom JS ------------------------------------
449
450 $fields_sections_list['sections'][] = array(
451 'id' => 'general-section-custom-js',
452 'parent' => 'general-section', // section parent's id
453 'title' => __( 'Custom JS Code', 'auxin-elements'),
454 'description' => __( 'Your Custom Javascript', 'auxin-elements')
455 );
456
457 $fields_sections_list['fields'][] = array(
458 'title' => __('Custom Javascript in Head', 'auxin-elements'),
459 'description' => sprintf( __('You can add your custom javascript code here.%s DO NOT use %s tag.', 'auxin-elements'), '<br />' , '<code>&lt;script&gt;</code>' )."<br />".
460 __('In order to save your custom javascript code, you are expected to execute the code prior to saving.', 'auxin-elements'),
461 'id' => 'auxin_user_custom_js_head',
462 'section' => 'general-section-custom-js',
463 'dependency' => array(),
464 'default' => '',
465 'transport' => 'postMessage',
466 'button_labels' => array( 'label' => __('Execute', 'auxin-elements') ),
467 'mode' => 'javascript',
468 'type' => 'code'
469 );
470
471 $fields_sections_list['fields'][] = array(
472 'title' => __('Custom Javascript in Footer', 'auxin-elements'),
473 'description' => sprintf( __('You can add your custom javascript code here.%s DO NOT use %s tag.', 'auxin-elements'), '<br />' , '<code>&lt;script&gt;</code>' )."<br />".
474 __('In order to save your custom javascript code, you are expected to execute the code prior to saving.', 'auxin-elements'),
475 'id' => 'auxin_user_custom_js',
476 'section' => 'general-section-custom-js',
477 'dependency' => array(),
478 'default' => '',
479 'transport' => 'postMessage',
480 'button_labels' => array( 'label' => __('Execute', 'auxin-elements') ),
481 'mode' => 'javascript',
482 'type' => 'code'
483 );
484
485
486 // Sub section - SEO ----------------------------------
487
488 $fields_sections_list['sections'][] = array(
489 'id' => 'general-section-seo',
490 'parent' => 'general-section', // section parent's id
491 'title' => __( 'Google API Keys & SEO', 'auxin-elements'),
492 'description' => __( 'Google API Keys & SEO', 'auxin-elements')
493 );
494
495
496 $fields_sections_list['fields'][] = array(
497 'title' => __('Built in SEO', 'auxin-elements'),
498 'description' => __('In case of using SEO plugins like "WordPress SEO by Yoast" or "All in One SEO Pack" you can disable built-in SEO for maximum compatibility.',
499 'auxin-elements'),
500 'id' => 'enable_theme_seo',
501 'section' => 'general-section-seo',
502 'dependency' => array(),
503 'default' => '1',
504 'type' => 'switch'
505 );
506
507 $fields_sections_list['fields'][] = array(
508 'title' => __('Google Analytics Code', 'auxin-elements'),
509 'description' => sprintf( __('You can %s set up Analytics tracking %s and add the tracking ID here.', 'auxin-elements'),
510 '<a href="https://support.google.com/analytics/answer/1008080" target="_blank">',
511 '</a>' ),
512 'id' => 'auxin_user_google_analytics',
513 'section' => 'general-section-seo',
514 'dependency' => array(),
515 'default' => '',
516 'transport' => 'postMessage',
517 'mode' => 'javascript',
518 'button_labels' => array( 'label' => false ),
519 'type' => 'text'
520 );
521
522 $fields_sections_list['fields'][] = array(
523 'title' => __('Google Maps API Key', 'auxin-elements'),
524 'description' => sprintf(
525 __( 'In order to use google maps on your website, you have to %s create an api key %s and insert it in this field.', 'auxin-elements' ),
526 '<a href="https://developers.google.com/maps/documentation/javascript/" target="_blank">',
527 '</a>'
528 ),
529 'id' => 'auxin_google_map_api_key',
530 'section' => 'general-section-seo',
531 'dependency' => array(),
532 'default' => '',
533 'transport' => 'postMessage',
534 'mode' => 'javascript',
535 'type' => 'text'
536 );
537
538 $fields_sections_list['fields'][] = array(
539 'title' => __('Google Marketing Code', 'auxin-elements'),
540 'description' => sprintf( __('You can add your Google marketing code here.%s DO NOT use %s tag.', 'auxin-elements'), '<br />' , '<code>&lt;script&gt;</code>' ),
541 'id' => 'auxin_user_google_marketing',
542 'section' => 'general-section-seo',
543 'dependency' => array(),
544 'default' => '',
545 'transport' => 'postMessage',
546 'mode' => 'javascript',
547 'button_labels' => array( 'label' => false ),
548 'type' => 'code'
549 );
550
551 // Secondary logo for sticky header ----------------------------------
552
553
554 $custom_logo_args = get_theme_support( 'custom-logo' );
555
556 $fields_sections_list['fields'][] = array(
557 'title' => __( 'Logo 2 (optional)', 'auxin-elements' ),
558 'description' => __( 'The secondary logo which appears when the header becomes sticky (optional).', 'auxin-elements' ),
559 'id' => 'custom_logo2',
560 'section' => 'title_tagline',
561 'transport' => 'postMessage',
562 'default' => '',
563 'priority' => 9,
564 'type' => 'image',
565 'transport' => 'refresh'
566 );
567
568
569 // Sub section - Button 1 in header -------------------------------
570
571 $fields_sections_list['sections'][] = array(
572 'id' => 'header-section-action-button1',
573 'parent' => 'header-section', // section parent's id
574 'title' => __( 'Header Button 1', 'auxin-elements' ),
575 'description' => __( 'Setting for Header Button 1', 'auxin-elements' ),
576 'is_deprecated' => true
577 );
578
579 $fields_sections_list['fields'][] = array(
580 'title' => __( 'Use Legacy Header', 'auxin-elements' ),
581 'description' => __( 'Disable it to replace header section with an Elementor template', 'auxin-elements' ),
582 'id' => 'site_header_btn1_section_use_legacy',
583 'section' => 'header-section-action-button1',
584 'type' => 'switch',
585 'default' => '0',
586 'related_controls' => ['site_header_use_legacy']
587 );
588
589 $fields_sections_list['fields'][] = array(
590 'title' => __('Display Header Button 1','auxin-elements' ),
591 'description' => __('Enable this option to display a button in header.','auxin-elements' ),
592 'section' => 'header-section-action-button1',
593 'id' => 'site_header_show_btn1',
594 'type' => 'switch',
595 'default' => '0',
596 'dependency' => array(
597 array(
598 'id' => 'site_header_use_legacy',
599 'value' => '1',
600 'operator'=> '=='
601 ),
602 ),
603 'partial' => array(
604 'selector' => '.aux-btn1-box',
605 'container_inclusive' => true,
606 'render_callback' => function(){ echo auxin_get_header_button(1); }
607 )
608 );
609
610 $fields_sections_list['fields'][] = array(
611 'title' => __( 'Hide Button 1 on Tablet', 'auxin-elements' ),
612 'description' => __( 'Enable it to hide header button 1 on tablet devices.', 'auxin-elements' ),
613 'id' => 'site_header_show_btn1_on_tablet',
614 'section' => 'header-section-action-button1',
615 'dependency' => array(
616 array(
617 'id' => 'site_header_show_btn1',
618 'value' => array('1'),
619 'operator'=> ''
620 ),
621 array(
622 'id' => 'site_header_use_legacy',
623 'value' => '1',
624 'operator'=> '=='
625 ),
626 ),
627 'default' => '1',
628 'transport' => 'postMessage',
629 'post_js' => '$(".aux-btn1-box").toggleClass( "aux-tablet-off", to );',
630 'type' => 'switch'
631 );
632
633 $fields_sections_list['fields'][] = array(
634 'title' => __( 'Hide Button 1 on Mobile', 'auxin-elements' ),
635 'description' => __( 'Enable it to hide header button 1 on tablet devices.', 'auxin-elements' ),
636 'id' => 'site_header_show_btn1_on_phone',
637 'section' => 'header-section-action-button1',
638 'dependency' => array(
639 array(
640 'id' => 'site_header_show_btn1',
641 'value' => array('1'),
642 'operator'=> ''
643 ),
644 array(
645 'id' => 'site_header_use_legacy',
646 'value' => '1',
647 'operator'=> '=='
648 ),
649 ),
650 'default' => '1',
651 'transport' => 'postMessage',
652 'post_js' => '$(".aux-btn1-box").toggleClass( "aux-phone-off", to );',
653 'type' => 'switch'
654 );
655
656 $fields_sections_list['fields'][] = array(
657 'title' => __('Button Label','auxin-elements' ),
658 'description' => __('Specifies the label of button.','auxin-elements' ),
659 'section' => 'header-section-action-button1',
660 'id' => 'site_header_btn1_label',
661 'type' => 'text',
662 'default' => __('Button', 'auxin-elements'),
663 'dependency' => array(
664 array(
665 'id' => 'site_header_show_btn1',
666 'value' => '1',
667 'operator'=> '=='
668 ),
669 array(
670 'id' => 'site_header_use_legacy',
671 'value' => '1',
672 'operator'=> '=='
673 ),
674 ),
675 'transport' => 'postMessage',
676 'post_js' => '$(".aux-btn1-box .aux-ac-btn1").html( to );'
677 );
678
679 $fields_sections_list['fields'][] = array(
680 'title' => __('Button Size','auxin-elements' ),
681 'description' => '',
682 'section' => 'header-section-action-button1',
683 'id' => 'site_header_btn1_size',
684 'type' => 'select',
685 'choices' => array(
686 'exlarge' => __('Exlarge', 'auxin-elements' ),
687 'large' => __('Large' , 'auxin-elements' ),
688 'medium' => __('Medium' , 'auxin-elements' ),
689 'small' => __('Small' , 'auxin-elements' ),
690 'tiny' => __('Tiny' , 'auxin-elements' )
691 ),
692 'default' => 'large',
693 'dependency' => array(
694 array(
695 'id' => 'site_header_show_btn1',
696 'value' => '1',
697 'operator'=> '=='
698 ),
699 array(
700 'id' => 'site_header_use_legacy',
701 'value' => '1',
702 'operator'=> '=='
703 ),
704 ),
705 'transport' => 'postMessage',
706 'post_js' => '$(".aux-btn1-box .aux-ac-btn1").removeClass( "aux-exlarge aux-large aux-medium aux-small aux-tiny" ).addClass( "aux-" + to );'
707 );
708
709 $fields_sections_list['fields'][] = array(
710 'title' => __('Button Shape','auxin-elements' ),
711 'description' => '',
712 'section' => 'header-section-action-button1',
713 'id' => 'site_header_btn1_shape',
714 'type' => 'radio-image',
715 'choices' => array(
716 '' => array(
717 'label' => __('Sharp', 'auxin-elements' ),
718 'image' => AUXIN_URL . 'images/visual-select/button-normal.svg'
719 ),
720 'round' => array(
721 'label' => __('Round', 'auxin-elements' ),
722 'image' => AUXIN_URL . 'images/visual-select/button-curved.svg'
723 ),
724 'curve' => array(
725 'label' => __('Curve', 'auxin-elements' ),
726 'image' => AUXIN_URL . 'images/visual-select/button-rounded.svg'
727 )
728 ),
729 'default' => 'curve',
730 'dependency' => array(
731 array(
732 'id' => 'site_header_show_btn1',
733 'value' => '1',
734 'operator'=> '=='
735 ),
736 array(
737 'id' => 'site_header_use_legacy',
738 'value' => '1',
739 'operator'=> '=='
740 ),
741 ),
742 'transport' => 'postMessage',
743 'post_js' => '$(".aux-btn1-box .aux-ac-btn1").removeClass( "aux-round aux-curve" ).addClass( "aux-" + to );'
744 );
745
746 $fields_sections_list['fields'][] = array(
747 'title' => __('Button Style','auxin-elements' ),
748 'description' => '',
749 'section' => 'header-section-action-button1',
750 'id' => 'site_header_btn1_style',
751 'type' => 'radio-image',
752 'choices' => array(
753 '' => array(
754 'label' => __('Normal', 'auxin-elements' ),
755 'image' => AUXIN_URL . 'images/visual-select/button-normal.svg'
756 ),
757 '3d' => array(
758 'label' => __('3D', 'auxin-elements' ),
759 'image' => AUXIN_URL . 'images/visual-select/button-3d.svg'
760 ),
761 'outline' => array(
762 'label' => __('Outline', 'auxin-elements' ),
763 'image' => AUXIN_URL . 'images/visual-select/button-outline.svg'
764 )
765 ),
766 'default' => '',
767 'dependency' => array(
768 array(
769 'id' => 'site_header_show_btn1',
770 'value' => '1',
771 'operator'=> '=='
772 ),
773 array(
774 'id' => 'site_header_use_legacy',
775 'value' => '1',
776 'operator'=> '=='
777 ),
778 ),
779 'transport' => 'postMessage',
780 'post_js' => '$(".aux-btn1-box .aux-ac-btn1").removeClass( "aux-3d aux-outline" ).addClass( "aux-" + to );'
781 );
782
783 $fields_sections_list['fields'][] = array(
784 'title' => __( 'Button Typography', 'auxin-elements' ),
785 'id' => 'site_header_btn1_typography',
786 'section' => 'header-section-action-button1',
787 'default' => '',
788 'type' => 'group_typography',
789 'selectors' => '.site-header-section .aux-btn1-box .aux-button',
790 'dependency' => array(
791 array(
792 'id' => 'site_header_show_btn1',
793 'value' => '1',
794 'operator'=> '=='
795 ),
796 array(
797 'id' => 'site_header_use_legacy',
798 'value' => '1',
799 'operator'=> '=='
800 ),
801 ),
802 'transport' => 'postMessage'
803 );
804
805 $fields_sections_list['fields'][] = array(
806 'title' => __('Icon for Button','auxin-elements' ),
807 'description' => '',
808 'section' => 'header-section-action-button1',
809 'id' => 'site_header_btn1_icon',
810 'type' => 'icon',
811 'default' => '',
812 'dependency' => array(
813 array(
814 'id' => 'site_header_show_btn1',
815 'value' => '1',
816 'operator'=> '=='
817 ),
818 array(
819 'id' => 'site_header_use_legacy',
820 'value' => '1',
821 'operator'=> '=='
822 ),
823 ),
824 'transport' => 'refresh'
825 );
826
827 $fields_sections_list['fields'][] = array(
828 'title' => __('Icon Alignment','auxin-elements' ),
829 'description' => '',
830 'section' => 'header-section-action-button1',
831 'id' => 'site_header_btn1_icon_align',
832 'type' => 'radio-image',
833 'choices' => array(
834 'default' => array(
835 'label' => __('Default' , 'auxin-elements'),
836 'image' => AUXELS_ADMIN_URL . '/assets/images/button.png'
837 ),
838 'left' => array(
839 'label' => __('Left' , 'auxin-elements'),
840 'video_src' => AUXELS_ADMIN_URL . '/assets/images/preview/Button2.webm webm'
841 ),
842 'right' => array(
843 'label' => __('Right' , 'auxin-elements'),
844 'video_src' => AUXELS_ADMIN_URL . '/assets/images/preview/Button1.webm webm'
845 ),
846 'over' => array(
847 'label' => __('Over', 'auxin-elements'),
848 'video_src' => AUXELS_ADMIN_URL . '/assets/images/preview/Button5.webm webm'
849 ),
850 'left-animate' => array(
851 'label' => __('Animate from Left', 'auxin-elements'),
852 'video_src' => AUXELS_ADMIN_URL . '/assets/images/preview/Button4.webm webm'
853 ),
854 'right-animate' => array(
855 'label' => __('Animate from Righ', 'auxin-elements'),
856 'video_src' => AUXELS_ADMIN_URL . '/assets/images/preview/Button3.webm webm'
857 )
858 ),
859 'default' => 'default',
860 'dependency' => array(
861 array(
862 'id' => 'site_header_show_btn1',
863 'value' => '1',
864 'operator'=> '=='
865 ),
866 array(
867 'id' => 'site_header_use_legacy',
868 'value' => '1',
869 'operator'=> '=='
870 ),
871 ),
872 'transport' => 'postMessage',
873 'post_js' => '$(".aux-btn1-box .aux-ac-btn1").alterClass( "aux-icon-*", "aux-icon-" + to );'
874 );
875
876 $fields_sections_list['fields'][] = array(
877 'title' => __('Color of Button','auxin-elements' ),
878 'description' => '',
879 'section' => 'header-section-action-button1',
880 'id' => 'site_header_btn1_color_name',
881 'type' => 'radio-image',
882 'choices' => auxin_get_famous_colors_list(),
883 'default' => 'ball-blue',
884 'dependency' => array(
885 array(
886 'id' => 'site_header_show_btn1',
887 'value' => '1',
888 'operator'=> '=='
889 ),
890 array(
891 'id' => 'site_header_use_legacy',
892 'value' => '1',
893 'operator'=> '=='
894 ),
895 ),
896 'transport' => 'refresh'
897 );
898
899 $fields_sections_list['fields'][] = array(
900 'title' => __('Color of Button on Sticky','auxin-elements' ),
901 'description' => __('Specifies the color of the button when the header sticky is enabled.', 'auxin-elements' ),
902 'section' => 'header-section-action-button1',
903 'id' => 'site_header_btn1_color_name_on_sticky',
904 'type' => 'radio-image',
905 'choices' => auxin_get_famous_colors_list(),
906 'default' => 'ball-blue',
907 'dependency' => array(
908 array(
909 'id' => 'site_header_show_btn1',
910 'value' => '1',
911 'operator'=> '=='
912 ),
913 array(
914 'id' => 'site_header_use_legacy',
915 'value' => '1',
916 'operator'=> '=='
917 ),
918 ),
919 'transport' => 'refresh'
920 );
921
922 $fields_sections_list['fields'][] = array(
923 'title' => __('Button Link','auxin-elements' ),
924 'description' => '',
925 'section' => 'header-section-action-button1',
926 'id' => 'site_header_btn1_link',
927 'type' => 'text',
928 'default' => '#',
929 'dependency' => array(
930 array(
931 'id' => 'site_header_show_btn1',
932 'value' => '1',
933 'operator'=> '=='
934 ),
935 array(
936 'id' => 'site_header_use_legacy',
937 'value' => '1',
938 'operator'=> '=='
939 ),
940 ),
941 'transport' => 'postMessage',
942 'post_js' => '$(".aux-btn1-box .aux-ac-btn1").prop( "href", to );'
943 );
944
945 $fields_sections_list['fields'][] = array(
946 'title' => __('Open Link in','auxin-elements' ),
947 'description' => '',
948 'section' => 'header-section-action-button1',
949 'id' => 'site_header_btn1_target',
950 'type' => 'select',
951 'choices' => array(
952 '_self' => __('Current page' , 'auxin-elements' ),
953 '_blank' => __('New page', 'auxin-elements' )
954 ),
955 'default' => '_self',
956 'dependency' => array(
957 array(
958 'id' => 'site_header_show_btn1',
959 'value' => '1',
960 'operator'=> '=='
961 ),
962 array(
963 'id' => 'site_header_use_legacy',
964 'value' => '1',
965 'operator'=> '=='
966 ),
967 ),
968 'transport' => 'postMessage',
969 'post_js' => '$(".aux-btn1-box .aux-ac-btn1").prop( "target", to );'
970 );
971
972
973
974 // Sub section - Button 2 in header -------------------------------
975
976 $fields_sections_list['sections'][] = array(
977 'id' => 'header-section-action-button2',
978 'parent' => 'header-section', // section parent's id
979 'title' => __( 'Header Button 2', 'auxin-elements' ),
980 'description' => __( 'Setting for Header Button 2', 'auxin-elements' ),
981 'is_deprecated' => true
982 );
983
984 $fields_sections_list['fields'][] = array(
985 'title' => __( 'Use Legacy Header', 'auxin-elements' ),
986 'description' => __( 'Disable it to replace header section with an Elementor template', 'auxin-elements' ),
987 'id' => 'site_header_btn2_section_use_legacy',
988 'section' => 'header-section-action-button2',
989 'type' => 'switch',
990 'default' => '0',
991 'related_controls' => ['site_header_use_legacy']
992 );
993
994 $fields_sections_list['fields'][] = array(
995 'title' => __('Display Header Button 2','auxin-elements' ),
996 'description' => __('Enable this option to display a button in header.','auxin-elements' ),
997 'section' => 'header-section-action-button2',
998 'id' => 'site_header_show_btn2',
999 'type' => 'switch',
1000 'default' => '0',
1001 'dependency' => array(
1002 array(
1003 'id' => 'site_header_use_legacy',
1004 'value' => '1',
1005 'operator'=> '=='
1006 ),
1007 ),
1008 'partial' => array(
1009 'selector' => '.aux-btn2-box',
1010 'container_inclusive' => true,
1011 'render_callback' => function(){ echo auxin_get_header_button(2); }
1012 )
1013 );
1014
1015 $fields_sections_list['fields'][] = array(
1016 'title' => __( 'Hide Button 2 on Tablet', 'auxin-elements' ),
1017 'description' => __( 'Enable it to hide header button 2 on tablet devices.', 'auxin-elements' ),
1018 'id' => 'site_header_show_btn2_on_tablet',
1019 'section' => 'header-section-action-button2',
1020 'dependency' => array(
1021 array(
1022 'id' => 'site_header_show_btn2',
1023 'value' => array('1'),
1024 'operator'=> ''
1025 ),
1026 array(
1027 'id' => 'site_header_use_legacy',
1028 'value' => '1',
1029 'operator'=> '=='
1030 ),
1031 ),
1032 'default' => '1',
1033 'transport' => 'postMessage',
1034 'post_js' => '$(".aux-btn2-box").toggleClass( "aux-tablet-off", to );',
1035 'type' => 'switch'
1036 );
1037
1038 $fields_sections_list['fields'][] = array(
1039 'title' => __( 'Hide Button 2 on Mobile', 'auxin-elements' ),
1040 'description' => __( 'Enable it to hide header button 2 on tablet devices.', 'auxin-elements' ),
1041 'id' => 'site_header_show_btn2_on_phone',
1042 'section' => 'header-section-action-button2',
1043 'dependency' => array(
1044 array(
1045 'id' => 'site_header_show_btn2',
1046 'value' => array('1'),
1047 'operator'=> ''
1048 ),
1049 array(
1050 'id' => 'site_header_use_legacy',
1051 'value' => '1',
1052 'operator'=> '=='
1053 ),
1054 ),
1055 'default' => '1',
1056 'transport' => 'postMessage',
1057 'post_js' => '$(".aux-btn2-box").toggleClass( "aux-phone-off", to );',
1058 'type' => 'switch'
1059 );
1060
1061 $fields_sections_list['fields'][] = array(
1062 'title' => __('Button Label','auxin-elements' ),
1063 'description' => __('Specifies the label of button.','auxin-elements' ),
1064 'section' => 'header-section-action-button2',
1065 'id' => 'site_header_btn2_label',
1066 'type' => 'text',
1067 'default' => __('Button', 'auxin-elements'),
1068 'dependency' => array(
1069 array(
1070 'id' => 'site_header_show_btn2',
1071 'value' => 1,
1072 'operator'=> '=='
1073 ),
1074 array(
1075 'id' => 'site_header_use_legacy',
1076 'value' => '1',
1077 'operator'=> '=='
1078 ),
1079 ),
1080 'transport' => 'postMessage',
1081 'post_js' => '$(".aux-btn2-box .aux-ac-btn2").html( to );'
1082 );
1083
1084 $fields_sections_list['fields'][] = array(
1085 'title' => __('Button Size','auxin-elements' ),
1086 'description' => '',
1087 'section' => 'header-section-action-button2',
1088 'id' => 'site_header_btn2_size',
1089 'type' => 'select',
1090 'choices' => array(
1091 'exlarge' => __('Exlarge', 'auxin-elements' ),
1092 'large' => __('Large' , 'auxin-elements' ),
1093 'medium' => __('Medium' , 'auxin-elements' ),
1094 'small' => __('Small' , 'auxin-elements' ),
1095 'tiny' => __('Tiny' , 'auxin-elements' )
1096 ),
1097 'default' => 'large',
1098 'dependency' => array(
1099 array(
1100 'id' => 'site_header_show_btn2',
1101 'value' => 1,
1102 'operator'=> '=='
1103 ),
1104 array(
1105 'id' => 'site_header_use_legacy',
1106 'value' => '1',
1107 'operator'=> '=='
1108 ),
1109 ),
1110 'transport' => 'postMessage',
1111 'post_js' => '$(".aux-btn2-box .aux-ac-btn2").removeClass( "aux-exlarge aux-large aux-medium aux-small aux-tiny" ).addClass( "aux-" + to );'
1112 );
1113
1114 $fields_sections_list['fields'][] = array(
1115 'title' => __('Button Shape','auxin-elements' ),
1116 'description' => '',
1117 'section' => 'header-section-action-button2',
1118 'id' => 'site_header_btn2_shape',
1119 'type' => 'radio-image',
1120 'choices' => array(
1121 '' => array(
1122 'label' => __('Sharp', 'auxin-elements' ),
1123 'image' => AUXIN_URL . 'images/visual-select/button-normal.svg'
1124 ),
1125 'round' => array(
1126 'label' => __('Round', 'auxin-elements' ),
1127 'image' => AUXIN_URL . 'images/visual-select/button-curved.svg'
1128 ),
1129 'curve' => array(
1130 'label' => __('Curve', 'auxin-elements' ),
1131 'image' => AUXIN_URL . 'images/visual-select/button-rounded.svg'
1132 )
1133 ),
1134 'default' => 'curve',
1135 'dependency' => array(
1136 array(
1137 'id' => 'site_header_show_btn2',
1138 'value' => 1,
1139 'operator'=> '=='
1140 ),
1141 array(
1142 'id' => 'site_header_use_legacy',
1143 'value' => '1',
1144 'operator'=> '=='
1145 ),
1146 ),
1147 'transport' => 'postMessage',
1148 'post_js' => '$(".aux-btn2-box .aux-ac-btn2").removeClass( "aux-round aux-curve" ).addClass( "aux-" + to );'
1149 );
1150
1151 $fields_sections_list['fields'][] = array(
1152 'title' => __('Button Style','auxin-elements' ),
1153 'description' => '',
1154 'section' => 'header-section-action-button2',
1155 'id' => 'site_header_btn2_style',
1156 'type' => 'radio-image',
1157 'choices' => array(
1158 '' => array(
1159 'label' => __('Normal', 'auxin-elements' ),
1160 'image' => AUXIN_URL . 'images/visual-select/button-normal.svg'
1161 ),
1162 '3d' => array(
1163 'label' => __('3D', 'auxin-elements' ),
1164 'image' => AUXIN_URL . 'images/visual-select/button-3d.svg'
1165 ),
1166 'outline' => array(
1167 'label' => __('Outline', 'auxin-elements' ),
1168 'image' => AUXIN_URL . 'images/visual-select/button-outline.svg'
1169 )
1170 ),
1171 'default' => 'outline',
1172 'dependency' => array(
1173 array(
1174 'id' => 'site_header_show_btn2',
1175 'value' => 1,
1176 'operator'=> '=='
1177 ),
1178 array(
1179 'id' => 'site_header_use_legacy',
1180 'value' => '1',
1181 'operator'=> '=='
1182 ),
1183 ),
1184 'transport' => 'postMessage',
1185 'post_js' => '$(".aux-btn2-box .aux-ac-btn2").removeClass( "aux-3d aux-outline" ).addClass( "aux-" + to );'
1186 );
1187
1188 $fields_sections_list['fields'][] = array(
1189 'title' => __( 'Button Typography', 'auxin-elements' ),
1190 'id' => 'site_header_btn2_typography',
1191 'section' => 'header-section-action-button2',
1192 'default' => '',
1193 'type' => 'group_typography',
1194 'selectors' => '.site-header-section .aux-btn2-box .aux-button',
1195 'dependency' => array(
1196 array(
1197 'id' => 'site_header_show_btn2',
1198 'value' => '1',
1199 'operator'=> '=='
1200 ),
1201 array(
1202 'id' => 'site_header_use_legacy',
1203 'value' => '1',
1204 'operator'=> '=='
1205 ),
1206 ),
1207 'transport' => 'postMessage'
1208 );
1209
1210 $fields_sections_list['fields'][] = array(
1211 'title' => __('Icon for Button','auxin-elements' ),
1212 'description' => '',
1213 'section' => 'header-section-action-button2',
1214 'id' => 'site_header_btn2_icon',
1215 'type' => 'icon',
1216 'default' => '',
1217 'dependency' => array(
1218 array(
1219 'id' => 'site_header_show_btn2',
1220 'value' => 1,
1221 'operator'=> '=='
1222 ),
1223 array(
1224 'id' => 'site_header_use_legacy',
1225 'value' => '1',
1226 'operator'=> '=='
1227 ),
1228 ),
1229 'transport' => 'refresh'
1230 );
1231
1232 $fields_sections_list['fields'][] = array(
1233 'title' => __('Icon Alignment','auxin-elements' ),
1234 'description' => '',
1235 'section' => 'header-section-action-button2',
1236 'id' => 'site_header_btn2_icon_align',
1237 'type' => 'radio-image',
1238 'choices' => array(
1239 'default' => array(
1240 'label' => __('Default' , 'auxin-elements'),
1241 'image' => AUXELS_ADMIN_URL . '/assets/images/button.png'
1242 ),
1243 'left' => array(
1244 'label' => __('Left' , 'auxin-elements'),
1245 'video_src' => AUXELS_ADMIN_URL . '/assets/images/preview/Button2.webm webm'
1246 ),
1247 'right' => array(
1248 'label' => __('Right' , 'auxin-elements'),
1249 'video_src' => AUXELS_ADMIN_URL . '/assets/images/preview/Button2.webm webm'
1250 ),
1251 'over' => array(
1252 'label' => __('Over', 'auxin-elements'),
1253 'video_src' => AUXELS_ADMIN_URL . '/assets/images/preview/Button5.webm webm'
1254 ),
1255 'left-animate' => array(
1256 'label' => __('Animate from Left', 'auxin-elements'),
1257 'video_src' => AUXELS_ADMIN_URL . '/assets/images/preview/Button4.webm webm'
1258 ),
1259 'right-animate' => array(
1260 'label' => __('Animate from Righ', 'auxin-elements'),
1261 'video_src' => AUXELS_ADMIN_URL . '/assets/images/preview/Button3.webm webm'
1262 )
1263 ),
1264 'default' => 'default',
1265 'dependency' => array(
1266 array(
1267 'id' => 'site_header_show_btn2',
1268 'value' => 1,
1269 'operator'=> '=='
1270 ),
1271 array(
1272 'id' => 'site_header_use_legacy',
1273 'value' => '1',
1274 'operator'=> '=='
1275 ),
1276 ),
1277 'transport' => 'postMessage',
1278 'post_js' => '$(".aux-btn2-box .aux-ac-btn2").alterClass( "aux-icon-*", "aux-icon-" + to );'
1279 );
1280
1281 $fields_sections_list['fields'][] = array(
1282 'title' => __('Color of Button','auxin-elements' ),
1283 'description' => '',
1284 'section' => 'header-section-action-button2',
1285 'id' => 'site_header_btn2_color_name',
1286 'type' => 'radio-image',
1287 'choices' => auxin_get_famous_colors_list(),
1288 'default' => 'emerald',
1289 'dependency' => array(
1290 array(
1291 'id' => 'site_header_show_btn2',
1292 'value' => 1,
1293 'operator'=> '=='
1294 ),
1295 array(
1296 'id' => 'site_header_use_legacy',
1297 'value' => '1',
1298 'operator'=> '=='
1299 ),
1300 ),
1301 'transport' => 'refresh'
1302 );
1303
1304 $fields_sections_list['fields'][] = array(
1305 'title' => __('Color of Button on Sticky','auxin-elements' ),
1306 'description' => __('Specifies the color of the button when the header sticky is enabled.', 'auxin-elements' ),
1307 'section' => 'header-section-action-button2',
1308 'id' => 'site_header_btn2_color_name_on_sticky',
1309 'type' => 'radio-image',
1310 'choices' => auxin_get_famous_colors_list(),
1311 'default' => 'ball-blue',
1312 'dependency' => array(
1313 array(
1314 'id' => 'site_header_show_btn2',
1315 'value' => '1',
1316 'operator'=> '=='
1317 ),
1318 array(
1319 'id' => 'site_header_use_legacy',
1320 'value' => '1',
1321 'operator'=> '=='
1322 ),
1323 ),
1324 'transport' => 'refresh'
1325 );
1326
1327 $fields_sections_list['fields'][] = array(
1328 'title' => __('Button Link','auxin-elements' ),
1329 'description' => '',
1330 'section' => 'header-section-action-button2',
1331 'id' => 'site_header_btn2_link',
1332 'type' => 'text',
1333 'default' => '',
1334 'dependency' => array(
1335 array(
1336 'id' => 'site_header_show_btn2',
1337 'value' => 1,
1338 'operator'=> '=='
1339 ),
1340 array(
1341 'id' => 'site_header_use_legacy',
1342 'value' => '1',
1343 'operator'=> '=='
1344 ),
1345 ),
1346 'transport' => 'postMessage',
1347 'post_js' => '$(".aux-btn2-box .aux-ac-btn2").prop( "href", to );'
1348 );
1349
1350 $fields_sections_list['fields'][] = array(
1351 'title' => __('Open Link in','auxin-elements' ),
1352 'description' => '',
1353 'section' => 'header-section-action-button2',
1354 'id' => 'site_header_btn2_target',
1355 'type' => 'select',
1356 'choices' => array(
1357 '_self' => __('Current page' , 'auxin-elements' ),
1358 '_blank' => __('New page', 'auxin-elements' )
1359 ),
1360 'default' => '_self',
1361 'dependency' => array(
1362 array(
1363 'id' => 'site_header_show_btn2',
1364 'value' => 1,
1365 'operator'=> '=='
1366 ),
1367 array(
1368 'id' => 'site_header_use_legacy',
1369 'value' => '1',
1370 'operator'=> '=='
1371 ),
1372 ),
1373 'transport' => 'postMessage',
1374 'post_js' => '$(".aux-btn2-box .aux-ac-btn2").prop( "target", to );'
1375 );
1376
1377
1378 // Sub section - footer -------------------------------
1379
1380
1381 $fields_sections_list['fields'][] = array(
1382 'title' => __('Footer Brand Image', 'auxin-elements'),
1383 'description' => __('This image appears as site brand image on footer section.', 'auxin-elements'),
1384 'id' => 'site_secondary_logo_image',
1385 'section' => 'footer-section-footer',
1386 'dependency' => array(
1387 array(
1388 'id' => 'show_site_footer',
1389 'value' => array('1'),
1390 'operator'=> '=='
1391 ),
1392 array(
1393 'id' => 'site_footer_use_legacy',
1394 'value' => array('1'),
1395 'operator'=> '=='
1396 )
1397 ),
1398 'default' => '',
1399 'transport' => 'postMessage',
1400 'partial' => array(
1401 'selector' => '.aux-logo-footer .aux-logo-anchor',
1402 'container_inclusive' => false,
1403 'render_callback' => function(){ echo _auxin_get_footer_logo_image(); }
1404 ),
1405 'type' => 'image'
1406 );
1407
1408 $fields_sections_list['fields'][] = array(
1409 'title' => __('Footer Brand Height', 'auxin-elements'),
1410 'description' => __('Specifies maximum height of logo in footer.', 'auxin-elements'),
1411 'id' => 'site_secondary_logo_max_height',
1412 'section' => 'footer-section-footer',
1413 'dependency' => array(
1414 array(
1415 'id' => 'show_site_footer',
1416 'value' => array('1'),
1417 'operator'=> '=='
1418 ),
1419 array(
1420 'id' => 'site_footer_use_legacy',
1421 'value' => array('1'),
1422 'operator'=> '=='
1423 )
1424 ),
1425 'default' => '50',
1426 'transport' => 'postMessage',
1427 'post_js' => '$(".aux-logo-footer .aux-logo-anchor img").css( "max-height", $.trim(to) + "px" );',
1428 'style_callback' => function( $value = null ){
1429 if( ! $value ){
1430 $value = auxin_get_option( 'site_secondary_logo_max_height' );
1431 }
1432 $value = trim( $value, 'px');
1433 return $value ? ".aux-logo-footer .aux-logo-anchor img { max-height:{$value}px; }" : '';
1434 },
1435 'type' => 'text'
1436 );
1437
1438
1439
1440
1441 // Sub section - Login page customizer -------------------------------
1442
1443 $fields_sections_list['sections'][] = array(
1444 'id' => 'tools-section-login',
1445 'parent' => 'tools-section', // section parent's id
1446 'title' => __( 'Login Page', 'auxin-elements' ),
1447 'description' => __( 'Preview login page', 'auxin-elements' ),
1448 'preview_link' => wp_login_url()
1449 );
1450
1451
1452
1453 $fields_sections_list['fields'][] = array(
1454 'title' => __('Login Skin', 'auxin-elements'),
1455 'description' => __('Specifies a skin for login page of your website.', 'auxin-elements'),
1456 'id' => 'auxin_login_skin',
1457 'section' => 'tools-section-login',
1458 'dependency' => array(),
1459 'choices' => array(
1460 'default' => array(
1461 'label' => __('Default', 'auxin-elements'),
1462 'image' => AUXIN_URL . 'images/visual-select/login-skin-default.svg'
1463 ),
1464 'clean-white' => array(
1465 'label' => __('Clean white', 'auxin-elements'),
1466 'image' => AUXIN_URL . 'images/visual-select/login-skin-light.svg'
1467 ),
1468 'simple-white' => array(
1469 'label' => __('Simple white', 'auxin-elements'),
1470 'image' => AUXIN_URL . 'images/visual-select/login-skin-simple-light.svg'
1471 ),
1472 'simple-gray' => array(
1473 'label' => __('Simple gray', 'auxin-elements'),
1474 'image' => AUXIN_URL . 'images/visual-select/login-skin-simple-gray.svg'
1475 )
1476 ),
1477 'transport' => 'refresh',
1478 'default' => 'default',
1479 'type' => 'radio-image'
1480 );
1481
1482 $fields_sections_list['fields'][] = array(
1483 'title' => __('Login message', 'auxin-elements'),
1484 'description' => __('Enter a text to display above the login form.', 'auxin-elements'),
1485 'id' => 'auxin_login_message',
1486 'section' => 'tools-section-login',
1487 'dependency' => array(),
1488 'transport' => 'refresh',
1489 'type' => 'textarea',
1490 'default' => ''
1491 );
1492
1493 //--------------------------------
1494
1495 $fields_sections_list['fields'][] = array(
1496 'title' => __('Login Page Logo', 'auxin-elements'),
1497 'description' => __('Specifies a logo to display on login page.(width of logo image could be up to 320px)', 'auxin-elements'),
1498 'id' => 'auxin_login_logo_image',
1499 'section' => 'tools-section-login',
1500 'dependency' => array(),
1501 'transport' => 'refresh',
1502 'default' => '',
1503 'type' => 'image'
1504 );
1505
1506
1507 $fields_sections_list['fields'][] = array(
1508 'title' => __('Logo Width', 'auxin-elements'),
1509 'description' => __('Specifies width of logo image in pixel.', 'auxin-elements'),
1510 'id' => 'auxin_login_logo_width',
1511 'section' => 'tools-section-login',
1512 'dependency' => array(),
1513 'transport' => 'refresh',
1514 'default' => '84',
1515 'type' => 'text'
1516 );
1517
1518
1519 $fields_sections_list['fields'][] = array(
1520 'title' => __('Logo Height', 'auxin-elements'),
1521 'description' => __('Specifies height of logo image in pixel.', 'auxin-elements'),
1522 'id' => 'auxin_login_logo_height',
1523 'section' => 'tools-section-login',
1524 'dependency' => array(),
1525 'transport' => 'refresh',
1526 'default' => '84',
1527 'type' => 'text'
1528 );
1529
1530 //--------------------------------
1531
1532 $fields_sections_list['fields'][] = array(
1533 'title' => __('Enable Background', 'auxin-elements'),
1534 'description' => __('Enable it to display custom background on login page.', 'auxin-elements'),
1535 'id' => 'auxin_login_bg_show',
1536 'section' => 'tools-section-login',
1537 'type' => 'switch',
1538 'transport' => 'refresh',
1539 'wrapper_class' => 'collapse-head',
1540 'default' => '0'
1541 );
1542
1543
1544 $fields_sections_list['fields'][] = array(
1545 'title' => __( 'Background Color', 'auxin-elements'),
1546 'description' => __( 'Specifies background color of website.', 'auxin-elements'),
1547 'id' => 'auxin_login_bg_color',
1548 'section' => 'tools-section-login',
1549 'type' => 'color',
1550 'dependency' => array(
1551 array(
1552 'id' => 'auxin_login_bg_show',
1553 'value' => array( '1' )
1554 )
1555 ),
1556 'transport' => 'refresh',
1557 'default' => ''
1558 );
1559
1560 $fields_sections_list['fields'][] = array(
1561 'title' => __('Background Image', 'auxin-elements'),
1562 'description' => __('You can upload custom image for background of login page', 'auxin-elements'),
1563 'id' => 'auxin_login_bg_image',
1564 'section' => 'tools-section-login',
1565 'type' => 'image',
1566 'dependency' => array(
1567 array(
1568 'id' => 'auxin_login_bg_show',
1569 'value' => array( '1' )
1570 )
1571 ),
1572 'transport' => 'refresh',
1573 'default' => ''
1574 );
1575
1576 $fields_sections_list['fields'][] = array(
1577 'title' => __('Background Size', 'auxin-elements'),
1578 'description' => __('Specifies background size on login page.', 'auxin-elements'),
1579 'id' => 'auxin_login_bg_size',
1580 'section' => 'tools-section-login',
1581 'type' => 'radio-image',
1582 'choices' => array(
1583 'auto' => array(
1584 'label' => __('Auto', 'auxin-elements'),
1585 'css_class' => 'axiAdminIcon-bg-size-1',
1586 ),
1587 'contain' => array(
1588 'label' => __('Contain', 'auxin-elements'),
1589 'css_class' => 'axiAdminIcon-bg-size-2'
1590 ),
1591 'cover' => array(
1592 'label' => __('Cover', 'auxin-elements'),
1593 'css_class' => 'axiAdminIcon-bg-size-3'
1594 )
1595 ),
1596 'dependency' => array(
1597 array(
1598 'id' => 'auxin_login_bg_show',
1599 'value' => array( '1' )
1600 )
1601 ),
1602 'transport' => 'refresh',
1603 'default' => 'auto'
1604 );
1605
1606 $fields_sections_list['fields'][] = array(
1607 'title' => __('Background Pattern', 'auxin-elements'),
1608 'description' => sprintf(__('You can select one of these patterns as login background image. %s Some of these can be used as a pattern over your background image.', 'auxin-elements'), '<br>'),
1609 'id' => 'auxin_login_bg_pattern',
1610 'section' => 'tools-section-login',
1611 'choices' => auxin_get_background_patterns( array( 'none' => array( 'label' =>__('None', 'auxin-elements'), 'image' => AUXIN_URL . 'images/visual-select/none-pattern.svg' ) ), 'before' ),
1612 'type' => 'radio-image',
1613 'dependency' => array(
1614 array(
1615 'id' => 'auxin_login_bg_show',
1616 'value' => array( '1' )
1617 )
1618 ),
1619 'transport' => 'refresh',
1620 'default' => ''
1621 );
1622
1623 $fields_sections_list['fields'][] = array(
1624 'title' => __( 'Background Repeat', 'auxin-elements'),
1625 'description' => __( 'Specifies how background image repeats.', 'auxin-elements'),
1626 'id' => 'auxin_login_bg_repeat',
1627 'section' => 'tools-section-login',
1628 'choices' => array(
1629 'no-repeat' => array(
1630 'label' => __('No repeat', 'auxin-elements'),
1631 'css_class' => 'axiAdminIcon-none',
1632 ),
1633 'repeat' => array(
1634 'label' => __('Repeat horizontally and vertically', 'auxin-elements'),
1635 'css_class' => 'axiAdminIcon-repeat-xy',
1636 ),
1637 'repeat-x' => array(
1638 'label' => __('Repeat horizontally', 'auxin-elements'),
1639 'css_class' => 'axiAdminIcon-repeat-x',
1640 ),
1641 'repeat-y' => array(
1642 'label' => __('Repeat vertically', 'auxin-elements'),
1643 'css_class' => 'axiAdminIcon-repeat-y',
1644 )
1645 ),
1646 'type' => 'radio-image',
1647 'dependency' => array(
1648 array(
1649 'id' => 'auxin_login_bg_show',
1650 'value' => array( '1' )
1651 )
1652 ),
1653 'transport' => 'refresh',
1654 'default' => 'no-repeat'
1655 );
1656
1657 $fields_sections_list['fields'][] = array(
1658 'title' => __( 'Background Position', 'auxin-elements'),
1659 'description' => __('Specifies background image position.', 'auxin-elements'),
1660 'id' => 'auxin_login_bg_position',
1661 'section' => 'tools-section-login',
1662 'choices' => array(
1663 'left top' => array(
1664 'label' => __('Left top', 'auxin-elements'),
1665 'css_class' => 'axiAdminIcon-top-left'
1666 ),
1667 'center top' => array(
1668 'label' => __('Center top', 'auxin-elements'),
1669 'css_class' => 'axiAdminIcon-top-center'
1670 ),
1671 'right top' => array(
1672 'label' => __('Right top', 'auxin-elements'),
1673 'css_class' => 'axiAdminIcon-top-right'
1674 ),
1675
1676 'left center' => array(
1677 'label' => __('Left center', 'auxin-elements'),
1678 'css_class' => 'axiAdminIcon-center-left'
1679 ),
1680 'center center' => array(
1681 'label' => __('Center center', 'auxin-elements'),
1682 'css_class' => 'axiAdminIcon-center-center'
1683 ),
1684 'right center' => array(
1685 'label' => __('Right center', 'auxin-elements'),
1686 'css_class' => 'axiAdminIcon-center-right'
1687 ),
1688
1689 'left bottom' => array(
1690 'label' => __('Left bottom', 'auxin-elements'),
1691 'css_class' => 'axiAdminIcon-bottom-left'
1692 ),
1693 'center bottom' => array(
1694 'label' => __('Center bottom', 'auxin-elements'),
1695 'css_class' => 'axiAdminIcon-bottom-center'
1696 ),
1697 'right bottom' => array(
1698 'label' => __('Right bottom', 'auxin-elements'),
1699 'css_class' => 'axiAdminIcon-bottom-right'
1700 )
1701 ),
1702 'type' => 'radio-image',
1703 'dependency' => array(
1704 array(
1705 'id' => 'auxin_login_bg_show',
1706 'value' => array( '1' )
1707 )
1708 ),
1709 'transport' => 'refresh',
1710 'default' => 'left top'
1711 );
1712
1713 $fields_sections_list['fields'][] = array(
1714 'title' => __('Background Attachment', 'auxin-elements'),
1715 'description' => __('Specifies whether the background is fixed or scrollable as user scrolls the page.', 'auxin-elements'),
1716 'id' => 'auxin_login_bg_attach',
1717 'section' => 'tools-section-login',
1718 'type' => 'radio-image',
1719 'choices' => array(
1720 'scroll' => array(
1721 'label' => __('Scroll', 'auxin-elements'),
1722 'css_class' => 'axiAdminIcon-bg-attachment-scroll',
1723 ),
1724 'fixed' => array(
1725 'label' => __('Fixed', 'auxin-elements'),
1726 'css_class' => 'axiAdminIcon-bg-attachment-fixed',
1727 )
1728 ),
1729 'dependency' => array(
1730 array(
1731 'id' => 'auxin_login_bg_show',
1732 'value' => array( '1' )
1733 )
1734 ),
1735 'transport' => 'refresh',
1736 'default' => 'scroll'
1737 );
1738
1739 //--------------------------------
1740
1741 $fields_sections_list['fields'][] = array(
1742 'title' => __('Custom CSS class name', 'auxin-elements'),
1743 'description' => __('In this field you can define custom CSS class name for login page.
1744 This class name will be added to body classes in login page and is useful for advance custom styling purposes.', 'auxin-elements'),
1745 'id' => 'auxin_login_body_class',
1746 'section' => 'tools-section-login',
1747 'dependency' => array(),
1748 'transport' => 'refresh',
1749 'default' => '',
1750 'type' => 'text'
1751 );
1752
1753 // Sub section - 404 page customizer -------------------------------
1754
1755 $fields_sections_list['sections'][] = array(
1756 'id' => 'tools-section-404',
1757 'parent' => 'tools-section', // section parent's id
1758 'title' => __( '404 Page', 'auxin-elements' ),
1759 'description' => __( '404 Page Options', 'auxin-elements' )
1760 //'description' => __( 'Preview 404 page', 'auxin-elements' ),
1761 );
1762
1763 $fields_sections_list['fields'][] = array(
1764 'title' => __('404 Page', 'auxin-elements'),
1765 'description' => __('Specifies a page to display on 404.', 'auxin-elements'),
1766 'id' => 'auxin_404_page',
1767 'section' => 'tools-section-404',
1768 'dependency' => array(),
1769 'transport' => 'refresh',
1770 'default' => 'default',
1771 'type' => 'select',
1772 'choices' => auxin_get_all_pages(),
1773 );
1774
1775 // Sub section - Maintenance page customizer -------------------------------
1776
1777 $fields_sections_list['sections'][] = array(
1778 'id' => 'tools-section-maintenance',
1779 'parent' => 'tools-section', // section parent's id
1780 'title' => __( 'Maintenance or Comingsoon Page', 'auxin-elements' ),
1781 'description' => __( 'Maintenance or Comingsoon Page Options', 'auxin-elements' )
1782 //'description' => __( 'Preview maintenance page', 'auxin-elements' ),
1783 );
1784
1785 $fields_sections_list['fields'][] = array(
1786 'title' => __( 'Enable Maintenance or Comingsoon Mode', 'auxin-elements' ),
1787 'description' => __( 'With this option you can manually enable Maintenance or Comingsoon mode', 'auxin-elements' ),
1788 'id' => 'auxin_maintenance_enable',
1789 'section' => 'tools-section-maintenance',
1790 'dependency' => array(),
1791 'transport' => 'refresh',
1792 'default' => '0',
1793 'type' => 'switch',
1794 );
1795
1796 $fields_sections_list['fields'][] = array(
1797 'title' => __('Maintenance or Comingsoon Page', 'auxin-elements'),
1798 'description' => __('In This Case You Can Set Your Specifc Page for Maintenance or Comingsoon Mode', 'auxin-elements'),
1799 'id' => 'auxin_maintenance_page',
1800 'section' => 'tools-section-maintenance',
1801 'dependency' => array(
1802 array(
1803 'id' => 'auxin_maintenance_enable',
1804 'value' => array( '1' )
1805 )
1806 ), 'transport' => 'refresh',
1807 'default' => 'default',
1808 'type' => 'select',
1809 'choices' => auxin_get_all_pages(),
1810 );
1811
1812 // Sub section - Custom Search -------------------------------
1813
1814 $fields_sections_list['sections'][] = array(
1815 'id' => 'tools-section-search-result',
1816 'parent' => 'tools-section', // section parent's id
1817 'title' => __( 'Search Results', 'auxin-elements' ),
1818 'description' => __( 'Search Results Options', 'auxin-elements' )
1819 );
1820
1821 //--------------------------------
1822
1823 $fields_sections_list['fields'][] = array(
1824 'title' => __( 'Exclude Posts Types', 'auxin-elements' ),
1825 'description' => __( 'The post types which should be excluded from search results.', 'auxin-elements' ),
1826 'id' => 'auxin_search_exclude_post_types',
1827 'section' => 'tools-section-search-result',
1828 'dependency' => array(),
1829 'transport' => 'postMessage',
1830 'default' => '',
1831 'type' => 'select2-post-types',
1832 );
1833
1834 $fields_sections_list['fields'][] = array(
1835 'title' => __( 'Exclude Posts Without Featured Image', 'auxin-elements' ),
1836 'description' => __( 'Exclude posts without featured image in search results.', 'auxin-elements' ),
1837 'id' => 'auxin_search_exclude_no_media',
1838 'section' => 'tools-section-search-result',
1839 'dependency' => array(),
1840 'transport' => 'postMessage',
1841 'default' => '',
1842 'type' => 'switch',
1843 );
1844
1845 $fields_sections_list['fields'][] = array(
1846 'title' => __( 'Include posts', 'auxin-elements' ),
1847 'description' => __( 'If you intend to include additional posts, you should specify the posts here.<br>You have to insert the Post IDs that are separated by camma (eg. 53,34,87,25)', 'auxin-elements' ),
1848 'id' => 'auxin_search_pinned_contents',
1849 'section' => 'tools-section-search-result',
1850 'dependency' => array(),
1851 'transport' => 'postMessage',
1852 'default' => '',
1853 'type' => 'text',
1854 );
1855
1856 // Sub section - Custom Search -------------------------------
1857
1858 $fields_sections_list['sections'][] = array(
1859 'id' => 'tools-section-import-export',
1860 'parent' => 'tools-section', // section parent's id
1861 'title' => __( 'Import/Export', 'auxin-elements' ),
1862 'description' => __( 'Import or Export options', 'auxin-elements' )
1863 );
1864
1865
1866 //--------------------------------
1867
1868 $fields_sections_list['fields'][] = array(
1869 'title' => __( 'Export Data', 'auxin-elements' ),
1870 'description' => __( 'Your theme options code which you can import later.', 'auxin-elements' ),
1871 'id' => 'auxin_customizer_export',
1872 'section' => 'tools-section-import-export',
1873 'dependency' => array(),
1874 'transport' => 'postMessage',
1875 'default' => '',
1876 'type' => 'export',
1877 );
1878
1879 $fields_sections_list['fields'][] = array(
1880 'title' => __( 'Import Data', 'auxin-elements' ),
1881 'description' => __( 'Paste the exported theme options code to import into theme.', 'auxin-elements' ),
1882 'id' => 'auxin_customizer_import',
1883 'section' => 'tools-section-import-export',
1884 'dependency' => array(),
1885 'transport' => 'postMessage',
1886 'default' => '',
1887 'type' => 'import',
1888 );
1889
1890 if( defined( 'AUX_WHITELABEL_DISPLAY' ) && AUX_WHITELABEL_DISPLAY ){
1891 // White Label section ==================================================================
1892
1893 $fields_sections_list['sections'][] = array(
1894 'id' => 'whitelabel-section',
1895 'parent' => '', // section parent's id
1896 'title' => __( 'White Label', 'auxin-elements'),
1897 'description' => __( 'White Label Settings', 'auxin-elements'),
1898 'icon' => 'axicon-doc'
1899 );
1900
1901 // Sub section - Custom Labels -------------------------------
1902
1903 $fields_sections_list['sections'][] = array(
1904 'id' => 'whitelabel-section-labels',
1905 'parent' => 'whitelabel-section', // section parent's id
1906 'title' => __( 'Settings', 'auxin-elements'),
1907 'description' => __( 'Change PHLOX labels.', 'auxin-elements')
1908 );
1909
1910 $fields_sections_list['fields'][] = array(
1911 'title' => __( 'Theme Name', 'auxin-elements' ),
1912 'description' => '',
1913 'id' => 'auxin_whitelabel_theme_name',
1914 'section' => 'whitelabel-section-labels',
1915 'dependency' => array(),
1916 'transport' => 'postMessage',
1917 'default' => THEME_NAME_I18N,
1918 'type' => 'text',
1919 );
1920
1921 $fields_sections_list['fields'][] = array(
1922 'title' => __('Theme Author Name', 'auxin-elements'),
1923 'id' => 'auxin_whitelabel_theme_author_name',
1924 'section' => 'whitelabel-section-labels',
1925 'type' => 'text',
1926 'transport' => 'postMessage',
1927 'default' => ''
1928 );
1929
1930 $fields_sections_list['fields'][] = array(
1931 'title' => __('Theme Author URL', 'auxin-elements'),
1932 'id' => 'auxin_whitelabel_theme_author_url',
1933 'section' => 'whitelabel-section-labels',
1934 'type' => 'url',
1935 'transport' => 'postMessage',
1936 'default' => ''
1937 );
1938
1939 $fields_sections_list['fields'][] = array(
1940 'title' => __('Theme Description', 'auxin-elements'),
1941 'id' => 'auxin_whitelabel_theme_description',
1942 'section' => 'whitelabel-section-labels',
1943 'type' => 'textarea',
1944 'transport' => 'postMessage',
1945 'default' => ''
1946 );
1947
1948 $fields_sections_list['fields'][] = array(
1949 'title' => __('Theme Screenshot (1200x900)', 'auxin-elements'),
1950 'id' => 'auxin_whitelabel_theme_screenshot',
1951 'section' => 'whitelabel-section-labels',
1952 'type' => 'image',
1953 'transport' => 'postMessage',
1954 'default' => ''
1955 );
1956
1957 // Sub section - Custom Labels -------------------------------
1958
1959 $fields_sections_list['sections'][] = array(
1960 'id' => 'whitelabel-section-views',
1961 'parent' => 'whitelabel-section', // section parent's id
1962 'title' => __( 'Displays', 'auxin-elements'),
1963 'description' => __( 'Change PHLOX admin views.', 'auxin-elements')
1964 );
1965
1966 $fields_sections_list['fields'][] = array(
1967 'title' => __( 'Hide Notifications', 'auxin-elements' ),
1968 'description' => '',
1969 'id' => 'auxin_whitelabel_hide_notices',
1970 'section' => 'whitelabel-section-views',
1971 'dependency' => array(),
1972 'transport' => 'postMessage',
1973 'default' => '0',
1974 'type' => 'switch',
1975 );
1976
1977 $fields_sections_list['fields'][] = array(
1978 'title' => __( 'Hide Theme Badge', 'auxin-elements' ),
1979 'description' => '',
1980 'id' => 'auxin_whitelabel_hide_theme_badge',
1981 'section' => 'whitelabel-section-views',
1982 'dependency' => array(),
1983 'transport' => 'postMessage',
1984 'default' => '0',
1985 'type' => 'switch',
1986 );
1987
1988 $fields_sections_list['fields'][] = array(
1989 'title' => __( 'Hide Phlox Menu', 'auxin-elements' ),
1990 'description' => '',
1991 'id' => 'auxin_whitelabel_hide_menu',
1992 'section' => 'whitelabel-section-views',
1993 'dependency' => array(),
1994 'transport' => 'postMessage',
1995 'default' => '0',
1996 'type' => 'switch',
1997 );
1998
1999 $fields_sections_list['fields'][] = array(
2000 'title' => __( 'Hide Dashboard Section', 'auxin-elements' ),
2001 'description' => '',
2002 'id' => 'auxin_whitelabel_hide_dashboard_section',
2003 'section' => 'whitelabel-section-views',
2004 'dependency' => array(),
2005 'transport' => 'postMessage',
2006 'default' => '0',
2007 'dependency' => array(
2008 array(
2009 'id' => 'auxin_whitelabel_hide_menu',
2010 'value' => array('1'),
2011 'operator'=> '!='
2012 )
2013 ),
2014 'type' => 'switch',
2015 );
2016
2017 $fields_sections_list['fields'][] = array(
2018 'title' => __( 'Hide Customization Section', 'auxin-elements' ),
2019 'description' => '',
2020 'id' => 'auxin_whitelabel_hide_customization_section',
2021 'section' => 'whitelabel-section-views',
2022 'dependency' => array(),
2023 'transport' => 'postMessage',
2024 'default' => '0',
2025 'dependency' => array(
2026 array(
2027 'id' => 'auxin_whitelabel_hide_menu',
2028 'value' => array('1'),
2029 'operator'=> '!='
2030 )
2031 ),
2032 'type' => 'switch',
2033 );
2034
2035 $fields_sections_list['fields'][] = array(
2036 'title' => __( 'Hide Demo Importer Section', 'auxin-elements' ),
2037 'description' => '',
2038 'id' => 'auxin_whitelabel_hide_demo_importer_section',
2039 'section' => 'whitelabel-section-views',
2040 'dependency' => array(),
2041 'transport' => 'postMessage',
2042 'default' => '0',
2043 'dependency' => array(
2044 array(
2045 'id' => 'auxin_whitelabel_hide_menu',
2046 'value' => array('1'),
2047 'operator'=> '!='
2048 )
2049 ),
2050 'type' => 'switch',
2051 );
2052
2053 $fields_sections_list['fields'][] = array(
2054 'title' => __( 'Hide Template Kits Section', 'auxin-elements' ),
2055 'description' => '',
2056 'id' => 'auxin_whitelabel_hide_template_kits_section',
2057 'section' => 'whitelabel-section-views',
2058 'dependency' => array(),
2059 'transport' => 'postMessage',
2060 'default' => '0',
2061 'dependency' => array(
2062 array(
2063 'id' => 'auxin_whitelabel_hide_menu',
2064 'value' => array('1'),
2065 'operator'=> '!='
2066 )
2067 ),
2068 'type' => 'switch',
2069 );
2070
2071 $fields_sections_list['fields'][] = array(
2072 'title' => __( 'Hide Plugins Section', 'auxin-elements' ),
2073 'description' => '',
2074 'id' => 'auxin_whitelabel_hide_plugins_section',
2075 'section' => 'whitelabel-section-views',
2076 'dependency' => array(),
2077 'transport' => 'postMessage',
2078 'default' => '0',
2079 'dependency' => array(
2080 array(
2081 'id' => 'auxin_whitelabel_hide_menu',
2082 'value' => array('1'),
2083 'operator'=> '!='
2084 )
2085 ),
2086 'type' => 'switch',
2087 );
2088
2089 $fields_sections_list['fields'][] = array(
2090 'title' => __( 'Hide Tutorials Section', 'auxin-elements' ),
2091 'description' => '',
2092 'id' => 'auxin_whitelabel_hide_tutorials_section',
2093 'section' => 'whitelabel-section-views',
2094 'dependency' => array(),
2095 'transport' => 'postMessage',
2096 'default' => '0',
2097 'dependency' => array(
2098 array(
2099 'id' => 'auxin_whitelabel_hide_menu',
2100 'value' => array('1'),
2101 'operator'=> '!='
2102 )
2103 ),
2104 'type' => 'switch',
2105 );
2106
2107 $fields_sections_list['fields'][] = array(
2108 'title' => __( 'Hide Feedback Section', 'auxin-elements' ),
2109 'description' => '',
2110 'id' => 'auxin_whitelabel_hide_feedback_section',
2111 'section' => 'whitelabel-section-views',
2112 'dependency' => array(),
2113 'transport' => 'postMessage',
2114 'default' => '0',
2115 'dependency' => array(
2116 array(
2117 'id' => 'auxin_whitelabel_hide_menu',
2118 'value' => array('1'),
2119 'operator'=> '!='
2120 )
2121 ),
2122 'type' => 'switch',
2123 );
2124 }
2125
2126 return $fields_sections_list;
2127 }
2128
2129 add_filter( 'auxin_defined_option_fields_sections', 'auxin_add_theme_options_in_plugin', 12, 1 );
2130
2131
2132
2133
2134
2135 /*-----------------------------------------------------------------------------------*/
2136 /* Injects JavaScript codes from theme options in head
2137 /*-----------------------------------------------------------------------------------*/
2138
2139 function auxin_ele_add_js_to_head() {
2140 if( $inline_js = auxin_get_option( 'auxin_user_custom_js_head' ) ){
2141 echo '<script>'. $inline_js .'</script>';
2142 }
2143 }
2144 add_action( 'wp_head','auxin_ele_add_js_to_head' );
2145
2146
2147 function auxin_ele_add_google_analytics_code() {
2148 if( $google_analytics_code = auxin_get_option( 'auxin_user_google_analytics' ) ){
2149 ?>
2150 <script async src="https://www.googletagmanager.com/gtag/js?id=<?php echo esc_attr( $google_analytics_code ); ?>"></script><script>window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', '<?php echo esc_attr( $google_analytics_code ); ?>');</script>
2151 <?php
2152 }
2153 }
2154 add_action( 'wp_head','auxin_ele_add_google_analytics_code' );
2155
2156 /*-----------------------------------------------------------------------------------*/
2157 /* Injects JavaScript codes from theme options in JS file
2158 /*-----------------------------------------------------------------------------------*/
2159
2160 function auxin_ele_add_theme_options_to_js_file( $js ){
2161 $js['theme_options_custom'] = auxin_get_option( 'auxin_user_custom_js' );
2162
2163 $js['theme_options_google_marketing'] = auxin_get_option( 'auxin_user_google_marketing' );
2164
2165 // @deprecated in version 2.5.0
2166 unset( $js['theme_options_google_analytics'] );
2167
2168 return $js;
2169 }
2170 add_filter( 'auxin_custom_js_file_content', 'auxin_ele_add_theme_options_to_js_file' );
2171
2172
2173 /*-----------------------------------------------------------------------------------*/
2174 /* Adds the custom CSS class of the login page to body element
2175 /*-----------------------------------------------------------------------------------*/
2176
2177 function auxin_login_body_class( $classes ){
2178
2179 if( $custom_class = auxin_get_option('auxin_login_body_class' ) ){
2180 $classes['auxin_custom'] = $custom_class;
2181 }
2182
2183 if( $custom_skin = auxin_get_option('auxin_login_skin' ) ){
2184 $classes['auxin_skin'] = esc_attr( 'auxin-login-skin-' . $custom_skin );
2185 }
2186
2187 return $classes;
2188 }
2189 add_action( 'auxin_functions_ready', function(){
2190 add_filter( 'login_body_class', 'auxin_login_body_class' );
2191 });
2192
2193
2194
2195 /*-----------------------------------------------------------------------------------*/
2196 /* Adds proper styles for background and logo on login page
2197 /*-----------------------------------------------------------------------------------*/
2198
2199 function auxin_login_head(){
2200
2201 $styles = '';
2202
2203 if( $bg_image_id = auxin_get_option( 'auxin_login_logo_image' ) ){
2204 $bg_image = wp_get_attachment_url( $bg_image_id );
2205 $styles .= "background-image: url( $bg_image ); ";
2206
2207 $bg_width = auxin_get_option( 'auxin_login_logo_width' , '84' );
2208 $bg_height = auxin_get_option( 'auxin_login_logo_height', '84' );
2209
2210 $bg_width = rtrim( $bg_width , 'px' ) . 'px';
2211 $bg_height = rtrim( $bg_height, 'px' ) . 'px';
2212
2213 $styles .= "background-size: $bg_width $bg_height; ";
2214 $styles .= "width: $bg_width; height: $bg_height; ";
2215
2216 echo "<style>#login h1 a { $styles }</style>";
2217 }
2218
2219 if( auxin_get_option( 'auxin_login_bg_show' ) ){
2220
2221 // get styles for background image
2222 $bg_styles = auxin_generate_styles_for_backgroud_fields( 'auxin_login_bg', 'option', array(
2223 'color' => 'auxin_login_bg_color',
2224 'image' => 'auxin_login_bg_image',
2225 'repeat' => 'auxin_login_bg_repeat',
2226 'size' => 'auxin_login_bg_size',
2227 'position' => 'auxin_login_bg_position',
2228 'attachment' => 'auxin_login_bg_attachment',
2229 'clip' => 'auxin_login_bg_clip'
2230 ) );
2231
2232 $pattern_style = auxin_generate_styles_for_backgroud_fields( 'auxin_login_bg', 'option', array(
2233 'pattern' => 'auxin_login_bg_pattern'
2234 ) );
2235
2236 echo "<style>body.login { $bg_styles } body.login:before { $pattern_style }</style>";
2237 }
2238
2239 }
2240 add_action( 'auxin_functions_ready', function(){
2241 add_action( 'login_head', 'auxin_login_head' );
2242 });
2243
2244
2245 /*-----------------------------------------------------------------------------------*/
2246 /* Changes the login header url to home url
2247 /*-----------------------------------------------------------------------------------*/
2248
2249 function auxin_login_headerurl( $login_header_url ){
2250
2251 if ( ! is_multisite() ) {
2252 $login_header_url = home_url();
2253 }
2254 return $login_header_url;
2255 }
2256 add_action( 'auxin_functions_ready', function(){
2257 add_filter( 'login_headerurl', 'auxin_login_headerurl' );
2258 });
2259
2260 /*-----------------------------------------------------------------------------------*/
2261 /* Changes the login header url to home url
2262 /*-----------------------------------------------------------------------------------*/
2263
2264 function auxin_login_headertext( $login_header_title ){
2265
2266 if ( ! is_multisite() ) {
2267 $login_header_title = get_bloginfo( 'name' );
2268 }
2269 return $login_header_title;
2270 }
2271 add_action( 'auxin_functions_ready', function(){
2272 add_filter( 'login_headertext', 'auxin_login_headertext' );
2273 });
2274
2275 /*-----------------------------------------------------------------------------------*/
2276 /* Adds custom message above the login form
2277 /*-----------------------------------------------------------------------------------*/
2278
2279 function auxin_login_message( $login_message ){
2280
2281 if( $custom_message = auxin_get_option( 'auxin_login_message' ) ){
2282
2283 $message_wrapper_start = '<div class="message">';
2284 $message_wrapper_end = "</div>\n";
2285
2286 $custom_message_markup = $message_wrapper_start . $custom_message . $message_wrapper_end;
2287
2288 /**
2289 * Filter instructional messages displayed above the login form.
2290 *
2291 * @param string $custom_message Login message.
2292 */
2293 $login_message .= apply_filters( 'auxin_login_message', $custom_message_markup, $custom_message, $message_wrapper_start, $message_wrapper_end );
2294 }
2295
2296 return $login_message;
2297 }
2298 add_action( 'auxin_functions_ready', function(){
2299 add_filter( 'login_message', 'auxin_login_message' );
2300 });
2301
2302
2303 /*-----------------------------------------------------------------------------------*/
2304 /* Prints the custom js codes of a single page to the source page
2305 /*-----------------------------------------------------------------------------------*/
2306
2307 function auxin_custom_js_for_pages( $js, $post ){
2308 // The custom JS code for specific page
2309 if( $post && ! is_404() && is_singular() ) {
2310 $js .= get_post_meta( $post->ID, 'aux_page_custom_js', true );
2311 }
2312 return $js;
2313 }
2314 add_filter( 'auxin_footer_inline_script', 'auxin_custom_js_for_pages', 15, 2 );
2315
2316
2317 /*-----------------------------------------------------------------------------------*/
2318 /* Add preconnect for Google Fonts.
2319 /*-----------------------------------------------------------------------------------*/
2320
2321 /**
2322 * Add preconnect for Google Fonts.
2323 *
2324 * @param array $urls URLs to print for resource hints.
2325 * @param string $relation_type The relation type the URLs are printed.
2326 * @return array $urls URLs to print for resource hints.
2327 */
2328 function auxin_resource_hints( $urls, $relation_type ) {
2329 if ( wp_style_is( 'auxin-fonts-google', 'queue' ) && 'preconnect' === $relation_type ) {
2330 $urls[] = array(
2331 'href' => 'https://fonts.gstatic.com',
2332 'crossorigin',
2333 );
2334 }
2335 return $urls;
2336 }
2337 //add_filter( 'wp_resource_hints', 'auxin_resource_hints', 10, 2 );
2338
2339
2340 /*-----------------------------------------------------------------------------------*/
2341 /* Setup Header
2342 /*-----------------------------------------------------------------------------------*/
2343
2344 function auxin_after_setup_theme_extra(){
2345 // gererate shortcodes in widget text
2346 add_filter('widget_text', 'do_shortcode');
2347 // Remove wp ulike auto disaply filter
2348 remove_filter( 'the_content', 'wp_ulike_put_posts' );
2349 }
2350 add_action( 'after_setup_theme', 'auxin_after_setup_theme_extra' );
2351
2352 /*-----------------------------------------------------------------------------------*/
2353 /* add excerpts to pages
2354 /*-----------------------------------------------------------------------------------*/
2355
2356 function auxin_add_excerpts_to_pages() {
2357 add_post_type_support( 'page', 'excerpt' );
2358 }
2359 add_action( 'init', 'auxin_add_excerpts_to_pages' );
2360
2361
2362 /*-----------------------------------------------------------------------------------*/
2363 /* Add some user contact fields
2364 /*-----------------------------------------------------------------------------------*/
2365
2366 function auxin_user_contactmethods($user_contactmethods){
2367 $user_contactmethods['twitter'] = __('Twitter' , 'auxin-elements');
2368 $user_contactmethods['facebook'] = __('Facebook' , 'auxin-elements');
2369 $user_contactmethods['googleplus'] = __('Google Plus', 'auxin-elements');
2370 $user_contactmethods['flickr'] = __('Flickr' , 'auxin-elements');
2371 $user_contactmethods['delicious'] = __('Delicious' , 'auxin-elements');
2372 $user_contactmethods['pinterest'] = __('Pinterest' , 'auxin-elements');
2373 $user_contactmethods['github'] = __('GitHub' , 'auxin-elements');
2374 $user_contactmethods['skills'] = __('Skills' , 'auxin-elements');
2375
2376 return $user_contactmethods;
2377 }
2378 add_filter('user_contactmethods', 'auxin_user_contactmethods');
2379
2380
2381 /*-----------------------------------------------------------------------------------*/
2382 /* Add home page menu arg to menu item list
2383 /*-----------------------------------------------------------------------------------*/
2384
2385 function auxin_add_home_page_to_menu_args( $args ) {
2386 $args['show_home'] = true;
2387 return $args;
2388 }
2389 add_filter( 'wp_page_menu_args', 'auxin_add_home_page_to_menu_args' );
2390
2391 /*-----------------------------------------------------------------------------------*/
2392 /* Print meta tags to preview post while sharing on facebook
2393 /*-----------------------------------------------------------------------------------*/
2394
2395 if( ! defined('WPSEO_VERSION') && ! class_exists('All_in_One_SEO_Pack') ){
2396
2397 function auxin_facebook_header_meta (){
2398
2399 if( ! defined('AUXIN_VERSION') ){
2400 return;
2401 }
2402
2403 // return if built-in seo is disabled or "SEO by yoast" is active
2404 if( ! auxin_get_option( 'enable_theme_seo', 1 ) ) return;
2405
2406 global $post;
2407 if( ! isset( $post ) || ! is_singular() || is_search() || is_404() ) return;
2408 setup_postdata( $post );
2409
2410 $featured_image = auxin_get_the_post_thumbnail_src( $post->ID, 90, 90, true, 90 );
2411 $post_excerpt = get_the_excerpt();
2412 ?>
2413 <meta name="title" content="<?php echo esc_attr( $post->post_title ); ?>" />
2414 <meta name="description" content="<?php echo esc_attr( $post_excerpt ); ?>" />
2415 <?php if( $featured_image) { ?>
2416 <link rel="image_src" href="<?php echo $featured_image; ?>" />
2417 <?php }
2418
2419 }
2420
2421 add_action( 'wp_head', 'auxin_facebook_header_meta' );
2422 }
2423
2424 /*-----------------------------------------------------------------------------------*/
2425 /* Add SiteOrigin class prefix and custom field classes path
2426 /*-----------------------------------------------------------------------------------*/
2427 if ( auxin_is_plugin_active( 'so-widgets-bundle/so-widgets-bundle.php') ) {
2428
2429 function auxels_register_auxin_siteorigin_class_prefix( $class_prefixes ) {
2430 $class_prefixes[] = 'Auxin_SiteOrigin_Field_';
2431 return $class_prefixes;
2432 }
2433
2434 add_filter( 'siteorigin_widgets_field_class_prefixes', 'auxels_register_auxin_siteorigin_class_prefix' );
2435
2436
2437 function auxels_register_custom_fields( $class_paths ) {
2438 $class_paths[] = AUXELS_ADMIN_DIR . '/includes/compatibility/siteorigin/fields/';
2439 return $class_paths;
2440 }
2441
2442 add_filter( 'siteorigin_widgets_field_class_paths', 'auxels_register_custom_fields' );
2443 }
2444
2445
2446 /**
2447 * Replace WooCommerce Default Pagination with auxin pagination
2448 *
2449 */
2450 remove_action( 'woocommerce_pagination' , 'woocommerce_pagination', 10 );
2451 add_action ( 'woocommerce_pagination', 'auxin_woocommerce_pagination' , 10 );
2452
2453 function auxin_woocommerce_pagination() {
2454 auxin_the_paginate_nav(
2455 array( 'css_class' => auxin_get_option('archive_pagination_skin') )
2456 );
2457 }
2458
2459 /*-----------------------------------------------------------------------------------*/
2460 /* the function runs when auxin framework loaded
2461 /*-----------------------------------------------------------------------------------*/
2462
2463 function auxin_on_auxin_fw_admin_loaded(){
2464
2465 // assign theme custom capabilities to roles on first run
2466 if( ! auxin_get_theme_mod( 'are_auxin_caps_assigned', 0 ) ){
2467 add_action( 'admin_init' , 'auxin_assign_default_caps_for_post_types' );
2468 set_theme_mod( 'are_auxin_caps_assigned', 1 );
2469 }
2470 }
2471
2472 add_action( 'auxin_admin_loaded', 'auxin_on_auxin_fw_admin_loaded' );
2473
2474
2475 /*-------------------------------------------------------------------------------*/
2476 /* assigns theme custom post types capabilities to main roles
2477 /*-------------------------------------------------------------------------------*/
2478
2479 function auxin_assign_default_caps_for_post_types() {
2480 $auxin_registered_post_types = auxin_registered_post_types(true);
2481
2482 // the roles to add capabilities of custom post types to
2483 $roles = array('administrator', 'editor');
2484
2485 foreach ( $roles as $role_name ) {
2486
2487 $role = get_role( $role_name );
2488
2489 // loop through custom post types and add custom capabilities to defined rules
2490 foreach ( $auxin_registered_post_types as $post_type ) {
2491
2492 $post_type_object = get_post_type_object( $post_type );
2493 // add post type capabilities to role
2494 foreach ( $post_type_object->cap as $cap_key => $cap ) {
2495 if( ! in_array( $cap_key, array( 'edit_post', 'delete_post', 'read_post' ) ) )
2496 $role->add_cap( $cap );
2497 }
2498 }
2499
2500 }
2501 }
2502
2503
2504
2505
2506
2507 function auxels_add_post_type_metafields(){
2508
2509 $all_post_types = auxin_get_possible_post_types(true);
2510
2511 $auxin_is_admin = is_admin();
2512
2513 foreach ( $all_post_types as $post_type => $is_post_type_allowed ) {
2514
2515 if( ! $is_post_type_allowed ){
2516 continue;
2517 }
2518
2519 // define metabox args
2520 $metabox_args = array( 'post_type' => $post_type );
2521
2522 switch( $post_type ) {
2523
2524 case 'page':
2525
2526 $metabox_args['hub_id'] = 'axi_meta_hub_page';
2527 $metabox_args['hub_title'] = __('Page Options', 'auxin-elements');
2528 $metabox_args['to_post_types'] = array( $post_type );
2529
2530 break;
2531
2532 case 'post':
2533
2534 $metabox_args['hub_id'] = 'axi_meta_hub_post';
2535 $metabox_args['hub_title'] = __('Post Options', 'auxin-elements');
2536 $metabox_args['to_post_types'] = array( $post_type );
2537
2538 default:
2539 break;
2540 }
2541
2542 // Load metabox fields on admin
2543 if( $auxin_is_admin ){
2544 auxin_maybe_render_metabox_hub_for_post_type( $metabox_args );
2545 }
2546
2547 }
2548
2549 }
2550
2551 //add_action( 'init', 'auxels_add_post_type_metafields' );
2552
2553 /*-----------------------------------------------------------------------------------*/
2554 /* Add custom blog page tamplate
2555 /*-----------------------------------------------------------------------------------*/
2556
2557 /**
2558 * Add custom page templates
2559 *
2560 * @param string $result The current custom blog page template markup
2561 * @param string $page_template The name of page template
2562 *
2563 * @return string The markup for current page template
2564 */
2565 function auxels_blog_page_templates( $result, $page_template ){
2566
2567 // page number
2568 $paged = max( 1, get_query_var('paged'), get_query_var('page') );
2569
2570 // posts perpage
2571 $per_page = get_option( 'posts_per_page' );
2572
2573 // if template type is masonry
2574 if( strpos( $page_template, 'blog-type-6' ) ){
2575
2576 $args = array(
2577 'title' => '',
2578 'num' => $per_page,
2579 'paged' => $paged,
2580 'order_by' => 'menu_order date',
2581 'order' => 'desc',
2582 'show_media' => true,
2583 'exclude_without_media' => 0,
2584 'exclude_custom_post_formats' => 0,
2585 'exclude_quote_link' => esc_attr( auxin_get_option( 'post_exclude_quote_link_formats', 0 ) ),
2586 'loadmore_type' => esc_attr( auxin_get_option( 'post_index_loadmore_type', '' ) ),
2587 'show_title' => true,
2588 'show_info' => true,
2589 'show_readmore' => true,
2590 'show_author_footer' => false,
2591 'tag' => '',
2592 'reset_query' => true
2593 );
2594
2595 // get the shortcode base blog page
2596 $result = auxin_widget_recent_posts_masonry_callback( $args );
2597 }
2598
2599 // if template type is tiles
2600 elseif( strpos( $page_template, 'blog-type-9' ) ){
2601
2602 $args = array(
2603 'title' => '',
2604 'num' => $per_page,
2605 'paged' => $paged,
2606 'order_by' => 'menu_order date',
2607 'order' => 'desc',
2608 'show_media' => true,
2609 'exclude_without_media' => 0,
2610 'exclude_custom_post_formats' => 0,
2611 'exclude_quote_link' => esc_attr( auxin_get_option( 'post_exclude_quote_link_formats', 0 ) ),
2612 'loadmore_type' => esc_attr( auxin_get_option( 'post_index_loadmore_type', '' ) ),
2613 'show_title' => true,
2614 'show_info' => true,
2615 'show_readmore' => true,
2616 'show_author_footer' => false,
2617 'tag' => '',
2618 'reset_query' => true
2619 );
2620
2621 // get the shortcode base blog page
2622 $result = auxin_widget_recent_posts_tiles_callback( $args );
2623 }
2624
2625 // if template type is land
2626 elseif( strpos( $page_template, 'blog-type-8' ) ){
2627
2628 $args = array(
2629 'title' => '',
2630 'num' => $per_page,
2631 'paged' => $paged,
2632 'order_by' => 'menu_order date',
2633 'order' => 'desc',
2634 'show_media' => true,
2635 'exclude_without_media' => 0,
2636 'exclude_custom_post_formats' => 0,
2637 'exclude_quote_link' => esc_attr( auxin_get_option( 'post_exclude_quote_link_formats', 0 ) ),
2638 'loadmore_type' => esc_attr( auxin_get_option( 'post_index_loadmore_type', '' ) ),
2639 'show_excerpt' => true,
2640 'excerpt_len' => '160',
2641 'show_title' => true,
2642 'show_info' => true,
2643 'show_readmore' => true,
2644 'show_author_footer' => false,
2645 'tag' => '',
2646 'reset_query' => true
2647 );
2648
2649 // get the shortcode base blog page
2650 $result = auxin_widget_recent_posts_land_style_callback( $args );
2651 }
2652
2653 // if template type is timeline
2654 elseif( strpos( $page_template, 'blog-type-7' ) ){
2655
2656 $args = array(
2657 'title' => '',
2658 'num' => $per_page,
2659 'paged' => $paged,
2660 'order_by' => 'menu_order date',
2661 'order' => 'desc',
2662 'exclude_quote_link' => esc_attr( auxin_get_option( 'post_exclude_quote_link_formats', 1 ) ),
2663 'loadmore_type' => esc_attr( auxin_get_option( 'post_index_loadmore_type', '' ) ),
2664 'show_media' => true,
2665 'show_excerpt' => true,
2666 'excerpt_len' => '160',
2667 'show_title' => true,
2668 'show_info' => true,
2669 'show_readmore' => true,
2670 'show_author_footer' => false,
2671 'timeline_alignment' => 'center',
2672 'tag' => '',
2673 'reset_query' => true
2674 );
2675
2676 // get the shortcode base blog page
2677 $result = auxin_widget_recent_posts_timeline_callback( $args );
2678 }
2679
2680 // if template type is grid
2681 elseif( strpos( $page_template, 'blog-type-5' ) ){
2682
2683 $args = array(
2684 'title' => '',
2685 'num' => $per_page,
2686 'order_by' => 'menu_order date',
2687 'order' => 'desc',
2688 'exclude_quote_link' => esc_attr( auxin_get_option( 'post_exclude_quote_link_formats', 1 ) ),
2689 'paged' => $paged,
2690 'show_media' => true,
2691 'display_like' => esc_attr( auxin_get_option( 'show_blog_archive_like_button', 1 ) ),
2692 'loadmore_type' => esc_attr( auxin_get_option( 'post_index_loadmore_type', '' ) ),
2693 'show_excerpt' => true,
2694 'excerpt_len' => '160',
2695 'show_title' => true,
2696 'show_info' => true,
2697 'show_readmore' => true,
2698 'show_author_footer' => false,
2699 'desktop_cnum' => esc_attr( auxin_get_option( 'post_index_column_number', 4 ) ),
2700 'tablet_cnum' => esc_attr( auxin_get_option( 'post_index_column_number_tablet', 2 ) ),
2701 'phone_cnum' => esc_attr( auxin_get_option( 'post_index_column_number_mobile', 1 ) ),
2702 'preview_mode' => 'grid',
2703 'tag' => '',
2704 'reset_query' => true
2705 );
2706
2707 // get the shortcode base blog page
2708 $result = auxin_widget_recent_posts_callback( $args );
2709 }
2710
2711 return $result;
2712 }
2713
2714 add_filter( 'auxin_blog_page_template_archive_content', 'auxels_blog_page_templates', 10, 2 );
2715
2716
2717 /*-----------------------------------------------------------------------------------*/
2718 /* Add custom blog archive tamplate types
2719 /*-----------------------------------------------------------------------------------*/
2720
2721 /**
2722 * Add custom page templates
2723 *
2724 * @param string $result The current custom blog loop template markup
2725 * @param string $page_template The ID of template type option
2726 *
2727 * @return string The markup for current blog archive page
2728 */
2729 function auxels_add_blog_archive_custom_template_layouts( $result, $template_type_id ){
2730
2731 // get template type id
2732 $post_loadmore_type = auxin_get_option( 'post_index_loadmore_type', '' );
2733 // get the length of content
2734 $excerpt_len = esc_attr( auxin_get_option( 'blog_content_on_listing_length' ) );
2735
2736 // default value for showing info
2737 $show_post_info = $show_post_date = $show_post_author = $show_post_categories = true;
2738
2739 $author_or_readmore = 'readmore';
2740 $show_post_date = true;
2741 $show_post_categories = true;
2742 $blog_content_on_listing = 'excerpt';
2743 $display_comments = true;
2744 $display_author_header = true;
2745 $display_author_footer = false;
2746
2747 // Use taxonomy template option if is category or tag archive page
2748
2749 if( is_category() || is_tag() ){
2750 $author_or_readmore = auxin_get_option( 'display_post_taxonomy_author_readmore', 'readmore');
2751 $post_loadmore_type = auxin_get_option( 'post_taxonomy_loadmore_type', '' );
2752 $excerpt_len = auxin_get_option( 'post_taxonomy_archive_on_listing_length', '' );
2753 $show_post_info = auxin_get_option( 'display_post_taxonomy_info', true );
2754 $show_post_date = auxin_get_option( 'display_post_taxonomy_info_date', true );
2755 $show_post_categories = auxin_get_option( 'display_post_taxonomy_info_categories', true );
2756 $blog_content_on_listing = auxin_get_option( 'post_taxonomy_archive_content_on_listing', 'excerpt' );
2757 $display_comments = auxin_get_option( 'display_post_taxonomy_widget_comments', true);
2758 $display_author_header = auxin_get_option( 'display_post_taxonomy_author_header', true);
2759 $display_author_footer = auxin_get_option( 'display_post_taxonomy_author_footer', false);
2760
2761 } elseif ( auxin_is_blog() ) {
2762 $author_or_readmore = auxin_get_option( 'blog_display_author_readmore', 'readmore');
2763 $display_author_header = auxin_get_option( 'blog_display_author_header', true);
2764 $display_author_footer = auxin_get_option( 'blog_display_author_footer', false);
2765 $show_post_info = auxin_get_option( 'display_post_info', true );
2766 $show_post_date = auxin_get_option( 'display_post_info_date', true );
2767 $show_post_categories = auxin_get_option( 'display_post_info_categories', true );
2768 $blog_content_on_listing = auxin_get_option( 'blog_content_on_listing', 'excerpt' );
2769 $excerpt_len = auxin_get_option( 'blog_content_on_listing_length', '' );
2770 $display_comments = auxin_get_option( 'display_post_comments_number', true);
2771 } else {
2772 $blog_content_on_listing = 'excerpt';
2773 }
2774
2775 $show_post_author = $show_post_author ? 'author' : 'readmore';
2776 $show_excerpt = 'none' === $blog_content_on_listing ? false : true ;
2777 $excerpt_len = 'full' === $blog_content_on_listing ? null : $excerpt_len ;
2778
2779 // page number
2780 $paged = max( 1, get_query_var('paged'), get_query_var('page') );
2781 // posts perpage
2782 $per_page = get_option( 'posts_per_page' );
2783
2784 if( 6 == $template_type_id ){
2785 $args = array(
2786 'num' => $per_page,
2787 'exclude_without_media' => esc_attr( auxin_get_option( 'exclude_without_media' ) ),
2788 'exclude_custom_post_formats' => 0,
2789 'exclude_quote_link' => esc_attr( auxin_get_option( 'post_exclude_quote_link_formats', 1 ) ),
2790 'display_like' => esc_attr( auxin_get_option( 'show_blog_archive_like_button', 1 ) ),
2791 'display_comments' => $display_comments,
2792 'display_author_footer' => $display_author_footer,
2793 'display_author_header' => $display_author_header,
2794 'loadmore_type' => esc_attr( $post_loadmore_type ),
2795 'paged' => $paged,
2796 'show_media' => true,
2797 'show_excerpt' => $show_excerpt,
2798 'excerpt_len' => $excerpt_len,
2799 'show_info' => esc_attr( $show_post_info ),
2800 'show_date' => esc_attr( $show_post_date ),
2801 'display_categories' => esc_attr( $show_post_categories ),
2802 'author_or_readmore' => $author_or_readmore,
2803 'content_layout' => esc_attr( auxin_get_option( 'post_index_column_content_layout', 'full' ) ),
2804 'desktop_cnum' => esc_attr( auxin_get_option( 'post_index_column_number' ) ),
2805 'tablet_cnum' => esc_attr( auxin_get_option( 'post_index_column_number_tablet' ) ),
2806 'phone_cnum' => esc_attr( auxin_get_option( 'post_index_column_number_mobile' ) ),
2807 'tag' => '',
2808 'extra_classes' => '',
2809 'custom_el_id' => '',
2810 'reset_query' => false,
2811 'use_wp_query' => true,
2812 'request_from' => 'archive'
2813 );
2814
2815 $result = auxin_widget_recent_posts_masonry_callback( $args );
2816
2817 // if template type is tiles
2818 } elseif( 9 == $template_type_id ){
2819
2820 $args = array(
2821 'num' => $per_page,
2822 'exclude_without_media' => esc_attr( auxin_get_option( 'exclude_without_media' ) ),
2823 'exclude_custom_post_formats' => 0,
2824 'exclude_quote_link' => esc_attr( auxin_get_option( 'post_exclude_quote_link_formats', 1 ) ),
2825 'loadmore_type' => esc_attr( $post_loadmore_type ),
2826 'paged' => $paged,
2827 'show_media' => true,
2828 'show_excerpt' => $show_excerpt,
2829 'excerpt_len' => $excerpt_len,
2830 'display_title' => true,
2831 'display_comments' => $display_comments,
2832 'show_info' => esc_attr( $show_post_info ),
2833 'show_date' => esc_attr( $show_post_date ),
2834 'display_categories' => esc_attr( $show_post_categories ),
2835 'author_or_readmore' => $author_or_readmore,
2836 'display_author_footer' => $display_author_footer,
2837 'display_author_header' => $display_author_header,
2838 'tag' => '',
2839 'extra_classes' => '',
2840 'custom_el_id' => '',
2841 'reset_query' => false,
2842 'use_wp_query' => true,
2843 'request_from' => 'archive'
2844 );
2845
2846 $result = auxin_widget_recent_posts_tiles_callback( $args );
2847
2848 // if template type is land
2849 } elseif( 8 == $template_type_id ){
2850
2851 $args = array(
2852 'num' => $per_page,
2853 'exclude_without_media' => esc_attr( auxin_get_option( 'exclude_without_media' ) ),
2854 'exclude_custom_post_formats' => 0,
2855 'exclude_quote_link' => esc_attr( auxin_get_option( 'post_exclude_quote_link_formats', 1 ) ),
2856 'show_media' => true,
2857 'paged' => $paged,
2858 'display_like' => esc_attr( auxin_get_option( 'show_blog_archive_like_button', 1 ) ),
2859 'display_comments' => $display_comments,
2860 'loadmore_type' => esc_attr( $post_loadmore_type ),
2861 'show_excerpt' => $show_excerpt,
2862 'excerpt_len' => $excerpt_len,
2863 'display_title' => true,
2864 'show_info' => esc_attr( $show_post_info ),
2865 'show_date' => esc_attr( $show_post_date ),
2866 'display_categories' => esc_attr( $show_post_categories ),
2867 'author_or_readmore' => $author_or_readmore,
2868 'display_author_footer' => $display_author_footer,
2869 'display_author_header' => $display_author_header,
2870 'image_aspect_ratio' => esc_attr( auxin_get_option( 'post_image_aspect_ratio' ) ),
2871 'tag' => '',
2872 'extra_classes' => '',
2873 'custom_el_id' => '',
2874 'reset_query' => false,
2875 'use_wp_query' => true,
2876 'request_from' => 'archive'
2877 );
2878
2879 $result = auxin_widget_recent_posts_land_style_callback( $args );
2880
2881 // if template type is timeline
2882 } elseif( 7 == $template_type_id ){
2883
2884 $args = array(
2885 'num' => $per_page,
2886 'exclude_without_media' => esc_attr( auxin_get_option( 'exclude_without_media' ) ),
2887 'exclude_custom_post_formats' => 0,
2888 'exclude_quote_link' => esc_attr( auxin_get_option( 'post_exclude_quote_link_formats', 1 ) ),
2889 'show_media' => true,
2890 'paged' => $paged,
2891 'display_like' => esc_attr( auxin_get_option( 'show_blog_archive_like_button', 1 ) ),
2892 'display_comments' => $display_comments,
2893 'loadmore_type' => esc_attr( $post_loadmore_type ),
2894 'show_excerpt' => $show_excerpt,
2895 'excerpt_len' => $excerpt_len,
2896 'display_title' => true,
2897 'show_info' => esc_attr( $show_post_info ),
2898 'show_date' => esc_attr( $show_post_date ),
2899 'display_categories' => esc_attr( $show_post_categories ),
2900 'author_or_readmore' => $author_or_readmore,
2901 'display_author_footer' => $display_author_footer,
2902 'display_author_header' => $display_author_header,
2903 'image_aspect_ratio' => esc_attr( auxin_get_option( 'post_image_aspect_ratio' ) ),
2904 'timeline_alignment' => esc_attr( auxin_get_option( 'post_index_timeline_alignment', 'center' ) ),
2905 'tag' => '',
2906 'reset_query' => false,
2907 'use_wp_query' => true,
2908 'request_from' => 'archive'
2909 );
2910
2911 $result = auxin_widget_recent_posts_timeline_callback( $args );
2912
2913 // if template type is grid
2914 } elseif( 5 == $template_type_id ){
2915
2916 $args = array(
2917 'num' => $per_page,
2918 'exclude_without_media' => esc_attr( auxin_get_option( 'exclude_without_media' ) ),
2919 'exclude_custom_post_formats' => 0,
2920 'exclude_quote_link' => esc_attr( auxin_get_option( 'post_exclude_quote_link_formats', 1 ) ),
2921 'show_media' => true,
2922 'show_excerpt' => $show_excerpt,
2923 'paged' => $paged,
2924 'post_info_position' => esc_attr( auxin_get_option( 'post_info_position', 'after-title' ) ),
2925 'show_info' => esc_attr( $show_post_info ),
2926 'show_date' => esc_attr( $show_post_date ),
2927 'display_categories' => esc_attr( $show_post_categories ),
2928 'display_like' => esc_attr( auxin_get_option( 'show_blog_archive_like_button', 1 ) ),
2929 'display_comments' => $display_comments,
2930 'loadmore_type' => esc_attr( $post_loadmore_type ),
2931 'content_layout' => esc_attr( auxin_get_option( 'post_index_column_content_layout', 'full' ) ),
2932 'excerpt_len' => $excerpt_len,
2933 'display_title' => true,
2934 'author_or_readmore' => $author_or_readmore,
2935 'display_author_footer' => $display_author_footer,
2936 'display_author_header' => $display_author_header,
2937 'image_aspect_ratio' => esc_attr( auxin_get_option( 'post_image_aspect_ratio' ) ),
2938 'desktop_cnum' => esc_attr( auxin_get_option( 'post_index_column_number' ) ),
2939 'tablet_cnum' => esc_attr( auxin_get_option( 'post_index_column_number_tablet' ) ),
2940 'phone_cnum' => esc_attr( auxin_get_option( 'post_index_column_number_mobile' ) ),
2941 'preview_mode' => 'grid',
2942 'tag' => '',
2943 'reset_query' => false,
2944 'use_wp_query' => true,
2945 'request_from' => 'archive'
2946 );
2947
2948 $result = auxin_widget_recent_posts_callback( $args );
2949 }
2950
2951 return $result;
2952 }
2953
2954 add_filter( 'auxin_blog_archive_custom_template_layouts', 'auxels_add_blog_archive_custom_template_layouts', 10, 2 );
2955
2956
2957 /*-----------------------------------------------------------------------------------*/
2958 /* Add Boxed layout to siteorigin row layout types
2959 /*-----------------------------------------------------------------------------------*/
2960
2961 function auxin_so_row_style_attributes( $attributes, $style ){
2962
2963 if ( ! empty( $style['row_stretch'] ) && 'boxed' === $style['row_stretch'] ) {
2964 if( ( $key = array_search( 'siteorigin-panels-stretch', $attributes['class'] ) ) !== false ) {
2965 unset( $attributes['class'][ $key ] );
2966 }
2967 $attributes['class'][] = 'aux-fold';
2968 }
2969
2970 return $attributes;
2971 }
2972 add_filter( 'siteorigin_panels_row_style_attributes', 'auxin_so_row_style_attributes', 12, 2 );
2973
2974 /*-----------------------------------------------------------------------------------*/
2975 /* Add Boxed layout to siteorigin row layout types
2976 /*-----------------------------------------------------------------------------------*/
2977
2978 function auxin_so_row_style_fields( $fields ){
2979 $fields['row_stretch']['options']['boxed'] = __( 'Boxed', 'auxin-elements' );
2980
2981 return $fields;
2982 }
2983 add_filter( 'siteorigin_panels_row_style_fields', 'auxin_so_row_style_fields', 15 );
2984
2985 /*-----------------------------------------------------------------------------------*/
2986 /* Filtering wp_title to improve seo and letting seo plugins to filter the output too
2987 /*-----------------------------------------------------------------------------------*/
2988
2989 if( ! defined( 'WPSEO_VERSION') ){
2990
2991 function auxin_wp_title($title, $sep, $seplocation) {
2992 global $page, $paged, $post;
2993
2994 // Don't affect feeds
2995 if ( is_feed() ) return $title;
2996
2997 // Add the blog name
2998 if ( 'right' == $seplocation )
2999 $title .= get_bloginfo( 'name' );
3000 else
3001 $title = get_bloginfo( 'name' ) . $title;
3002
3003 // Add the blog description for the home/front page
3004 $site_description = get_bloginfo( 'description', 'display' );
3005 if ( $site_description && ( is_home() || is_front_page() ) )
3006 $title .= " $sep $site_description";
3007
3008 // Add a page number if necessary
3009 if ( $paged >= 2 || $page >= 2 )
3010 $title .= " $sep " . sprintf( __( 'Page %s', 'auxin-elements'), max( $paged, $page ) );
3011
3012 return $title;
3013 }
3014
3015 add_filter( 'wp_title', 'auxin_wp_title', 10, 3 );
3016 }
3017
3018 /*-----------------------------------------------------------------------------------*/
3019 /* Add new functionality in wp default playlist
3020 /*-----------------------------------------------------------------------------------*/
3021
3022 function auxin_underscore_playlist_templates(){
3023 ?>
3024 <script type="text/html" id="tmpl-wp-playlist-current-item">
3025 <# if ( data.image ) { #>
3026 <img src="{{ data.thumb.src }}" alt="" />
3027 <# } #>
3028 <div class="wp-playlist-caption">
3029 <span class="wp-playlist-item-meta wp-playlist-item-title"><?php
3030 /* translators: playlist item title */
3031 printf( _x( '&#8220;%s&#8221;', 'playlist item title' ), '{{ data.title }}' );
3032 ?></span>
3033 <# if ( data.meta.album ) { #><span class="wp-playlist-item-meta wp-playlist-item-album">{{ data.meta.album }}</span><# } #>
3034 <# if ( data.meta.artist ) { #><span class="wp-playlist-item-meta wp-playlist-item-artist">{{ data.meta.artist }}</span><# } #>
3035 </div>
3036 </script>
3037 <script type="text/html" id="tmpl-wp-playlist-item">
3038 <div class="wp-playlist-item">
3039 <#
3040 var isThumbnailExist = data.thumb.src.indexOf("wp-includes/images/media") > 0 ? 'aux-has-no-thubmnail' : '';
3041 #>
3042 <a class="wp-playlist-caption {{ isThumbnailExist }}" href="{{ data.src }}">
3043 <# if ( data.image ) { #>
3044 <img class="wp-playlist-item-artist" src="{{ data.thumb.src }}" alt="{{ data.title }}" />
3045 <# } #>
3046 <# if ( data.meta.length_formatted ) { #>
3047 <span class="wp-playlist-item-length">{{ data.meta.length_formatted }}</span>
3048 <# } #>
3049 </a>
3050 <div class="wp-playlist-item-title" >
3051 <a href="{{ data.src }}">
3052 <h4>
3053 <# if ( data.caption ) { #>
3054 <?php
3055 /* translators: playlist item title */
3056 printf( _x( '%s', 'playlist item title' ), '{{{ data.caption }}}' );
3057 ?>
3058 <# } else { #>
3059 <?php
3060 /* translators: playlist item title */
3061 printf( _x( '%s', 'playlist item title' ), '{{{ data.title }}}' );
3062 ?>
3063 <# } #>
3064 </h4>
3065 </a>
3066 </div>
3067 </div>
3068 </script>
3069 <?php
3070 }
3071
3072 function auxin_modify_wp_playlist_scripts(){
3073 remove_action ( 'wp_footer' , 'wp_underscore_playlist_templates' , 0 );
3074 remove_action ( 'admin_footer' , 'wp_underscore_playlist_templates' , 0 );
3075 add_action ( 'wp_footer' , 'auxin_underscore_playlist_templates' , 0 );
3076 add_action ( 'admin_footer' , 'auxin_underscore_playlist_templates' , 0 );
3077 }
3078 add_action( 'wp_playlist_scripts', 'auxin_modify_wp_playlist_scripts', 15 );
3079
3080 /*-----------------------------------------------------------------------------------*/
3081 /* Redirects a 404 page to the custom one if available
3082 /*-----------------------------------------------------------------------------------*/
3083
3084 function auxin_redirect_custom_404_page() {
3085
3086 if( 'default' !== $custom_404_page = auxin_get_option( 'auxin_404_page', 'default ') ) {
3087 if( is_404() ){
3088 wp_redirect( get_permalink( $custom_404_page ) );
3089 exit();
3090 }
3091 global $post;
3092
3093 if( ! empty( $post->ID ) && $post->ID == $custom_404_page ){
3094 status_header(404);
3095 nocache_headers();
3096 }
3097 }
3098
3099 }
3100 add_action( 'template_redirect', 'auxin_redirect_custom_404_page' );
3101
3102 /*-----------------------------------------------------------------------------------*/
3103
3104 /**
3105 * Loads a PHP file which includes special functionalities for a custom site
3106 * @return void
3107 */
3108 function load_special_demo_functionality(){
3109 if( auxin_get_option( 'special_php_file_enabled', 0 ) ){
3110 $file_path = THEME_CUSTOM_DIR .'/'. auxin_get_option('special_php_file_name', 'functions') .'.php';
3111 if( file_exists( $file_path ) ){
3112 include_once $file_path;
3113 }
3114 }
3115 }
3116 add_action( 'auxin_loaded', 'load_special_demo_functionality' );
3117
3118
3119 /**
3120 * Automatically clear autoptimizeCache if it goes beyond 256MB
3121 *
3122 * @return void
3123 */
3124 function auxin_maybe_flush_autoptimize_big_cache(){
3125 // Check transient
3126 if ( false === auxin_get_transient( 'auxin_maybe_flush_autoptimize_cache' ) ) {
3127
3128 if ( class_exists('autoptimizeCache') ) {
3129 $theMaxSize = 256000;
3130 $statArr = autoptimizeCache::stats();
3131 $cacheSize = round($statArr[1]/1024);
3132
3133 if ( $cacheSize > $theMaxSize ){
3134 autoptimizeCache::clearall();
3135 # Refresh the page so that autoptimize can create new cache files and it does breaks the page after clearall.
3136 header("Refresh:0");
3137 }
3138 }
3139 auxin_set_transient( 'auxin_maybe_flush_autoptimize_cache', 2 * DAY_IN_SECONDS );
3140 }
3141
3142 }
3143
3144 add_action( 'auxin_loaded', 'auxin_maybe_flush_autoptimize_big_cache' );
3145
3146 /*-----------------------------------------------------------------------------------*/
3147
3148 /**
3149 * Replace the primary logo on the page if custom logo was specified
3150 *
3151 * @param int $logo_id The current primary logo ID
3152 * @param array $args The primary logo args
3153 * @return int The primary logo ID
3154 */
3155 function auxin_page_custom_primary_logo_id( $logo_id ){
3156 global $post;
3157
3158 if( empty( $post->ID ) ){
3159 return $logo_id;
3160 }
3161
3162 // Check if the custom logo for page is enabled
3163 if( ! auxin_is_true( auxin_get_post_meta( $post, 'aux_use_custom_logo', 0 ) ) ){
3164 return $logo_id;
3165 }
3166
3167 if( ( $custom_logo_id = auxin_get_post_meta( $post, 'aux_custom_logo' ) ) && is_numeric( $custom_logo_id ) ){
3168 return $custom_logo_id;
3169 }
3170
3171 return $logo_id;
3172 }
3173
3174 add_filter( 'theme_mod_custom_logo', 'auxin_page_custom_primary_logo_id' );
3175
3176
3177 /**
3178 * Replace the custom logo on the page if custom logo was specified
3179 *
3180 * @param int $logo_id The current secondary logo ID
3181 * @param array $args The secondary logo args
3182 * @return int The secondary logo ID
3183 */
3184 function auxin_page_custom_secondary_logo_id( $logo_id, $args ){
3185 global $post;
3186
3187 if( empty( $post->ID ) ){
3188 return $logo_id;
3189 }
3190
3191 // Check if the custom logo for page is enabled
3192 if( ! auxin_is_true( auxin_get_post_meta( $post, 'aux_use_custom_logo', 0 ) ) ){
3193 return $logo_id;
3194 }
3195
3196 if( $custom_logo_id = auxin_get_post_meta( $post, 'aux_custom_logo2' ) ){
3197 return $custom_logo_id;
3198 }
3199
3200 return $logo_id;
3201 }
3202
3203 add_filter( 'auxin_secondary_logo_id', 'auxin_page_custom_secondary_logo_id', 10, 2 );
3204
3205 /*-----------------------------------------------------------------------------------*/
3206
3207 /**
3208 * Disable the query monitor on Elementor preview mode
3209 *
3210 * @return bool Whether to displatche the debug report or not
3211 */
3212 function auxin_disable_query_monitor_on_elementor( $debug_enabled ){
3213 if( class_exists( '\\Elementor\\Plugin' ) && \Elementor\Plugin::$instance->preview->is_preview_mode() ){
3214 return false;
3215 }
3216 return $debug_enabled;
3217 }
3218 add_filter( 'qm/dispatch/ajax', "auxin_disable_query_monitor_on_elementor" );
3219 add_filter( 'qm/dispatch/html', "auxin_disable_query_monitor_on_elementor" );
3220
3221 /*-----------------------------------------------------------------------------------*/
3222 /* Function For Checking is website on maintenance mode
3223 /*-----------------------------------------------------------------------------------*/
3224
3225 function auxin_is_maintenance() {
3226 if ( ( function_exists('auxin_get_option') && auxin_get_option('auxin_maintenance_enable', '0') ) || file_exists( ABSPATH . '.maintenance' ) ){
3227 return true;
3228 } else {
3229 return false;
3230 }
3231
3232 }
3233 add_action( 'get_header', 'auxin_is_maintenance' );
3234
3235 /*-----------------------------------------------------------------------------------*/
3236 /* Fixing a fatal error while saving the content with page builder enabled
3237 /*-----------------------------------------------------------------------------------*/
3238
3239 function auxin_load_template_function_for_page_builders(){
3240 if( is_admin() ){
3241 locate_template( AUXIN_INC . 'include/templates/templates-header.php', true, true );
3242 locate_template( AUXIN_INC . 'include/templates/templates-post.php' , true, true );
3243 locate_template( AUXIN_INC . 'include/templates/templates-footer.php', true, true );
3244 }
3245 }
3246 add_action('save_post', 'auxin_load_template_function_for_page_builders', 7, 1);
3247 add_action('wp_ajax_wpseo_filter_shortcodes', 'auxin_load_template_function_for_page_builders', 7, 1);
3248
3249 /*-----------------------------------------------------------------------------------*/
3250 /* Function For Let the user To use custom page for Maintenance and Comingsoon
3251 /*-----------------------------------------------------------------------------------*/
3252 //
3253 function auxin_custom_maintenance_page() {
3254
3255 if( auxin_is_maintenance() && !current_user_can('manage_options') ){
3256
3257 $page = auxin_get_option( 'auxin_maintenance_page', 'default');
3258 $url = get_permalink( $page );
3259 $url_protocols = array( 'http://', 'https://' );
3260 $url_str = str_replace( $url_protocols, '', $url );
3261 $current_url = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
3262
3263 /* Tell search engines that the site is temporarily unavailable */
3264 $protocol = $_SERVER['SERVER_PROTOCOL'];
3265
3266 if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol ) {
3267 $protocol = 'HTTP/1.0';
3268 }
3269
3270 header( "$protocol 503 Service Unavailable", true, 503 );
3271 header( 'Content-Type: text/html; charset=utf-8' );
3272
3273 if ( 'default' !== $page && ( $current_url !== $url_str ) ){
3274 header( "Location: " .$url );
3275 exit();
3276 } else if ( 'default' === $page ) {
3277 include auxin_get_template_file( 'maintenance' , '', AUXELS()->template_path() );
3278 }
3279 }
3280
3281 }
3282
3283 add_action( 'wp', 'auxin_custom_maintenance_page');
3284
3285 /*-----------------------------------------------------------------------------------*/
3286
3287
3288 /**
3289 * Add Subfooter and Subfooter bar to Wocommerce templates
3290 */
3291
3292 function auxin_display_shop_footer_sidebar() {
3293 get_sidebar('footer');
3294 }
3295
3296 add_action( 'woocommerce_sidebar', 'auxin_display_shop_footer_sidebar', 10 );
3297
3298
3299
3300 /*-----------------------------------------------------------------------------------*/
3301 /* Star Rating Markup for WooCommerce
3302 /*-----------------------------------------------------------------------------------*/
3303
3304 function auxin_get_star_rating_html( $rating_html, $rating ){
3305
3306 if ( $rating > 0 ) {
3307
3308 // Round Rating value to neareset value 1.5 => 1.5 , 1.8 => 2 , 1.1 => 1
3309 $decimal_value = $rating - floor($rating) ;
3310
3311 if ( 0.5 != $decimal_value ) {
3312 $rating = round( ( $rating * 2 ) / 2 ) ;
3313 }
3314
3315 $rating_html = '<div class="aux-rating-box aux-star-rating">';
3316 $rating_html .= '<span class="aux-star-rating-avg" style="width: ' . ( $rating / 5 ) * 100 .'%">';
3317 $rating_html .= '</span>';
3318 $rating_html .= '</div>';
3319 } else {
3320 $rating_html = '';
3321 }
3322
3323 return $rating_html;
3324 }
3325
3326 add_filter( 'woocommerce_product_get_rating_html', 'auxin_get_star_rating_html', 10, 2 );
3327
3328 /*-----------------------------------------------------------------------------------*/
3329 /* Enable ajax add to cart on free version
3330 /*-----------------------------------------------------------------------------------*/
3331 function auxels_enable_woocommerce_ajax_add_to_cart( $args ){
3332 if( ! defined('AUXSHP_VERSION' ) ) {
3333 global $product;
3334 $args['class'] = implode( ' ', array_filter( array(
3335 'button',
3336 'aux-ajax-add-to-cart',
3337 'product_type_' . $product->get_type(),
3338 $product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : ''
3339 ) ) );
3340
3341 $args['attributes']['data-product-type'] = $product->get_type();
3342 $args['attributes']['data-verify_nonce'] = wp_create_nonce( 'aux_add_to_cart-' . $product->get_id() );
3343 }
3344
3345 return $args;
3346 }
3347
3348 add_filter( 'woocommerce_loop_add_to_cart_args', 'auxels_enable_woocommerce_ajax_add_to_cart', 10 );
3349
3350 /**
3351 * Override inner body sections hooks for replace header&footer
3352 *
3353 * @return void
3354 */
3355 function auxin_override_inner_body_sections(){
3356
3357 global $post;
3358
3359 if( ! class_exists( '\Elementor\Plugin' ) ){
3360 return;
3361 }
3362
3363 if ( 'default' === $use_legacy_header = auxin_get_post_meta( $post, 'page_header_use_legacy', 'default' ) ) {
3364 $use_legacy_header = auxin_get_option('site_header_use_legacy');
3365 }
3366
3367 if( ! auxin_is_true( $use_legacy_header ) ) {
3368 remove_action( 'auxin_after_inner_body_open', 'auxin_the_top_header_section', 4 );
3369 remove_action( 'auxin_after_inner_body_open', 'auxin_the_main_header_section', 4 );
3370 if ( ! class_exists( '\ElementorPro\Plugin' ) || empty( ElementorPro\Modules\ThemeBuilder\Module::instance()->get_conditions_manager()->get_documents_for_location( 'header' ) ) ) {
3371 add_action( 'auxin_after_inner_body_open', 'auxin_get_header_template', 4 );
3372 }
3373 }
3374 if ( 'default' === $use_legacy_footer = auxin_get_post_meta( $post, 'page_footer_use_legacy', 'default' ) ) {
3375 $use_legacy_footer = auxin_get_option('site_footer_use_legacy');
3376 }
3377
3378 if( ! auxin_is_true( $use_legacy_footer ) ) {
3379 remove_action( 'auxin_before_the_footer', 'auxin_the_site_footer' );
3380 if ( ! class_exists( '\ElementorPro\Plugin' ) || empty( ElementorPro\Modules\ThemeBuilder\Module::instance()->get_conditions_manager()->get_documents_for_location( 'footer' ) ) ) {
3381 add_action( 'auxin_before_the_footer', 'auxin_get_footer_template' );
3382 }
3383 }
3384 }
3385 add_action( 'wp', 'auxin_override_inner_body_sections' );
3386
3387 /**
3388 * Add canvas on elementor single template
3389 *
3390 * @param string $single_template
3391 * @return string
3392 */
3393 function auxin_load_canvas_template( $single_template ) {
3394 global $post;
3395
3396 if ( 'elementor_library' === $post->post_type && defined( 'ELEMENTOR_PATH' ) && defined( 'AUXIN_ELEMENTOR_TEMPLATE' ) ) {
3397 $template_type = get_post_meta( $post->ID, '_elementor_template_type', true );
3398 // Limit the template types
3399 if( ! in_array( $template_type, array( 'header', 'footer' ) ) ){
3400 return $single_template;
3401 }
3402 // Load elementor canvas template
3403 $elementor_2_0_canvas = ELEMENTOR_PATH . '/modules/page-templates/templates/canvas.php';
3404 if ( file_exists( $elementor_2_0_canvas ) ) {
3405 return $elementor_2_0_canvas;
3406 } else {
3407 return ELEMENTOR_PATH . '/includes/page-templates/canvas.php';
3408 }
3409 }
3410
3411 return $single_template;
3412 }
3413 add_filter( 'single_template', 'auxin_load_canvas_template' );
3414
3415
3416 /*-----------------------------------------------------------------------------------*/
3417 /* override the canvas template of elementor plugin
3418 /*-----------------------------------------------------------------------------------*/
3419
3420 function auxin_override_elementor_canvas_template( $template ){
3421
3422 if ( false !== strpos( $template, '/templates/canvas.php' ) ) {
3423 $template = AUXELS_PUB_DIR . '/templates/elementor/canvas.php';
3424 }
3425
3426 return $template;
3427 }
3428 add_filter( 'template_include', 'auxin_override_elementor_canvas_template', 12 );
3429
3430 /* -------------------------------------------------------------------------- */
3431 /* override default wordpress archive link for custom post types */
3432 /* -------------------------------------------------------------------------- */
3433
3434 function auxin_override_post_types_archive_link( $link, $post_type ) {
3435 if ( $post_type == 'portfolio' && auxin_is_true( auxin_get_option('portfolio_show_custom_archive_link') && ! empty( auxin_get_option( 'portfolio_custom_archive_link' ) ) ) ) {
3436 return get_permalink( auxin_get_option( 'portfolio_custom_archive_link' ) );
3437 }
3438
3439 if ( $post_type == 'news' && auxin_is_true( auxin_get_option('news_show_custom_archive_link') && ! empty( auxin_get_option( 'news_custom_archive_link' ) ) ) ) {
3440 return get_permalink( auxin_get_option( 'news_custom_archive_link' ) );
3441 }
3442
3443 return $link;
3444 }
3445 add_filter( 'post_type_archive_link', 'auxin_override_post_types_archive_link', 10, 2 );