PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.7.3
Shortcodes and extra features for Phlox theme v2.7.3
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 5 years ago elementor 5 years ago elements 5 years ago define.php 5 years ago general-functions.php 5 years ago general-hooks.php 5 years ago general-shortcodes.php 9 years ago index.php 5 years ago
general-hooks.php
3650 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 if( isset( $_GET['helper'] ) ){
2144 echo '<style>.elementor-section.elementor-section-boxed>.elementor-container{box-shadow:0 0 0 1px #2b83eb;}</style>';
2145 }
2146 }
2147 add_action( 'wp_head','auxin_ele_add_js_to_head' );
2148
2149
2150 function auxin_ele_add_google_analytics_code() {
2151 if( $google_analytics_code = auxin_get_option( 'auxin_user_google_analytics' ) ){
2152 ?>
2153 <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>
2154 <?php
2155 }
2156 }
2157 add_action( 'wp_head','auxin_ele_add_google_analytics_code' );
2158
2159 /*-----------------------------------------------------------------------------------*/
2160 /* Injects JavaScript codes from theme options in JS file
2161 /*-----------------------------------------------------------------------------------*/
2162
2163 function auxin_ele_add_theme_options_to_js_file( $js ){
2164 $js['theme_options_custom'] = auxin_get_option( 'auxin_user_custom_js' );
2165
2166 $js['theme_options_google_marketing'] = auxin_get_option( 'auxin_user_google_marketing' );
2167
2168 // @deprecated in version 2.5.0
2169 unset( $js['theme_options_google_analytics'] );
2170
2171 return $js;
2172 }
2173 add_filter( 'auxin_custom_js_file_content', 'auxin_ele_add_theme_options_to_js_file' );
2174
2175
2176 /*-----------------------------------------------------------------------------------*/
2177 /* Adds the custom CSS class of the login page to body element
2178 /*-----------------------------------------------------------------------------------*/
2179
2180 function auxin_login_body_class( $classes ){
2181
2182 if( $custom_class = auxin_get_option('auxin_login_body_class' ) ){
2183 $classes['auxin_custom'] = $custom_class;
2184 }
2185
2186 if( $custom_skin = auxin_get_option('auxin_login_skin' ) ){
2187 $classes['auxin_skin'] = esc_attr( 'auxin-login-skin-' . $custom_skin );
2188 }
2189
2190 return $classes;
2191 }
2192 add_action( 'auxin_functions_ready', function(){
2193 add_filter( 'login_body_class', 'auxin_login_body_class' );
2194 });
2195
2196
2197
2198 /*-----------------------------------------------------------------------------------*/
2199 /* Adds proper styles for background and logo on login page
2200 /*-----------------------------------------------------------------------------------*/
2201
2202 function auxin_login_head(){
2203
2204 $styles = '';
2205
2206 if( $bg_image_id = auxin_get_option( 'auxin_login_logo_image' ) ){
2207 $bg_image = wp_get_attachment_url( $bg_image_id );
2208 $styles .= "background-image: url( $bg_image ); ";
2209
2210 $bg_width = auxin_get_option( 'auxin_login_logo_width' , '84' );
2211 $bg_height = auxin_get_option( 'auxin_login_logo_height', '84' );
2212
2213 $bg_width = rtrim( $bg_width , 'px' ) . 'px';
2214 $bg_height = rtrim( $bg_height, 'px' ) . 'px';
2215
2216 $styles .= "background-size: $bg_width $bg_height; ";
2217 $styles .= "width: $bg_width; height: $bg_height; ";
2218
2219 echo "<style>#login h1 a { $styles }</style>";
2220 }
2221
2222 if( auxin_get_option( 'auxin_login_bg_show' ) ){
2223
2224 // get styles for background image
2225 $bg_styles = auxin_generate_styles_for_backgroud_fields( 'auxin_login_bg', 'option', array(
2226 'color' => 'auxin_login_bg_color',
2227 'image' => 'auxin_login_bg_image',
2228 'repeat' => 'auxin_login_bg_repeat',
2229 'size' => 'auxin_login_bg_size',
2230 'position' => 'auxin_login_bg_position',
2231 'attachment' => 'auxin_login_bg_attachment',
2232 'clip' => 'auxin_login_bg_clip'
2233 ) );
2234
2235 $pattern_style = auxin_generate_styles_for_backgroud_fields( 'auxin_login_bg', 'option', array(
2236 'pattern' => 'auxin_login_bg_pattern'
2237 ) );
2238
2239 echo "<style>body.login { $bg_styles } body.login:before { $pattern_style }</style>";
2240 }
2241
2242 }
2243 add_action( 'auxin_functions_ready', function(){
2244 add_action( 'login_head', 'auxin_login_head' );
2245 });
2246
2247
2248 /*-----------------------------------------------------------------------------------*/
2249 /* Changes the login header url to home url
2250 /*-----------------------------------------------------------------------------------*/
2251
2252 function auxin_login_headerurl( $login_header_url ){
2253
2254 if ( ! is_multisite() ) {
2255 $login_header_url = home_url();
2256 }
2257 return $login_header_url;
2258 }
2259 add_action( 'auxin_functions_ready', function(){
2260 add_filter( 'login_headerurl', 'auxin_login_headerurl' );
2261 });
2262
2263 /*-----------------------------------------------------------------------------------*/
2264 /* Changes the login header url to home url
2265 /*-----------------------------------------------------------------------------------*/
2266
2267 function auxin_login_headertext( $login_header_title ){
2268
2269 if ( ! is_multisite() ) {
2270 $login_header_title = get_bloginfo( 'name' );
2271 }
2272 return $login_header_title;
2273 }
2274 add_action( 'auxin_functions_ready', function(){
2275 add_filter( 'login_headertext', 'auxin_login_headertext' );
2276 });
2277
2278 /*-----------------------------------------------------------------------------------*/
2279 /* Adds custom message above the login form
2280 /*-----------------------------------------------------------------------------------*/
2281
2282 function auxin_login_message( $login_message ){
2283
2284 if( $custom_message = auxin_get_option( 'auxin_login_message' ) ){
2285
2286 $message_wrapper_start = '<div class="message">';
2287 $message_wrapper_end = "</div>\n";
2288
2289 $custom_message_markup = $message_wrapper_start . $custom_message . $message_wrapper_end;
2290
2291 /**
2292 * Filter instructional messages displayed above the login form.
2293 *
2294 * @param string $custom_message Login message.
2295 */
2296 $login_message .= apply_filters( 'auxin_login_message', $custom_message_markup, $custom_message, $message_wrapper_start, $message_wrapper_end );
2297 }
2298
2299 return $login_message;
2300 }
2301 add_action( 'auxin_functions_ready', function(){
2302 add_filter( 'login_message', 'auxin_login_message' );
2303 });
2304
2305
2306 /*-----------------------------------------------------------------------------------*/
2307 /* Prints the custom js codes of a single page to the source page
2308 /*-----------------------------------------------------------------------------------*/
2309
2310 function auxin_custom_js_for_pages( $js, $post ){
2311 // The custom JS code for specific page
2312 if( $post && ! is_404() && is_singular() ) {
2313 $js .= get_post_meta( $post->ID, 'aux_page_custom_js', true );
2314 }
2315 return $js;
2316 }
2317 add_filter( 'auxin_footer_inline_script', 'auxin_custom_js_for_pages', 15, 2 );
2318
2319
2320 /*-----------------------------------------------------------------------------------*/
2321 /* Add preconnect for Google Fonts.
2322 /*-----------------------------------------------------------------------------------*/
2323
2324 /**
2325 * Add preconnect for Google Fonts.
2326 *
2327 * @param array $urls URLs to print for resource hints.
2328 * @param string $relation_type The relation type the URLs are printed.
2329 * @return array $urls URLs to print for resource hints.
2330 */
2331 function auxin_resource_hints( $urls, $relation_type ) {
2332 if ( wp_style_is( 'auxin-fonts-google', 'queue' ) && 'preconnect' === $relation_type ) {
2333 $urls[] = array(
2334 'href' => 'https://fonts.gstatic.com',
2335 'crossorigin',
2336 );
2337 }
2338 return $urls;
2339 }
2340 //add_filter( 'wp_resource_hints', 'auxin_resource_hints', 10, 2 );
2341
2342
2343 /*-----------------------------------------------------------------------------------*/
2344 /* Setup Header
2345 /*-----------------------------------------------------------------------------------*/
2346
2347 function auxin_after_setup_theme_extra(){
2348 // gererate shortcodes in widget text
2349 add_filter('widget_text', 'do_shortcode');
2350 // Remove wp ulike auto disaply filter
2351 remove_filter( 'the_content', 'wp_ulike_put_posts', 15 );
2352 }
2353 add_action( 'after_setup_theme', 'auxin_after_setup_theme_extra' );
2354
2355 /*-----------------------------------------------------------------------------------*/
2356 /* add excerpts to pages
2357 /*-----------------------------------------------------------------------------------*/
2358
2359 function auxin_add_excerpts_to_pages() {
2360 add_post_type_support( 'page', 'excerpt' );
2361 }
2362 add_action( 'init', 'auxin_add_excerpts_to_pages' );
2363
2364
2365 /*-----------------------------------------------------------------------------------*/
2366 /* Add some user contact fields
2367 /*-----------------------------------------------------------------------------------*/
2368
2369 function auxin_user_contactmethods($user_contactmethods){
2370 $user_contactmethods['twitter'] = __('Twitter' , 'auxin-elements');
2371 $user_contactmethods['facebook'] = __('Facebook' , 'auxin-elements');
2372 $user_contactmethods['googleplus'] = __('Google Plus', 'auxin-elements');
2373 $user_contactmethods['flickr'] = __('Flickr' , 'auxin-elements');
2374 $user_contactmethods['delicious'] = __('Delicious' , 'auxin-elements');
2375 $user_contactmethods['pinterest'] = __('Pinterest' , 'auxin-elements');
2376 $user_contactmethods['github'] = __('GitHub' , 'auxin-elements');
2377 $user_contactmethods['skills'] = __('Skills' , 'auxin-elements');
2378
2379 return $user_contactmethods;
2380 }
2381 add_filter('user_contactmethods', 'auxin_user_contactmethods');
2382
2383
2384 /*-----------------------------------------------------------------------------------*/
2385 /* Add home page menu arg to menu item list
2386 /*-----------------------------------------------------------------------------------*/
2387
2388 function auxin_add_home_page_to_menu_args( $args ) {
2389 $args['show_home'] = true;
2390 return $args;
2391 }
2392 add_filter( 'wp_page_menu_args', 'auxin_add_home_page_to_menu_args' );
2393
2394 /*-----------------------------------------------------------------------------------*/
2395 /* Print meta tags to preview post while sharing on facebook
2396 /*-----------------------------------------------------------------------------------*/
2397
2398 if( ! defined('WPSEO_VERSION') && ! class_exists('All_in_One_SEO_Pack') ){
2399
2400 function auxin_facebook_header_meta (){
2401
2402 if( ! defined('AUXIN_VERSION') ){
2403 return;
2404 }
2405
2406 // return if built-in seo is disabled or "SEO by yoast" is active
2407 if( ! auxin_get_option( 'enable_theme_seo', 1 ) ) return;
2408
2409 global $post;
2410 if( ! isset( $post ) || ! is_singular() || is_search() || is_404() ) return;
2411 setup_postdata( $post );
2412
2413 $featured_image = auxin_get_the_post_thumbnail_src( $post->ID, 90, 90, true, 90 );
2414 $post_excerpt = get_the_excerpt();
2415 ?>
2416 <meta name="title" content="<?php echo esc_attr( $post->post_title ); ?>" />
2417 <meta name="description" content="<?php echo esc_attr( $post_excerpt ); ?>" />
2418 <?php if( $featured_image) { ?>
2419 <link rel="image_src" href="<?php echo $featured_image; ?>" />
2420 <?php }
2421
2422 }
2423
2424 add_action( 'wp_head', 'auxin_facebook_header_meta' );
2425 }
2426
2427 /*-----------------------------------------------------------------------------------*/
2428 /* Add SiteOrigin class prefix and custom field classes path
2429 /*-----------------------------------------------------------------------------------*/
2430 if ( auxin_is_plugin_active( 'so-widgets-bundle/so-widgets-bundle.php') ) {
2431
2432 function auxels_register_auxin_siteorigin_class_prefix( $class_prefixes ) {
2433 $class_prefixes[] = 'Auxin_SiteOrigin_Field_';
2434 return $class_prefixes;
2435 }
2436
2437 add_filter( 'siteorigin_widgets_field_class_prefixes', 'auxels_register_auxin_siteorigin_class_prefix' );
2438
2439
2440 function auxels_register_custom_fields( $class_paths ) {
2441 $class_paths[] = AUXELS_ADMIN_DIR . '/includes/compatibility/siteorigin/fields/';
2442 return $class_paths;
2443 }
2444
2445 add_filter( 'siteorigin_widgets_field_class_paths', 'auxels_register_custom_fields' );
2446 }
2447
2448
2449 /**
2450 * Replace WooCommerce Default Pagination with auxin pagination
2451 *
2452 */
2453 remove_action( 'woocommerce_pagination' , 'woocommerce_pagination', 10 );
2454 add_action ( 'woocommerce_pagination', 'auxin_woocommerce_pagination' , 10 );
2455
2456 function auxin_woocommerce_pagination() {
2457 auxin_the_paginate_nav(
2458 array( 'css_class' => auxin_get_option('archive_pagination_skin') )
2459 );
2460 }
2461
2462 /*-----------------------------------------------------------------------------------*/
2463 /* the function runs when auxin framework loaded
2464 /*-----------------------------------------------------------------------------------*/
2465
2466 function auxin_on_auxin_fw_admin_loaded(){
2467
2468 // assign theme custom capabilities to roles on first run
2469 if( ! auxin_get_theme_mod( 'are_auxin_caps_assigned', 0 ) ){
2470 add_action( 'admin_init' , 'auxin_assign_default_caps_for_post_types' );
2471 set_theme_mod( 'are_auxin_caps_assigned', 1 );
2472 }
2473
2474 if ( ! auxin_get_theme_mod( 'initial_date', 0 ) ) {
2475 set_theme_mod( 'initial_date', current_time( 'mysql' ) );
2476 }
2477
2478 $slug = THEME_PRO ? 'pro' : 'free';
2479 if ( ! auxin_get_theme_mod( 'initial_version_' . $slug, 0 ) ) {
2480 set_theme_mod( 'initial_version_' . $slug, THEME_VERSION );
2481 }
2482
2483 if ( ! auxin_get_theme_mod( 'initial_date_' . $slug, 0 ) ) {
2484 set_theme_mod( 'initial_date_' . $slug, current_time( 'mysql' ) );
2485 }
2486
2487 if ( ! auxin_get_theme_mod( 'client_key', 0 ) ) {
2488 $client_key = base64_encode( get_site_url() ) . rand( 100000, 1000000 );
2489 set_theme_mod( 'client_key', str_shuffle( $client_key ) );
2490 }
2491 }
2492
2493 add_action( 'auxin_admin_loaded', 'auxin_on_auxin_fw_admin_loaded' );
2494
2495
2496 /*-------------------------------------------------------------------------------*/
2497 /* assigns theme custom post types capabilities to main roles
2498 /*-------------------------------------------------------------------------------*/
2499
2500 function auxin_assign_default_caps_for_post_types() {
2501 $auxin_registered_post_types = auxin_registered_post_types(true);
2502
2503 // the roles to add capabilities of custom post types to
2504 $roles = array('administrator', 'editor');
2505
2506 foreach ( $roles as $role_name ) {
2507
2508 $role = get_role( $role_name );
2509
2510 // loop through custom post types and add custom capabilities to defined rules
2511 foreach ( $auxin_registered_post_types as $post_type ) {
2512
2513 $post_type_object = get_post_type_object( $post_type );
2514 // add post type capabilities to role
2515 foreach ( $post_type_object->cap as $cap_key => $cap ) {
2516 if( ! in_array( $cap_key, array( 'edit_post', 'delete_post', 'read_post' ) ) )
2517 $role->add_cap( $cap );
2518 }
2519 }
2520
2521 }
2522 }
2523
2524
2525
2526
2527
2528 function auxels_add_post_type_metafields(){
2529
2530 $all_post_types = auxin_get_possible_post_types(true);
2531
2532 $auxin_is_admin = is_admin();
2533
2534 foreach ( $all_post_types as $post_type => $is_post_type_allowed ) {
2535
2536 if( ! $is_post_type_allowed ){
2537 continue;
2538 }
2539
2540 // define metabox args
2541 $metabox_args = array( 'post_type' => $post_type );
2542
2543 switch( $post_type ) {
2544
2545 case 'page':
2546
2547 $metabox_args['hub_id'] = 'axi_meta_hub_page';
2548 $metabox_args['hub_title'] = __('Page Options', 'auxin-elements');
2549 $metabox_args['to_post_types'] = array( $post_type );
2550
2551 break;
2552
2553 case 'post':
2554
2555 $metabox_args['hub_id'] = 'axi_meta_hub_post';
2556 $metabox_args['hub_title'] = __('Post Options', 'auxin-elements');
2557 $metabox_args['to_post_types'] = array( $post_type );
2558
2559 default:
2560 break;
2561 }
2562
2563 // Load metabox fields on admin
2564 if( $auxin_is_admin ){
2565 auxin_maybe_render_metabox_hub_for_post_type( $metabox_args );
2566 }
2567
2568 }
2569
2570 }
2571
2572 //add_action( 'init', 'auxels_add_post_type_metafields' );
2573
2574 /*-----------------------------------------------------------------------------------*/
2575 /* Add custom blog page tamplate
2576 /*-----------------------------------------------------------------------------------*/
2577
2578 /**
2579 * Add custom page templates
2580 *
2581 * @param string $result The current custom blog page template markup
2582 * @param string $page_template The name of page template
2583 *
2584 * @return string The markup for current page template
2585 */
2586 function auxels_blog_page_templates( $result, $page_template ){
2587
2588 // page number
2589 $paged = max( 1, get_query_var('paged'), get_query_var('page') );
2590
2591 // posts perpage
2592 $per_page = get_option( 'posts_per_page' );
2593
2594 // if template type is masonry
2595 if( strpos( $page_template, 'blog-type-6' ) ){
2596
2597 $args = array(
2598 'title' => '',
2599 'num' => $per_page,
2600 'paged' => $paged,
2601 'order_by' => 'menu_order date',
2602 'order' => 'desc',
2603 'show_media' => true,
2604 'exclude_without_media' => 0,
2605 'exclude_custom_post_formats' => 0,
2606 'exclude_quote_link' => esc_attr( auxin_get_option( 'post_exclude_quote_link_formats', 0 ) ),
2607 'loadmore_type' => esc_attr( auxin_get_option( 'post_index_loadmore_type', '' ) ),
2608 'show_title' => true,
2609 'show_info' => true,
2610 'show_readmore' => true,
2611 'show_author_footer' => false,
2612 'tag' => '',
2613 'reset_query' => true
2614 );
2615
2616 // get the shortcode base blog page
2617 $result = auxin_widget_recent_posts_masonry_callback( $args );
2618 }
2619
2620 // if template type is tiles
2621 elseif( strpos( $page_template, 'blog-type-9' ) ){
2622
2623 $args = array(
2624 'title' => '',
2625 'num' => $per_page,
2626 'paged' => $paged,
2627 'order_by' => 'menu_order date',
2628 'order' => 'desc',
2629 'show_media' => true,
2630 'exclude_without_media' => 0,
2631 'exclude_custom_post_formats' => 0,
2632 'exclude_quote_link' => esc_attr( auxin_get_option( 'post_exclude_quote_link_formats', 0 ) ),
2633 'loadmore_type' => esc_attr( auxin_get_option( 'post_index_loadmore_type', '' ) ),
2634 'show_title' => true,
2635 'show_info' => true,
2636 'show_readmore' => true,
2637 'show_author_footer' => false,
2638 'tag' => '',
2639 'reset_query' => true
2640 );
2641
2642 // get the shortcode base blog page
2643 $result = auxin_widget_recent_posts_tiles_callback( $args );
2644 }
2645
2646 // if template type is land
2647 elseif( strpos( $page_template, 'blog-type-8' ) ){
2648
2649 $args = array(
2650 'title' => '',
2651 'num' => $per_page,
2652 'paged' => $paged,
2653 'order_by' => 'menu_order date',
2654 'order' => 'desc',
2655 'show_media' => true,
2656 'exclude_without_media' => 0,
2657 'exclude_custom_post_formats' => 0,
2658 'exclude_quote_link' => esc_attr( auxin_get_option( 'post_exclude_quote_link_formats', 0 ) ),
2659 'loadmore_type' => esc_attr( auxin_get_option( 'post_index_loadmore_type', '' ) ),
2660 'show_excerpt' => true,
2661 'excerpt_len' => '160',
2662 'show_title' => true,
2663 'show_info' => true,
2664 'show_readmore' => true,
2665 'show_author_footer' => false,
2666 'tag' => '',
2667 'reset_query' => true
2668 );
2669
2670 // get the shortcode base blog page
2671 $result = auxin_widget_recent_posts_land_style_callback( $args );
2672 }
2673
2674 // if template type is timeline
2675 elseif( strpos( $page_template, 'blog-type-7' ) ){
2676
2677 $args = array(
2678 'title' => '',
2679 'num' => $per_page,
2680 'paged' => $paged,
2681 'order_by' => 'menu_order date',
2682 'order' => 'desc',
2683 'exclude_quote_link' => esc_attr( auxin_get_option( 'post_exclude_quote_link_formats', 1 ) ),
2684 'loadmore_type' => esc_attr( auxin_get_option( 'post_index_loadmore_type', '' ) ),
2685 'show_media' => true,
2686 'show_excerpt' => true,
2687 'excerpt_len' => '160',
2688 'show_title' => true,
2689 'show_info' => true,
2690 'show_readmore' => true,
2691 'show_author_footer' => false,
2692 'timeline_alignment' => 'center',
2693 'tag' => '',
2694 'reset_query' => true
2695 );
2696
2697 // get the shortcode base blog page
2698 $result = auxin_widget_recent_posts_timeline_callback( $args );
2699 }
2700
2701 // if template type is grid
2702 elseif( strpos( $page_template, 'blog-type-5' ) ){
2703
2704 $args = array(
2705 'title' => '',
2706 'num' => $per_page,
2707 'order_by' => 'menu_order date',
2708 'order' => 'desc',
2709 'exclude_quote_link' => esc_attr( auxin_get_option( 'post_exclude_quote_link_formats', 1 ) ),
2710 'paged' => $paged,
2711 'show_media' => true,
2712 'display_like' => esc_attr( auxin_get_option( 'show_blog_archive_like_button', 1 ) ),
2713 'loadmore_type' => esc_attr( auxin_get_option( 'post_index_loadmore_type', '' ) ),
2714 'show_excerpt' => true,
2715 'excerpt_len' => '160',
2716 'show_title' => true,
2717 'show_info' => true,
2718 'show_readmore' => true,
2719 'show_author_footer' => false,
2720 'desktop_cnum' => esc_attr( auxin_get_option( 'post_index_column_number', 4 ) ),
2721 'tablet_cnum' => esc_attr( auxin_get_option( 'post_index_column_number_tablet', 2 ) ),
2722 'phone_cnum' => esc_attr( auxin_get_option( 'post_index_column_number_mobile', 1 ) ),
2723 'preview_mode' => 'grid',
2724 'tag' => '',
2725 'reset_query' => true
2726 );
2727
2728 // get the shortcode base blog page
2729 $result = auxin_widget_recent_posts_callback( $args );
2730 }
2731
2732 return $result;
2733 }
2734
2735 add_filter( 'auxin_blog_page_template_archive_content', 'auxels_blog_page_templates', 10, 2 );
2736
2737
2738 /*-----------------------------------------------------------------------------------*/
2739 /* Add custom blog archive tamplate types
2740 /*-----------------------------------------------------------------------------------*/
2741
2742 /**
2743 * Add custom page templates
2744 *
2745 * @param string $result The current custom blog loop template markup
2746 * @param string $page_template The ID of template type option
2747 *
2748 * @return string The markup for current blog archive page
2749 */
2750 function auxels_add_blog_archive_custom_template_layouts( $result, $template_type_id ){
2751
2752 // get template type id
2753 $post_loadmore_type = auxin_get_option( 'post_index_loadmore_type', '' );
2754 // get the length of content
2755 $excerpt_len = esc_attr( auxin_get_option( 'blog_content_on_listing_length' ) );
2756
2757 // default value for showing info
2758 $show_post_info = $show_post_date = $show_post_author = $show_post_categories = true;
2759
2760 $author_or_readmore = 'readmore';
2761 $show_post_date = true;
2762 $show_post_categories = true;
2763 $blog_content_on_listing = 'excerpt';
2764 $display_comments = true;
2765 $display_author_header = true;
2766 $display_author_footer = false;
2767
2768 // Use taxonomy template option if is category or tag archive page
2769
2770 if( is_category() || is_tag() ){
2771 $author_or_readmore = auxin_get_option( 'display_post_taxonomy_author_readmore', 'readmore');
2772 $post_loadmore_type = auxin_get_option( 'post_taxonomy_loadmore_type', '' );
2773 $excerpt_len = auxin_get_option( 'post_taxonomy_archive_on_listing_length', '' );
2774 $show_post_info = auxin_get_option( 'display_post_taxonomy_info', true );
2775 $show_post_date = auxin_get_option( 'display_post_taxonomy_info_date', true );
2776 $show_post_categories = auxin_get_option( 'display_post_taxonomy_info_categories', true );
2777 $blog_content_on_listing = auxin_get_option( 'post_taxonomy_archive_content_on_listing', 'excerpt' );
2778 $display_comments = auxin_get_option( 'display_post_taxonomy_widget_comments', true);
2779 $display_author_header = auxin_get_option( 'display_post_taxonomy_author_header', true);
2780 $display_author_footer = auxin_get_option( 'display_post_taxonomy_author_footer', false);
2781
2782 } elseif ( auxin_is_blog() ) {
2783 $author_or_readmore = auxin_get_option( 'blog_display_author_readmore', 'readmore');
2784 $display_author_header = auxin_get_option( 'blog_display_author_header', true);
2785 $display_author_footer = auxin_get_option( 'blog_display_author_footer', false);
2786 $show_post_info = auxin_get_option( 'display_post_info', true );
2787 $show_post_date = auxin_get_option( 'display_post_info_date', true );
2788 $show_post_categories = auxin_get_option( 'display_post_info_categories', true );
2789 $blog_content_on_listing = auxin_get_option( 'blog_content_on_listing', 'excerpt' );
2790 $excerpt_len = auxin_get_option( 'blog_content_on_listing_length', '' );
2791 $display_comments = auxin_get_option( 'display_post_comments_number', true);
2792 } else {
2793 $blog_content_on_listing = 'excerpt';
2794 }
2795
2796 $show_post_author = $show_post_author ? 'author' : 'readmore';
2797 $show_excerpt = 'none' === $blog_content_on_listing ? false : true ;
2798 $excerpt_len = 'full' === $blog_content_on_listing ? null : $excerpt_len ;
2799
2800 // page number
2801 $paged = max( 1, get_query_var('paged'), get_query_var('page') );
2802 // posts perpage
2803 $per_page = get_option( 'posts_per_page' );
2804
2805 if( 6 == $template_type_id ){
2806 $args = array(
2807 'num' => $per_page,
2808 'exclude_without_media' => esc_attr( auxin_get_option( 'exclude_without_media' ) ),
2809 'exclude_custom_post_formats' => 0,
2810 'exclude_quote_link' => esc_attr( auxin_get_option( 'post_exclude_quote_link_formats', 1 ) ),
2811 'display_like' => esc_attr( auxin_get_option( 'show_blog_archive_like_button', 1 ) ),
2812 'display_comments' => $display_comments,
2813 'display_author_footer' => $display_author_footer,
2814 'display_author_header' => $display_author_header,
2815 'loadmore_type' => esc_attr( $post_loadmore_type ),
2816 'paged' => $paged,
2817 'show_media' => true,
2818 'show_excerpt' => $show_excerpt,
2819 'excerpt_len' => $excerpt_len,
2820 'show_info' => esc_attr( $show_post_info ),
2821 'show_date' => esc_attr( $show_post_date ),
2822 'display_categories' => esc_attr( $show_post_categories ),
2823 'author_or_readmore' => $author_or_readmore,
2824 'content_layout' => esc_attr( auxin_get_option( 'post_index_column_content_layout', 'full' ) ),
2825 'desktop_cnum' => esc_attr( auxin_get_option( 'post_index_column_number' ) ),
2826 'tablet_cnum' => esc_attr( auxin_get_option( 'post_index_column_number_tablet' ) ),
2827 'phone_cnum' => esc_attr( auxin_get_option( 'post_index_column_number_mobile' ) ),
2828 'tag' => '',
2829 'extra_classes' => '',
2830 'custom_el_id' => '',
2831 'reset_query' => false,
2832 'use_wp_query' => true,
2833 'request_from' => 'archive'
2834 );
2835
2836 $result = auxin_widget_recent_posts_masonry_callback( $args );
2837
2838 // if template type is tiles
2839 } elseif( 9 == $template_type_id ){
2840
2841 $args = array(
2842 'num' => $per_page,
2843 'exclude_without_media' => esc_attr( auxin_get_option( 'exclude_without_media' ) ),
2844 'exclude_custom_post_formats' => 0,
2845 'exclude_quote_link' => esc_attr( auxin_get_option( 'post_exclude_quote_link_formats', 1 ) ),
2846 'loadmore_type' => esc_attr( $post_loadmore_type ),
2847 'paged' => $paged,
2848 'show_media' => true,
2849 'show_excerpt' => $show_excerpt,
2850 'excerpt_len' => $excerpt_len,
2851 'display_title' => true,
2852 'display_comments' => $display_comments,
2853 'show_info' => esc_attr( $show_post_info ),
2854 'show_date' => esc_attr( $show_post_date ),
2855 'display_categories' => esc_attr( $show_post_categories ),
2856 'author_or_readmore' => $author_or_readmore,
2857 'display_author_footer' => $display_author_footer,
2858 'display_author_header' => $display_author_header,
2859 'tag' => '',
2860 'extra_classes' => '',
2861 'custom_el_id' => '',
2862 'reset_query' => false,
2863 'use_wp_query' => true,
2864 'request_from' => 'archive'
2865 );
2866
2867 $result = auxin_widget_recent_posts_tiles_callback( $args );
2868
2869 // if template type is land
2870 } elseif( 8 == $template_type_id ){
2871
2872 $args = array(
2873 'num' => $per_page,
2874 'exclude_without_media' => esc_attr( auxin_get_option( 'exclude_without_media' ) ),
2875 'exclude_custom_post_formats' => 0,
2876 'exclude_quote_link' => esc_attr( auxin_get_option( 'post_exclude_quote_link_formats', 1 ) ),
2877 'show_media' => true,
2878 'paged' => $paged,
2879 'display_like' => esc_attr( auxin_get_option( 'show_blog_archive_like_button', 1 ) ),
2880 'display_comments' => $display_comments,
2881 'loadmore_type' => esc_attr( $post_loadmore_type ),
2882 'show_excerpt' => $show_excerpt,
2883 'excerpt_len' => $excerpt_len,
2884 'display_title' => true,
2885 'show_info' => esc_attr( $show_post_info ),
2886 'show_date' => esc_attr( $show_post_date ),
2887 'display_categories' => esc_attr( $show_post_categories ),
2888 'author_or_readmore' => $author_or_readmore,
2889 'display_author_footer' => $display_author_footer,
2890 'display_author_header' => $display_author_header,
2891 'image_aspect_ratio' => esc_attr( auxin_get_option( 'post_image_aspect_ratio' ) ),
2892 'tag' => '',
2893 'extra_classes' => '',
2894 'custom_el_id' => '',
2895 'reset_query' => false,
2896 'use_wp_query' => true,
2897 'request_from' => 'archive'
2898 );
2899
2900 $result = auxin_widget_recent_posts_land_style_callback( $args );
2901
2902 // if template type is timeline
2903 } elseif( 7 == $template_type_id ){
2904
2905 $args = array(
2906 'num' => $per_page,
2907 'exclude_without_media' => esc_attr( auxin_get_option( 'exclude_without_media' ) ),
2908 'exclude_custom_post_formats' => 0,
2909 'exclude_quote_link' => esc_attr( auxin_get_option( 'post_exclude_quote_link_formats', 1 ) ),
2910 'show_media' => true,
2911 'paged' => $paged,
2912 'display_like' => esc_attr( auxin_get_option( 'show_blog_archive_like_button', 1 ) ),
2913 'display_comments' => $display_comments,
2914 'loadmore_type' => esc_attr( $post_loadmore_type ),
2915 'show_excerpt' => $show_excerpt,
2916 'excerpt_len' => $excerpt_len,
2917 'display_title' => true,
2918 'show_info' => esc_attr( $show_post_info ),
2919 'show_date' => esc_attr( $show_post_date ),
2920 'display_categories' => esc_attr( $show_post_categories ),
2921 'author_or_readmore' => $author_or_readmore,
2922 'display_author_footer' => $display_author_footer,
2923 'display_author_header' => $display_author_header,
2924 'image_aspect_ratio' => esc_attr( auxin_get_option( 'post_image_aspect_ratio' ) ),
2925 'timeline_alignment' => esc_attr( auxin_get_option( 'post_index_timeline_alignment', 'center' ) ),
2926 'tag' => '',
2927 'reset_query' => false,
2928 'use_wp_query' => true,
2929 'request_from' => 'archive'
2930 );
2931
2932 $result = auxin_widget_recent_posts_timeline_callback( $args );
2933
2934 // if template type is grid
2935 } elseif( 5 == $template_type_id ){
2936
2937 $args = array(
2938 'num' => $per_page,
2939 'exclude_without_media' => esc_attr( auxin_get_option( 'exclude_without_media' ) ),
2940 'exclude_custom_post_formats' => 0,
2941 'exclude_quote_link' => esc_attr( auxin_get_option( 'post_exclude_quote_link_formats', 1 ) ),
2942 'show_media' => true,
2943 'show_excerpt' => $show_excerpt,
2944 'paged' => $paged,
2945 'post_info_position' => esc_attr( auxin_get_option( 'post_info_position', 'after-title' ) ),
2946 'show_info' => esc_attr( $show_post_info ),
2947 'show_date' => esc_attr( $show_post_date ),
2948 'display_categories' => esc_attr( $show_post_categories ),
2949 'display_like' => esc_attr( auxin_get_option( 'show_blog_archive_like_button', 1 ) ),
2950 'display_comments' => $display_comments,
2951 'loadmore_type' => esc_attr( $post_loadmore_type ),
2952 'content_layout' => esc_attr( auxin_get_option( 'post_index_column_content_layout', 'full' ) ),
2953 'excerpt_len' => $excerpt_len,
2954 'display_title' => true,
2955 'author_or_readmore' => $author_or_readmore,
2956 'display_author_footer' => $display_author_footer,
2957 'display_author_header' => $display_author_header,
2958 'image_aspect_ratio' => esc_attr( auxin_get_option( 'post_image_aspect_ratio' ) ),
2959 'desktop_cnum' => esc_attr( auxin_get_option( 'post_index_column_number' ) ),
2960 'tablet_cnum' => esc_attr( auxin_get_option( 'post_index_column_number_tablet' ) ),
2961 'phone_cnum' => esc_attr( auxin_get_option( 'post_index_column_number_mobile' ) ),
2962 'preview_mode' => 'grid',
2963 'tag' => '',
2964 'reset_query' => false,
2965 'use_wp_query' => true,
2966 'request_from' => 'archive'
2967 );
2968
2969 $result = auxin_widget_recent_posts_callback( $args );
2970 }
2971
2972 return $result;
2973 }
2974
2975 add_filter( 'auxin_blog_archive_custom_template_layouts', 'auxels_add_blog_archive_custom_template_layouts', 10, 2 );
2976
2977
2978 /*-----------------------------------------------------------------------------------*/
2979 /* Add Boxed layout to siteorigin row layout types
2980 /*-----------------------------------------------------------------------------------*/
2981
2982 function auxin_so_row_style_attributes( $attributes, $style ){
2983
2984 if ( ! empty( $style['row_stretch'] ) && 'boxed' === $style['row_stretch'] ) {
2985 if( ( $key = array_search( 'siteorigin-panels-stretch', $attributes['class'] ) ) !== false ) {
2986 unset( $attributes['class'][ $key ] );
2987 }
2988 $attributes['class'][] = 'aux-fold';
2989 }
2990
2991 return $attributes;
2992 }
2993 add_filter( 'siteorigin_panels_row_style_attributes', 'auxin_so_row_style_attributes', 12, 2 );
2994
2995 /*-----------------------------------------------------------------------------------*/
2996 /* Add Boxed layout to siteorigin row layout types
2997 /*-----------------------------------------------------------------------------------*/
2998
2999 function auxin_so_row_style_fields( $fields ){
3000 $fields['row_stretch']['options']['boxed'] = __( 'Boxed', 'auxin-elements' );
3001
3002 return $fields;
3003 }
3004 add_filter( 'siteorigin_panels_row_style_fields', 'auxin_so_row_style_fields', 15 );
3005
3006 /*-----------------------------------------------------------------------------------*/
3007 /* Filtering wp_title to improve seo and letting seo plugins to filter the output too
3008 /*-----------------------------------------------------------------------------------*/
3009
3010 if( ! defined( 'WPSEO_VERSION') ){
3011
3012 function auxin_wp_title($title, $sep, $seplocation) {
3013 global $page, $paged, $post;
3014
3015 // Don't affect feeds
3016 if ( is_feed() ) return $title;
3017
3018 // Add the blog name
3019 if ( 'right' == $seplocation )
3020 $title .= get_bloginfo( 'name' );
3021 else
3022 $title = get_bloginfo( 'name' ) . $title;
3023
3024 // Add the blog description for the home/front page
3025 $site_description = get_bloginfo( 'description', 'display' );
3026 if ( $site_description && ( is_home() || is_front_page() ) )
3027 $title .= " $sep $site_description";
3028
3029 // Add a page number if necessary
3030 if ( $paged >= 2 || $page >= 2 )
3031 $title .= " $sep " . sprintf( __( 'Page %s', 'auxin-elements'), max( $paged, $page ) );
3032
3033 return $title;
3034 }
3035
3036 add_filter( 'wp_title', 'auxin_wp_title', 10, 3 );
3037 }
3038
3039 /*-----------------------------------------------------------------------------------*/
3040 /* Add new functionality in wp default playlist
3041 /*-----------------------------------------------------------------------------------*/
3042
3043 function auxin_underscore_playlist_templates(){
3044 ?>
3045 <script type="text/html" id="tmpl-wp-playlist-current-item">
3046 <# if ( data.image ) { #>
3047 <img src="{{ data.thumb.src }}" alt="" />
3048 <# } #>
3049 <div class="wp-playlist-caption">
3050 <span class="wp-playlist-item-meta wp-playlist-item-title"><?php
3051 /* translators: playlist item title */
3052 printf( _x( '&#8220;%s&#8221;', 'playlist item title' ), '{{ data.title }}' );
3053 ?></span>
3054 <# if ( data.meta.album ) { #><span class="wp-playlist-item-meta wp-playlist-item-album">{{ data.meta.album }}</span><# } #>
3055 <# if ( data.meta.artist ) { #><span class="wp-playlist-item-meta wp-playlist-item-artist">{{ data.meta.artist }}</span><# } #>
3056 </div>
3057 </script>
3058 <script type="text/html" id="tmpl-wp-playlist-item">
3059 <div class="wp-playlist-item">
3060 <#
3061 var isThumbnailExist = data.thumb.src.indexOf("wp-includes/images/media") > 0 ? 'aux-has-no-thubmnail' : '';
3062 #>
3063 <a class="wp-playlist-caption {{ isThumbnailExist }}" href="{{ data.src }}">
3064 <# if ( data.image ) { #>
3065 <img class="wp-playlist-item-artist" src="{{ data.thumb.src }}" alt="{{ data.title }}" />
3066 <# } #>
3067 <# if ( data.meta.length_formatted ) { #>
3068 <span class="wp-playlist-item-length">{{ data.meta.length_formatted }}</span>
3069 <# } #>
3070 </a>
3071 <div class="wp-playlist-item-title" >
3072 <a href="{{ data.src }}">
3073 <h4>
3074 <# if ( data.caption ) { #>
3075 <?php
3076 /* translators: playlist item title */
3077 printf( _x( '%s', 'playlist item title' ), '{{{ data.caption }}}' );
3078 ?>
3079 <# } else { #>
3080 <?php
3081 /* translators: playlist item title */
3082 printf( _x( '%s', 'playlist item title' ), '{{{ data.title }}}' );
3083 ?>
3084 <# } #>
3085 </h4>
3086 </a>
3087 </div>
3088 </div>
3089 </script>
3090 <?php
3091 }
3092
3093 function auxin_modify_wp_playlist_scripts(){
3094 remove_action ( 'wp_footer' , 'wp_underscore_playlist_templates' , 0 );
3095 remove_action ( 'admin_footer' , 'wp_underscore_playlist_templates' , 0 );
3096 add_action ( 'wp_footer' , 'auxin_underscore_playlist_templates' , 0 );
3097 add_action ( 'admin_footer' , 'auxin_underscore_playlist_templates' , 0 );
3098 }
3099 add_action( 'wp_playlist_scripts', 'auxin_modify_wp_playlist_scripts', 15 );
3100
3101 /*-----------------------------------------------------------------------------------*/
3102 /* Redirects a 404 page to the custom one if available
3103 /*-----------------------------------------------------------------------------------*/
3104
3105 function auxin_redirect_custom_404_page() {
3106
3107 if( 'default' !== $custom_404_page = auxin_get_option( 'auxin_404_page', 'default ') ) {
3108 if( is_404() ){
3109 wp_redirect( get_permalink( $custom_404_page ) );
3110 exit();
3111 }
3112 global $post;
3113
3114 if( ! empty( $post->ID ) && $post->ID == $custom_404_page ){
3115 status_header(404);
3116 nocache_headers();
3117 }
3118 }
3119
3120 }
3121 add_action( 'template_redirect', 'auxin_redirect_custom_404_page' );
3122
3123 /*-----------------------------------------------------------------------------------*/
3124
3125 /**
3126 * Loads a PHP file which includes special functionalities for a custom site
3127 * @return void
3128 */
3129 function load_special_demo_functionality(){
3130 if( auxin_get_option( 'special_php_file_enabled', 0 ) ){
3131 $file_path = THEME_CUSTOM_DIR .'/'. auxin_get_option('special_php_file_name', 'functions') .'.php';
3132 if( file_exists( $file_path ) ){
3133 include_once $file_path;
3134 }
3135 }
3136 }
3137 add_action( 'auxin_loaded', 'load_special_demo_functionality' );
3138
3139
3140 /**
3141 * Automatically clear autoptimizeCache if it goes beyond 256MB
3142 *
3143 * @return void
3144 */
3145 function auxin_maybe_flush_autoptimize_big_cache(){
3146 // Check transient
3147 if ( false === auxin_get_transient( 'auxin_maybe_flush_autoptimize_cache' ) ) {
3148
3149 if ( class_exists('autoptimizeCache') ) {
3150 $theMaxSize = 256000;
3151 $statArr = autoptimizeCache::stats();
3152 $cacheSize = round($statArr[1]/1024);
3153
3154 if ( $cacheSize > $theMaxSize ){
3155 autoptimizeCache::clearall();
3156 # Refresh the page so that autoptimize can create new cache files and it does breaks the page after clearall.
3157 header("Refresh:0");
3158 }
3159 }
3160 auxin_set_transient( 'auxin_maybe_flush_autoptimize_cache', 2 * DAY_IN_SECONDS );
3161 }
3162
3163 }
3164
3165 add_action( 'auxin_loaded', 'auxin_maybe_flush_autoptimize_big_cache' );
3166
3167 /*-----------------------------------------------------------------------------------*/
3168
3169 /**
3170 * Replace the primary logo on the page if custom logo was specified
3171 *
3172 * @param int $logo_id The current primary logo ID
3173 * @param array $args The primary logo args
3174 * @return int The primary logo ID
3175 */
3176 function auxin_page_custom_primary_logo_id( $logo_id ){
3177 global $post;
3178
3179 if( empty( $post->ID ) ){
3180 return $logo_id;
3181 }
3182
3183 // Check if the custom logo for page is enabled
3184 if( ! auxin_is_true( auxin_get_post_meta( $post, 'aux_use_custom_logo', 0 ) ) ){
3185 return $logo_id;
3186 }
3187
3188 if( ( $custom_logo_id = auxin_get_post_meta( $post, 'aux_custom_logo' ) ) && is_numeric( $custom_logo_id ) ){
3189 return $custom_logo_id;
3190 }
3191
3192 return $logo_id;
3193 }
3194
3195 add_filter( 'theme_mod_custom_logo', 'auxin_page_custom_primary_logo_id' );
3196
3197
3198 /**
3199 * Replace the custom logo on the page if custom logo was specified
3200 *
3201 * @param int $logo_id The current secondary logo ID
3202 * @param array $args The secondary logo args
3203 * @return int The secondary logo ID
3204 */
3205 function auxin_page_custom_secondary_logo_id( $logo_id, $args ){
3206 global $post;
3207
3208 if( empty( $post->ID ) ){
3209 return $logo_id;
3210 }
3211
3212 // Check if the custom logo for page is enabled
3213 if( ! auxin_is_true( auxin_get_post_meta( $post, 'aux_use_custom_logo', 0 ) ) ){
3214 return $logo_id;
3215 }
3216
3217 if( $custom_logo_id = auxin_get_post_meta( $post, 'aux_custom_logo2' ) ){
3218 return $custom_logo_id;
3219 }
3220
3221 return $logo_id;
3222 }
3223
3224 add_filter( 'auxin_secondary_logo_id', 'auxin_page_custom_secondary_logo_id', 10, 2 );
3225
3226 /*-----------------------------------------------------------------------------------*/
3227
3228 /*-----------------------------------------------------------------------------------*/
3229 /* Function For Checking is website on maintenance mode
3230 /*-----------------------------------------------------------------------------------*/
3231
3232 function auxin_is_maintenance() {
3233 if ( ( function_exists('auxin_get_option') && auxin_get_option('auxin_maintenance_enable', '0') ) || file_exists( ABSPATH . '.maintenance' ) ){
3234 return true;
3235 } else {
3236 return false;
3237 }
3238
3239 }
3240 add_action( 'get_header', 'auxin_is_maintenance' );
3241
3242 /*-----------------------------------------------------------------------------------*/
3243 /* Fixing a fatal error while saving the content with page builder enabled
3244 /*-----------------------------------------------------------------------------------*/
3245
3246 function auxin_load_template_function_for_page_builders(){
3247 if( is_admin() ){
3248 locate_template( AUXIN_INC . 'include/templates/templates-header.php', true, true );
3249 locate_template( AUXIN_INC . 'include/templates/templates-post.php' , true, true );
3250 locate_template( AUXIN_INC . 'include/templates/templates-footer.php', true, true );
3251 }
3252 }
3253 add_action('save_post', 'auxin_load_template_function_for_page_builders', 7, 1);
3254 add_action('wp_ajax_wpseo_filter_shortcodes', 'auxin_load_template_function_for_page_builders', 7, 1);
3255
3256 /*-----------------------------------------------------------------------------------*/
3257 /* Function For Let the user To use custom page for Maintenance and Comingsoon
3258 /*-----------------------------------------------------------------------------------*/
3259 //
3260 function auxin_custom_maintenance_page() {
3261
3262 if( auxin_is_maintenance() && !current_user_can('manage_options') ){
3263
3264 $page = auxin_get_option( 'auxin_maintenance_page', 'default');
3265 $url = get_permalink( $page );
3266 $url_protocols = array( 'http://', 'https://' );
3267 $url_str = str_replace( $url_protocols, '', $url );
3268 $current_url = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
3269
3270 /* Tell search engines that the site is temporarily unavailable */
3271 $protocol = $_SERVER['SERVER_PROTOCOL'];
3272
3273 if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol ) {
3274 $protocol = 'HTTP/1.0';
3275 }
3276
3277 header( "$protocol 503 Service Unavailable", true, 503 );
3278 header( 'Content-Type: text/html; charset=utf-8' );
3279
3280 if ( 'default' !== $page && ( $current_url !== $url_str ) ){
3281 header( "Location: " .$url );
3282 exit();
3283 } else if ( 'default' === $page ) {
3284 include auxin_get_template_file( 'maintenance' , '', AUXELS()->template_path() );
3285 }
3286 }
3287
3288 }
3289
3290 add_action( 'wp', 'auxin_custom_maintenance_page');
3291
3292 /*-----------------------------------------------------------------------------------*/
3293
3294
3295 /**
3296 * Add Subfooter and Subfooter bar to Wocommerce templates
3297 */
3298
3299 function auxin_display_shop_footer_sidebar() {
3300 get_sidebar('footer');
3301 }
3302
3303 add_action( 'woocommerce_sidebar', 'auxin_display_shop_footer_sidebar', 10 );
3304
3305
3306
3307 /*-----------------------------------------------------------------------------------*/
3308 /* Star Rating Markup for WooCommerce
3309 /*-----------------------------------------------------------------------------------*/
3310
3311 function auxin_get_star_rating_html( $rating_html, $rating ){
3312
3313 if ( $rating > 0 ) {
3314
3315 // Round Rating value to neareset value 1.5 => 1.5 , 1.8 => 2 , 1.1 => 1
3316 $decimal_value = $rating - floor($rating) ;
3317
3318 if ( 0.5 != $decimal_value ) {
3319 $rating = round( ( $rating * 2 ) / 2 ) ;
3320 }
3321
3322 $rating_html = '<div class="aux-rating-box aux-star-rating">';
3323 $rating_html .= '<span class="aux-star-rating-avg" style="width: ' . ( $rating / 5 ) * 100 .'%">';
3324 $rating_html .= '</span>';
3325 $rating_html .= '</div>';
3326 } else {
3327 $rating_html = '';
3328 }
3329
3330 return $rating_html;
3331 }
3332
3333 add_filter( 'woocommerce_product_get_rating_html', 'auxin_get_star_rating_html', 10, 2 );
3334
3335 /*-----------------------------------------------------------------------------------*/
3336 /* Enable ajax add to cart on free version
3337 /*-----------------------------------------------------------------------------------*/
3338 function auxels_enable_woocommerce_ajax_add_to_cart( $args ){
3339 global $product;
3340 $args['class'] = implode( ' ', array_filter( array(
3341 'button',
3342 'aux-ajax-add-to-cart',
3343 'product_type_' . $product->get_type(),
3344 $product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : ''
3345 ) ) );
3346
3347 $args['attributes']['data-product-type'] = $product->get_type();
3348 $args['attributes']['data-verify_nonce'] = wp_create_nonce( 'aux_add_to_cart-' . $product->get_id() );
3349
3350 return $args;
3351 }
3352
3353 add_filter( 'woocommerce_loop_add_to_cart_args', 'auxels_enable_woocommerce_ajax_add_to_cart', 10 );
3354
3355 /*-----------------------------------------------------------------------------------*/
3356 /* Change Products Title Dom
3357 /*-----------------------------------------------------------------------------------*/
3358 add_action( 'init', 'auxin_remove_default_woocommerce_product_title' );
3359
3360 function auxin_remove_default_woocommerce_product_title() {
3361 remove_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10 );
3362 add_action( 'woocommerce_shop_loop_item_title', 'auxin_woocommerce_template_loop_product_title', 10 );
3363 }
3364
3365 function auxin_woocommerce_template_loop_product_title() {
3366 global $product;
3367 $dom = '<a href="' . esc_url( get_permalink( $product->get_id() ) ) . '"><h2 class="' . esc_attr( apply_filters( 'woocommerce_product_loop_title_classes', 'woocommerce-loop-product__title' ) ) . '">' . get_the_title() . '</h2></a>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
3368 echo apply_filters( 'auxin_woocommerce_template_loop_product_title', $dom );
3369 }
3370
3371 /**
3372 * Override inner body sections hooks for replace header&footer
3373 *
3374 * @return void
3375 */
3376 function auxin_override_inner_body_sections(){
3377
3378 global $post, $aux_main_post;
3379 $aux_main_post = $post;
3380
3381 if( ! class_exists( '\Elementor\Plugin' ) ){
3382 return;
3383 }
3384
3385 if ( 'default' === $use_legacy_header = auxin_get_post_meta( $post, 'page_header_use_legacy', 'default' ) ) {
3386 $use_legacy_header = auxin_get_option('site_header_use_legacy');
3387 }
3388
3389 if( ! auxin_is_true( $use_legacy_header ) ) {
3390 remove_action( 'auxin_after_inner_body_open', 'auxin_the_top_header_section', 4 );
3391 remove_action( 'auxin_after_inner_body_open', 'auxin_the_main_header_section', 4 );
3392 if ( ! class_exists( '\ElementorPro\Plugin' ) || empty( ElementorPro\Modules\ThemeBuilder\Module::instance()->get_conditions_manager()->get_documents_for_location( 'header' ) ) ) {
3393 add_action( 'auxin_after_inner_body_open', 'auxin_get_header_template', 4 );
3394 }
3395 }
3396 if ( 'default' === $use_legacy_footer = auxin_get_post_meta( $post, 'page_footer_use_legacy', 'default' ) ) {
3397 $use_legacy_footer = auxin_get_option('site_footer_use_legacy');
3398 }
3399
3400 if( ! auxin_is_true( $use_legacy_footer ) ) {
3401 remove_action( 'auxin_before_the_footer', 'auxin_the_site_footer' );
3402 if ( ! class_exists( '\ElementorPro\Plugin' ) || empty( ElementorPro\Modules\ThemeBuilder\Module::instance()->get_conditions_manager()->get_documents_for_location( 'footer' ) ) ) {
3403 add_action( 'auxin_before_the_footer', 'auxin_get_footer_template' );
3404 }
3405 }
3406 }
3407 add_action( 'wp', 'auxin_override_inner_body_sections' );
3408
3409 /**
3410 * Add canvas on elementor single template
3411 *
3412 * @param string $single_template
3413 * @return string
3414 */
3415 function auxin_load_canvas_template( $single_template ) {
3416 global $post;
3417
3418 if ( 'elementor_library' === $post->post_type && defined( 'ELEMENTOR_PATH' ) && defined( 'AUXIN_ELEMENTOR_TEMPLATE' ) ) {
3419 $template_type = get_post_meta( $post->ID, '_elementor_template_type', true );
3420 // Limit the template types
3421 if( ! in_array( $template_type, array( 'header', 'footer' ) ) ){
3422 return $single_template;
3423 }
3424 // Load elementor canvas template
3425 $elementor_2_0_canvas = ELEMENTOR_PATH . '/modules/page-templates/templates/canvas.php';
3426 if ( file_exists( $elementor_2_0_canvas ) ) {
3427 return $elementor_2_0_canvas;
3428 } else {
3429 return ELEMENTOR_PATH . '/includes/page-templates/canvas.php';
3430 }
3431 }
3432
3433 return $single_template;
3434 }
3435 add_filter( 'single_template', 'auxin_load_canvas_template' );
3436
3437
3438 /*-----------------------------------------------------------------------------------*/
3439 /* override the canvas template of elementor plugin
3440 /*-----------------------------------------------------------------------------------*/
3441
3442 function auxin_override_elementor_canvas_template( $template ){
3443
3444 if ( false !== strpos( $template, '/templates/canvas.php' ) ) {
3445 $template = AUXELS_PUB_DIR . '/templates/elementor/canvas.php';
3446 }
3447
3448 return $template;
3449 }
3450 add_filter( 'template_include', 'auxin_override_elementor_canvas_template', 12 );
3451
3452 /* -------------------------------------------------------------------------- */
3453 /* override default wordpress archive link for custom post types */
3454 /* -------------------------------------------------------------------------- */
3455
3456 function auxin_override_post_types_archive_link( $link, $post_type ) {
3457 if ( $post_type == 'portfolio' && auxin_is_true( auxin_get_option('portfolio_show_custom_archive_link') && ! empty( auxin_get_option( 'portfolio_custom_archive_link' ) ) ) ) {
3458 return get_permalink( auxin_get_option( 'portfolio_custom_archive_link' ) );
3459 }
3460
3461 if ( $post_type == 'news' && auxin_is_true( auxin_get_option('news_show_custom_archive_link') && ! empty( auxin_get_option( 'news_custom_archive_link' ) ) ) ) {
3462 return get_permalink( auxin_get_option( 'news_custom_archive_link' ) );
3463 }
3464
3465 return $link;
3466 }
3467 add_filter( 'post_type_archive_link', 'auxin_override_post_types_archive_link', 10, 2 );
3468
3469 function auxels_improve_usage_feedback( $args ) {
3470 // collect theme name and version
3471 if ( false == $transient = auxin_get_transient( 'auxels_usage_trac' ) ) {
3472 $migrated = ( THEME_ID == 'phlox-pro' && ! empty( get_option( 'theme_mods_phlox' ) ) ) ? true : false;
3473 $args['body']['client_meta']['migrated'] = $migrated;
3474
3475 $last_imported_demo = get_option( 'auxin_last_imported_demo', '' );
3476 if ( ! empty( $last_imported_demo ) && $last_imported_demo['id'] ) {
3477 $args['body']['client_meta'][ THEME_ID . '_imported_demo_id' ] = $last_imported_demo['id'];
3478 }
3479
3480 // plugins usage
3481 $plugins = [
3482 'Auxin Portfolio' => 'auxin-portfolio/auxin-portfolio.php',
3483 'Auxin Shop' => 'auxin-shop/auxin-shop.php',
3484 'Auxin News' => 'auxin-News/auxin-News.php',
3485 'WpBakery' => 'js_composer/js_composer.php',
3486 'Revolution Slider' => 'revslider/revslider.php',
3487 'SiteOrigin' => 'siteorigin-panels/siteorigin-panels.php',
3488 'Element Pack' => 'bdthemes-element-pack/bdthemes-element-pack.php',
3489 'Yellow Pencil' => 'waspthemes-yellow-pencil/yellow-pencil.php',
3490 'WooCommerce' => 'woocommerce/woocommerce.php',
3491 'Elementor' => 'elementor/elementor.php',
3492 'Elementor Pro' => 'elementor-pro/elementor-pro.php'
3493 ];
3494 foreach ( $plugins as $name => $plugin ) {
3495 if ( ! is_plugin_active( $plugin ) ) {
3496 unset( $plugins[ $name ] );
3497 }
3498 }
3499 $args['body']['client_meta']['plugins'] = $plugins;
3500
3501 // options usage
3502 $deprecated_options = [
3503 'header' => 'site_header_use_legacy',
3504 'footer' => 'site_footer_use_legacy'
3505 ];
3506 foreach( $deprecated_options as $key => $option ) {
3507 $args['body']['client_meta'][ 'has_dep_' . $key ] = auxin_is_true( auxin_get_option( $option ) ) ? 1 : 0;
3508 }
3509
3510 // post-types and title bar settings usage
3511 $args['body']['client_meta']['post-types'] = [
3512 'post' => [ 'num' => 0, 'title-bar' => 0 ],
3513 'page' => [ 'num' => 0, 'title-bar' => 0 ],
3514 'portfolio' => [ 'num' => 0, 'title-bar' => 0 ],
3515 'product' => [ 'num' => 0, 'title-bar' => 0 ],
3516 'news' => [ 'num' => 0, 'title-bar' => 0 ],
3517 'faq' => [ 'num' => 0, 'title-bar' => 0 ]
3518 ];
3519 foreach ( $args['body']['client_meta']['post-types'] as $key => $post_type ) {
3520 if ( ! post_type_exists( $post_type ) ) {
3521 continue;
3522 }
3523
3524 $query = new WP_Query( array( 'post_type' => $post_type, 'posts_per_page' => -1 ) );
3525 $args['body']['client_meta']['post-types'][ $key ]['num'] = $query->found_posts;
3526
3527 $title_bar_usage = 0;
3528 $title_bar_show = auxin_get_option( $post_type . '_show_title_bar' );
3529
3530 if ( $query->have_posts() ) {
3531 while( $query->have_posts() ) {
3532 $query->the_post();
3533
3534 if ( ( 'default' == $meta_title_bar = get_post_meta( get_the_ID(), 'aux_show_title_bar' ) ) && auxin_is_true( $title_bar_show ) ) {
3535 ++$title_bar_usage;
3536 } elseif ( auxin_is_true( $meta_title_bar ) ) {
3537 ++$title_bar_usage;
3538 }
3539 }
3540 }
3541 $args['body']['client_meta']['post-types'][ $key ]['title-bar'] = $title_bar_usage;
3542 wp_reset_postdata();
3543 }
3544
3545 $slug = THEME_PRO ? 'pro' : 'free';
3546 $args['body']['client_meta']['init_date_' . $slug] = get_theme_mod( 'initial_date_' . $slug , current_time( 'mysql' ) );
3547 $args['body']['client_meta']['init_version_' . $slug] = get_theme_mod( 'initial_version_' . $slug, THEME_VERSION );
3548
3549 auxin_set_transient( 'auxels_usage_trac', $args['body']['client_meta'], DAY_IN_SECONDS );
3550
3551 } else {
3552 $args['body']['client_meta'] = $transient;
3553 }
3554 return $args;
3555
3556 }
3557 add_filter( 'auxels_version_check_args', 'auxels_improve_usage_feedback' );
3558
3559 /*-----------------------------------------------------------------------------------*/
3560 /* Add header and footer edit link in admin bar
3561 /*-----------------------------------------------------------------------------------*/
3562 add_action( 'admin_bar_menu', 'auxin_add_admin_bar_header_footer_edit_link', 100);
3563
3564 function auxin_add_admin_bar_header_footer_edit_link() {
3565 global $wp_admin_bar, $post;
3566
3567 if ( !is_super_admin() || !is_admin_bar_showing() || is_admin() )
3568 return;
3569
3570 if ( 'default' === $use_legacy_header = auxin_get_post_meta( $post, 'page_header_use_legacy', 'default' ) ) {
3571 $use_legacy_header = auxin_get_option('site_header_use_legacy');
3572 }
3573
3574 if ( 'default' === $use_legacy_footer = auxin_get_post_meta( $post, 'page_footer_use_legacy', 'default' ) ) {
3575 $use_legacy_footer = auxin_get_option('site_footer_use_legacy');
3576 }
3577
3578 $template = [];
3579
3580 if ( get_post_type( $post ) == 'page' ) {
3581 if ( ! auxin_is_true( $use_legacy_header) && ( $current_header = auxin_get_post_meta( $post, 'page_elementor_header_template' ) ) && is_numeric( $current_header ) ) {
3582 $template['current']['header'] = $current_header;
3583 }
3584
3585 if ( ! auxin_is_true( $use_legacy_footer) && ( $current_footer = auxin_get_post_meta( $post, 'page_elementor_footer_template' ) ) && is_numeric( $current_footer ) ) {
3586 $template['current']['footer'] = $current_footer;
3587 }
3588 }
3589
3590 if ( ! auxin_is_true( auxin_get_option('site_header_use_legacy') ) && $global_header = auxin_get_option('site_elementor_header_template', '' ) ) {
3591 $template['global']['header'] = $global_header;
3592 }
3593
3594 if ( ! auxin_is_true( auxin_get_option('site_footer_use_legacy') ) && $global_footer = auxin_get_option('site_elementor_footer_template', '' ) ) {
3595 $template['global']['footer'] = $global_footer;
3596 }
3597
3598 if ( ! empty( $template['current'] ) ) {
3599
3600 foreach( $template['current'] as $key => $value ) {
3601 if ( empty( $value ) ) continue;
3602 $args[] = [
3603 'id' => 'aux-current-' . $key ,
3604 'title' => sprintf( '<span>%s</span><span class="aux-state">%s</span>', get_the_title( $value ), __( 'current ', 'auxin-elements' ) . $key ) ,
3605 'parent' => 'aux-header-footer',
3606 'href' => get_edit_post_link( $value ),
3607 'meta' => [
3608 'target' => '_blank'
3609 ]
3610 ];
3611 }
3612 }
3613
3614 if ( ! empty( $template['global'] ) ) {
3615
3616 foreach( $template['global'] as $key => $value ) {
3617 if ( empty( $value ) ) continue;
3618 $args[] = [
3619 'id' => 'aux-global-' . $key ,
3620 'title' => sprintf( '<span>%s</span><span class="aux-state">%s</span>', get_the_title( $value ), $key ) ,
3621 'parent' => 'aux-header-footer',
3622 'href' => get_edit_post_link( $value ),
3623 'meta' => [
3624 'target' => '_blank'
3625 ]
3626 ];
3627 }
3628 }
3629
3630 if ( ! empty( $args ) ) {
3631 $wp_admin_bar->add_node(
3632 [
3633 'id' => 'aux-header-footer',
3634 'title' => sprintf( '<div class="aux-header-footer-edit-links">%s</div>', __( 'Edit Header & Footer', 'auxin-elements' ) ),
3635 'href' => '',
3636 ]
3637 );
3638
3639 foreach ( $args as $arg ) {
3640 $wp_admin_bar->add_node( $arg );
3641 }
3642 }
3643 }
3644
3645 function auxels_add_svg_upload_permission( $mimes ){
3646 $mimes['svg'] = 'image/svg+xml';
3647 return $mimes;
3648 }
3649 add_filter( 'upload_mimes', 'auxels_add_svg_upload_permission' );
3650