Shortcodes and extra features for Phlox theme - Version 1.7.2

Version Description

Download this release

Release Info

Developer averta
Plugin Icon 128x128 Shortcodes and extra features for Phlox theme
Version 1.7.2
Comparing to
See all releases

Code changes from version 1.7.0 to 1.7.2

README.txt CHANGED
@@ -6,8 +6,8 @@ License URI: http://www.gnu.org/licenses/gpl.html
6
  Tags: testimonial, gallery, page-builder, siteorigin, auxin, phlox, averta, auxin-elements, framework, widget, fullwidth, masonry, timeline, parallax
7
  Requires PHP: 5.3
8
  Requires at least: 4.6
9
- Tested up to: 4.8.4
10
- Stable tag: 1.7.0
11
  License: GPLv3
12
  License URI: http://www.gnu.org/licenses/gpl.html
13
 
@@ -141,6 +141,18 @@ Bugs can be reported in our [support forums](http://wordpress.org/tags/auxin-ele
141
 
142
  == Changelog ==
143
 
 
 
 
 
 
 
 
 
 
 
 
 
144
  = Version 1.7.0 / 14.11.2017) =
145
  - [Fix]: An issue with recent post elements on single post page fixed.
146
  - [Fix]: Live preview for header action buttons while editing in customizer.
@@ -237,6 +249,6 @@ Bugs can be reported in our [support forums](http://wordpress.org/tags/auxin-ele
237
 
238
  == Upgrade Notice ==
239
 
240
- = 1.7.0 =
241
- - [Fix]: An issue with recent post elements on single post page fixed.
242
- - [Fix]: Live preview for header action buttons while editing in customizer.
6
  Tags: testimonial, gallery, page-builder, siteorigin, auxin, phlox, averta, auxin-elements, framework, widget, fullwidth, masonry, timeline, parallax
7
  Requires PHP: 5.3
8
  Requires at least: 4.6
9
+ Tested up to: 4.9.1
10
+ Stable tag: 1.7.2
11
  License: GPLv3
12
  License URI: http://www.gnu.org/licenses/gpl.html
13
 
141
 
142
  == Changelog ==
143
 
144
+ = Version 1.7.2 / 02.12.2017) =
145
+ - [New]: Secondary and optional logo image added for sticky header.
146
+ - [New]: Adding new option for header background color while header is sticky.
147
+ - [New]: Install plugins tab added to phlox welcome page.
148
+ - [New]: New element "Recent Post Tile Carousel" added.
149
+ - [New]: Link to setup wizard added to 'quick access' section in admin footer.
150
+ - [Improvement]: The dropdown control for categories in SiteOrigin Page Builder improved.
151
+ - [Improvement]: Add video length markup in the custom playlist.
152
+ - [Fix]: An issue with "Instagram feed" widget fixed.
153
+ - [Fix]: An issue with GMap widget fixed.
154
+
155
+
156
  = Version 1.7.0 / 14.11.2017) =
157
  - [Fix]: An issue with recent post elements on single post page fixed.
158
  - [Fix]: Live preview for header action buttons while editing in customizer.
249
 
250
  == Upgrade Notice ==
251
 
252
+ = 1.7.2 =
253
+ - [New]: Secondary and optional logo image added for sticky header.
254
+ - [New]: Adding new option for header background color while header is sticky.
admin/includes/admin-hooks.php CHANGED
@@ -105,6 +105,24 @@ function auxin_welcome_add_section_demos( $sections ){
105
 
106
  add_filter( 'auxin_admin_welcome_sections', 'auxin_welcome_add_section_demos', 60 );
107
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  /*-----------------------------------------------------------------------------------*/
109
  /* Adds system status tab in theme about (welcome) page
110
  /*-----------------------------------------------------------------------------------*/
@@ -399,18 +417,6 @@ function auxels_sync_deprecated_options(){
399
  }
400
  add_action( 'admin_init', 'auxels_sync_deprecated_options' );
401
 
402
- /*-----------------------------------------------------------------------------------*/
403
- /* Add allowed custom mieme types
404
- /*-----------------------------------------------------------------------------------*/
405
-
406
- function auxin_mime_types( $mimes ) {
407
- $mimes['svg'] = 'image/svg+xml';
408
- return $mimes;
409
- }
410
-
411
- add_filter('upload_mimes', 'auxin_mime_types');
412
-
413
-
414
  /*-----------------------------------------------------------------------------------*/
415
  /* Add post format related metafields to post
416
  /*-----------------------------------------------------------------------------------*/
@@ -507,24 +513,31 @@ function auxin_admin_footer_text( $footer_text ) {
507
  'dashboard',
508
  'edit-post',
509
  'edit-page',
510
- 'edit-portfolio'
 
 
511
  );
512
 
513
  if( ! ( function_exists('auxin_is_theme_admin_page') && auxin_is_theme_admin_page( $admin_pages ) ) ){
514
  return $footer_text;
515
  }
516
 
517
- $welcome_tab_url = admin_url( 'themes.php?page=auxin-welcome&tab=' );
 
 
518
 
519
  $auxin_text = sprintf(
520
- __( 'Quick access to %sdashboard%s, %soptions%s, %ssupport%s and %sfeedback%s page.', 'auxin-elements' ),
521
- '<a href="'. $welcome_tab_url .'features" title="Version ' . THEME_NAME_I18N . '" >' . THEME_NAME_I18N . ' ',
 
522
  '</a>',
523
- '<a href="'. admin_url( 'customize.php' ). '?url=' . $welcome_tab_url .'features" title="'. __('Theme Customizer', 'auxin-elements' ) .'" >',
524
  '</a>',
525
- '<a href="'. $welcome_tab_url .'support">',
526
  '</a>',
527
- '<a href="'. $welcome_tab_url .'feedback">',
 
 
528
  '</a>'
529
  );
530
 
@@ -613,8 +626,31 @@ add_filter( 'auxin_custom_css_string', 'auxels_strip_style_tags_from_custom_css'
613
 
614
  /*-----------------------------------------------------------------------------------*/
615
 
616
- function auxin_update_custom_js_css_file_on_post_save( $post_ID ){
 
 
 
 
 
 
617
  auxin_save_custom_js();
618
  auxin_save_custom_css();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
619
  }
620
- add_action( "save_post", "auxin_update_custom_js_css_file_on_post_save" );
105
 
106
  add_filter( 'auxin_admin_welcome_sections', 'auxin_welcome_add_section_demos', 60 );
107
 
108
+
109
+ /*-----------------------------------------------------------------------------------*/
110
+ /* Adds install plugins tab in about (welcome) page
111
+ /*-----------------------------------------------------------------------------------*/
112
+
113
+ function auxin_welcome_add_section_install_plugins( $sections ){
114
+
115
+ $sections['install_plugins'] = array(
116
+ 'label' => esc_html__( 'Install Plugins', THEME_DOMAIN ),
117
+ 'description' => '',
118
+ 'url' => self_admin_url( 'admin.php?page=auxin-wizard&step=default_plugins' ), // optional
119
+ );
120
+
121
+ return $sections;
122
+ }
123
+
124
+ add_filter( 'auxin_admin_welcome_sections', 'auxin_welcome_add_section_install_plugins', 70 );
125
+
126
  /*-----------------------------------------------------------------------------------*/
127
  /* Adds system status tab in theme about (welcome) page
128
  /*-----------------------------------------------------------------------------------*/
417
  }
418
  add_action( 'admin_init', 'auxels_sync_deprecated_options' );
419
 
 
 
 
 
 
 
 
 
 
 
 
 
420
  /*-----------------------------------------------------------------------------------*/
421
  /* Add post format related metafields to post
422
  /*-----------------------------------------------------------------------------------*/
513
  'dashboard',
514
  'edit-post',
515
  'edit-page',
516
+ 'edit-portfolio',
517
+ 'edit-faq',
518
+ 'edit-product'
519
  );
520
 
521
  if( ! ( function_exists('auxin_is_theme_admin_page') && auxin_is_theme_admin_page( $admin_pages ) ) ){
522
  return $footer_text;
523
  }
524
 
525
+ $welcome_tab_url = self_admin_url( 'themes.php?page=auxin-welcome&tab=' );
526
+ $setup_wizard_url = self_admin_url( 'themes.php?page=auxin-wizard' );
527
+
528
 
529
  $auxin_text = sprintf(
530
+ __( 'Quick access to %s %sdashboard%s, %ssetup wizard%s, %soptions%s, %ssupport%s and %sfeedback%s page.', 'auxin-elements' ),
531
+ '<strong>' . THEME_NAME_I18N . '</strong>',
532
+ '<a href="'. esc_url( $welcome_tab_url .'features' ) .'" title="'. sprintf( esc_attr__( '%s theme version %s', 'auxin-elements' ), THEME_NAME_I18N, THEME_VERSION ) .'" >',
533
  '</a>',
534
+ '<a href="'. esc_url( $setup_wizard_url ) .'" title="'. __('Theme Setup Wizard', 'auxin-elements' ) .'" >',
535
  '</a>',
536
+ '<a href="'. esc_url( self_admin_url( 'customize.php?url=' ) . $welcome_tab_url .'features' ) .'" title="'. __('Theme Customizer', 'auxin-elements' ) .'" >',
537
  '</a>',
538
+ '<a href="'. esc_url( $welcome_tab_url .'support' ) .'">',
539
+ '</a>',
540
+ '<a href="'. esc_url( $welcome_tab_url .'feedback' ) .'">',
541
  '</a>'
542
  );
543
 
626
 
627
  /*-----------------------------------------------------------------------------------*/
628
 
629
+ /**
630
+ * Recreate custom css and js files after updating auxin plugins
631
+ *
632
+ * @param $flush Whether to flush rewrite rules after plugin update or not
633
+ * @return void
634
+ */
635
+ function auxels_update_custom_js_css_file_on_auxin_plugin_update( $flush = true ){
636
  auxin_save_custom_js();
637
  auxin_save_custom_css();
638
+ if( $flush )
639
+ flush_rewrite_rules();
640
+ }
641
+ add_action( "auxin_plugin_updated", "auxels_update_custom_js_css_file_on_auxin_plugin_update" );
642
+
643
+
644
+ /**
645
+ * Triggers an action after plugin was updated to new version.
646
+ *
647
+ * @return void
648
+ */
649
+ function auxels_after_plugin_update(){
650
+ if( AUXELS_VERSION !== get_transient( 'auxin_' . AUXELS_SLUG . '_version' ) ){
651
+ set_transient( 'auxin_' . AUXELS_SLUG . '_version', AUXELS_VERSION, MONTH_IN_SECONDS );
652
+
653
+ do_action( 'auxin_plugin_updated', false, AUXELS_SLUG, AUXELS_VERSION, AUXELS_BASE_NAME );
654
+ }
655
  }
656
+ add_action( "admin_init", "auxels_after_plugin_update");
admin/includes/compatibility/siteorigin/fields/select2-multiple.class.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class Auxin_SiteOrigin_Field_Select2
5
+ */
6
+ class Auxin_SiteOrigin_Field_Select2_Multiple extends SiteOrigin_Widget_Field_Base {
7
+
8
+ protected $options;
9
+
10
+ protected function render_field( $value, $instance ) {
11
+
12
+ if( gettype( $value ) ==="string" ) {
13
+ $value = explode( ',', $value );
14
+ }
15
+
16
+ $output = '<div class="aux-element-field aux-multiple-selector ">';
17
+ $output .= '<select multiple="multiple" name="'.$this->element_name.'" id="'.$this->element_id.'" style="width:100%" ' . ' class="wpb-multiselect wpb_vc_param_value aux-select2-multiple">';
18
+
19
+ foreach ( $this->options as $id => $option_info ) {
20
+ $active_attr = in_array( $id, $value ) ? 'selected="selected"' : '';
21
+ $output .= sprintf( '<option value="%s" %s >%s</option>', $id, $active_attr, $option_info );
22
+ }
23
+
24
+ $output .= '</select></div>';
25
+
26
+ echo $output;
27
+
28
+ }
29
+
30
+ protected function sanitize_field_input( $value, $instance ) {
31
+ return $value;
32
+ }
33
+ }
auxin-elements.php CHANGED
@@ -12,14 +12,14 @@
12
  * Plugin Name: Phlox Core Elements
13
  * Plugin URI: https://wordpress.org/plugins/auxin-elements/
14
  * Description: Powerful and comprehensive plugin that extends the functionality of Phlox theme by adding new shortcodes, widgets and options
15
- * Version: 1.7.0
16
  * Author: averta
17
  * Author URI: http://averta.net
18
  * Text Domain: auxin-elements
19
  * License: GPL2
20
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
21
  * Domain Path: /languages
22
- * Tested up to: 4.8.4
23
  */
24
 
25
  // If this file is called directly, abort.
@@ -68,7 +68,7 @@ if( is_admin() || false === get_transient( 'auxels_plugin_requirements_check' )
68
  'themes' => array(
69
  array(
70
  'name' => __('Phlox', 'auxin-elements'), // The theme name.
71
- 'version' => '1.9.0', // E.g. 1.0.0. If set, the active theme must be this version or higher.
72
  'is_callable' => '', // If set, this callable will be be checked for availability to determine if a theme is active.
73
  'file_exists' => get_template_directory() . '/auxin/auxin-include/auxin.php' // If set, this file will be checked for availability to determine if a theme is active.
74
  )
12
  * Plugin Name: Phlox Core Elements
13
  * Plugin URI: https://wordpress.org/plugins/auxin-elements/
14
  * Description: Powerful and comprehensive plugin that extends the functionality of Phlox theme by adding new shortcodes, widgets and options
15
+ * Version: 1.7.2
16
  * Author: averta
17
  * Author URI: http://averta.net
18
  * Text Domain: auxin-elements
19
  * License: GPL2
20
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
21
  * Domain Path: /languages
22
+ * Tested up to: 4.9.1
23
  */
24
 
25
  // If this file is called directly, abort.
68
  'themes' => array(
69
  array(
70
  'name' => __('Phlox', 'auxin-elements'), // The theme name.
71
+ 'version' => '1.9.2', // E.g. 1.0.0. If set, the active theme must be this version or higher.
72
  'is_callable' => '', // If set, this callable will be be checked for availability to determine if a theme is active.
73
  'file_exists' => get_template_directory() . '/auxin/auxin-include/auxin.php' // If set, this file will be checked for availability to determine if a theme is active.
74
  )
includes/classes/class-auxin-siteorigin-widget.php CHANGED
@@ -106,9 +106,8 @@ class Auxin_SiteOrigin_Widget extends SiteOrigin_Widget {
106
  }
107
  break;
108
 
109
- // TODO: IT should change and now is just for test
110
- case 'aux_multiple_selector' :
111
- $so_field['type'] = 'select';
112
  $so_field['options'] = $field['value'];
113
  $so_field['multiple'] = true;
114
 
106
  }
107
  break;
108
 
109
+ case 'aux_select2_multiple' :
110
+ $so_field['type'] = 'select2_multiple';
 
111
  $so_field['options'] = $field['value'];
112
  $so_field['multiple'] = true;
113
 
includes/classes/class-auxin-widget.php CHANGED
@@ -239,11 +239,13 @@ class Auxin_Widget extends WP_Widget {
239
 
240
  if( gettype( $instance[ $id ] ) ==="string" ) {
241
  $select = explode( ',', $instance[ $id ] );
 
 
242
  }
243
 
244
  $output = '';
245
  $output .= '<div class="aux-element-field aux-multiple-selector ">';
246
- $output .= '<select multiple="multiple" name="' . esc_sql( $field['id'] ) . '" style="width:100%" ' . ' class="wpb-multiselect wpb_vc_param_value aux-select2-multiple ' . esc_sql( $field['id'] ) . ' ' . $field['type'] . '_field" '. '>';
247
 
248
  foreach ( $field['options'] as $key => $value ) {
249
  $active_attr = in_array( $key, $select) ? 'selected="selected"' : '';
239
 
240
  if( gettype( $instance[ $id ] ) ==="string" ) {
241
  $select = explode( ',', $instance[ $id ] );
242
+ } else {
243
+ $select = $instance[ $id ];
244
  }
245
 
246
  $output = '';
247
  $output .= '<div class="aux-element-field aux-multiple-selector ">';
248
+ $output .= '<select multiple="multiple" name="'.$this->get_field_name($id).'" id="'.$this->get_field_id($id).'" style="width:100%" ' . ' class="wpb-multiselect wpb_vc_param_value aux-select2-multiple ' . esc_sql( $field['id'] ) . ' ' . $field['type'] . '_field">';
249
 
250
  foreach ( $field['options'] as $key => $value ) {
251
  $active_attr = in_array( $key, $select) ? 'selected="selected"' : '';
includes/classes/class-auxin-wizard.php CHANGED
@@ -133,6 +133,11 @@ class Auxin_Wizard {
133
  add_filter( 'tgmpa_load' , array( $this, 'tgmpa_load' ), 10, 1 );
134
  add_action( 'wp_ajax_aux_setup_plugins' , array( $this, 'ajax_plugins' ) );
135
  add_action( 'admin_enqueue_scripts' , array( $this, 'maybe_add_body_class_name' ) );
 
 
 
 
 
136
  }
137
  }
138
 
@@ -168,6 +173,7 @@ class Auxin_Wizard {
168
 
169
  wp_enqueue_script( 'auxin-wizard' , AUXELS_PUB_URL . '/assets/js/wizard.js' , array(
170
  'jquery',
 
171
  'jquery-blockui'
172
  ), $this->version );
173
 
@@ -387,7 +393,7 @@ class Auxin_Wizard {
387
  echo 'queue';
388
  }
389
  ?>">
390
- <a href="<?php echo esc_url( $this->get_step_link( $step_key ) ); ?>"><?php echo esc_html( $step['name'] ); ?></a>
391
  </li>
392
  <?php endforeach; ?>
393
  </ol>
@@ -427,7 +433,7 @@ class Auxin_Wizard {
427
  public function setup_introduction() {
428
  if ( 0 && get_transient( 'aux_setup_complete' ) ) {
429
  ?>
430
- <div class="aux-welcome-step">
431
  <h1><?php printf( __( 'Beautiful Portfolio %s Websites, Free with %s Phlox Theme', 'auxin-elements' ), '<br />', '<br />' ); ?></h1>
432
  <p><?php esc_html_e( 'It looks like you have already run the setup!', 'auxin-elements' ); ?><br><?php esc_html_e( 'Would you like to continue this step?', 'auxin-elements' ); ?></p>
433
  <img src="<?php echo esc_url( AUXELS_ADMIN_URL . '/assets/images/wizard/start.png' ); ?>" width="1012" height="875">
@@ -439,7 +445,7 @@ class Auxin_Wizard {
439
  <?php
440
  } else {
441
  ?>
442
- <div class="aux-welcome-step">
443
  <h1><?php printf( __( 'Beautiful Portfolio %s Websites, Free with %s Phlox Theme', 'auxin-elements' ), '<br />', '<br />' ); ?></h1>
444
  <p><?php esc_html_e( 'Start Building Your Website in a Few Simple Steps', 'auxin-elements' ); ?></p>
445
  <img src="<?php echo esc_url( AUXELS_ADMIN_URL . '/assets/images/wizard/start.png' ); ?>" width="1012" height="875">
@@ -458,7 +464,7 @@ class Auxin_Wizard {
458
  /*-----------------------------------------------------------------------------------*/
459
  public function setup_tutorial() {
460
  ?>
461
- <div class="aux-tutorial-step">
462
 
463
  <div class="aux-section">
464
  <h2><?php esc_html_e( '1. Child Theme (Optional)' ); ?></h2>
@@ -568,10 +574,10 @@ class Auxin_Wizard {
568
 
569
  <div class="aux-setup-actions step">
570
  <a href="<?php echo esc_url( $this->get_prev_step_link() ); ?>"
571
- class="aux-button aux-left aux-outline button-next"><?php esc_html_e( 'Previous Step', 'auxin-elements' ); ?></a>
572
 
573
  <a href="<?php echo esc_url( $this->get_next_step_link() ); ?>"
574
- class="aux-button aux-primary button-next"><?php esc_html_e( 'Next Step', 'auxin-elements' ); ?></a>
575
  </div>
576
 
577
  </div>
@@ -614,7 +620,7 @@ class Auxin_Wizard {
614
  /* If we arrive here, we have the filesystem */
615
 
616
  ?>
617
- <div class="aux-plugins-step aux-has-required-plugins">
618
  <h2><?php esc_html_e( 'Recommended Plugins', 'auxin-elements' ); ?></h2>
619
 
620
  <?php
@@ -654,7 +660,7 @@ class Auxin_Wizard {
654
  ?>
655
  <tr class="aux-plugin" data-slug="<?php echo esc_attr( $slug ); ?>">
656
  <th scope="row" class="check-column">
657
- <input name="plugin[]" value="<?php echo esc_attr($slug); ?>" type="checkbox">
658
  <div class="spinner"></div>
659
  </th>
660
  <td class="thumbnail column-thumbnail"
@@ -717,15 +723,15 @@ class Auxin_Wizard {
717
 
718
  <div class="aux-setup-actions step">
719
  <a href="<?php echo esc_url( $this->get_prev_step_link() ); ?>"
720
- class="aux-button aux-left aux-outline button-next"><?php esc_html_e( 'Previous Step', 'auxin-elements' ); ?></a>
721
- <a href="<?php echo esc_url( $this->get_next_step_link() ); ?>"
722
- class="aux-button aux-outline skip-next button-next"><?php esc_html_e( 'Next Step', 'auxin-elements' ); ?></a>
723
  <a href="<?php echo esc_url( $this->get_next_step_link() ); ?>"
724
  class="aux-button aux-primary install-plugins disabled button-next"
725
  data-callback="install_plugins"><?php esc_html_e( 'Install Plugins', 'auxin-elements' ); ?></a>
726
- <?php wp_nonce_field( 'aux-setup' ); ?>
 
 
727
  </div>
728
-
729
  </div>
730
 
731
  <?php
@@ -882,7 +888,7 @@ class Auxin_Wizard {
882
  // Get the available demos list from Averta API
883
  $data = $this->parse_json( 'http://averta.net/phlox/wordpress-theme/demo/wp-content/list.json' );
884
  ?>
885
- <div class="aux-demo-importer-step">
886
  <div class="aux-section">
887
  <h2><?php esc_html_e( 'Demo Importer', 'auxin-elements' ); ?></h2>
888
  <p>
@@ -1005,7 +1011,7 @@ class Auxin_Wizard {
1005
  <p><?php esc_html_e( 'You need to activate all above plugins.', 'auxin-elements' ); ?></p>
1006
  </div>
1007
  <a href="<?php echo esc_url( $this->get_next_step_link() ); ?>"
1008
- class="aux-button aux-medium aux-primary button-next"
1009
  data-callback="install_plugins"
1010
  data-nonce="<?php echo wp_create_nonce( 'aux-import-demo-' . $args['site_id'] ); ?>"
1011
  data-import-id="<?php echo esc_attr( $args['site_id'] ); ?>"
@@ -1043,11 +1049,11 @@ class Auxin_Wizard {
1043
 
1044
  <div class="aux-setup-actions step">
1045
  <a href="<?php echo esc_url( $this->get_prev_step_link() ); ?>"
1046
- class="aux-button aux-left aux-outline button-next"><?php esc_html_e( 'Previous Step', 'auxin-elements' ); ?></a>
1047
- <a href="<?php echo esc_url( $this->get_next_step_link() ); ?>"
1048
- class="aux-button aux-outline button-next"><?php esc_html_e( 'Next Step', 'auxin-elements' ); ?></a>
1049
  <a href="#TB_inline?width=640&height=450&inlineId="
1050
- class="aux-button aux-install-demo aux-primary thickbox" style="display:none;"><?php esc_html_e( 'Install Demo', 'auxin-elements' ); ?></a>
 
 
1051
  </div>
1052
 
1053
  </div>
@@ -1091,7 +1097,7 @@ class Auxin_Wizard {
1091
  set_transient( 'auxin_hide_core_plugin_notice', time(), 4 * YEAR_IN_SECONDS );
1092
  ?>
1093
 
1094
- <div class="aux-final-step">
1095
  <i class="auxicon-big auxicon-check-mark-circle-outline"></i>
1096
  <h2><?php esc_html_e( 'Your Website is Ready!', 'auxin-elements' ); ?></h2>
1097
  <p><?php esc_html_e( 'Congratulations! You website has been successfully configured.', 'auxin-elements' ); ?></p>
133
  add_filter( 'tgmpa_load' , array( $this, 'tgmpa_load' ), 10, 1 );
134
  add_action( 'wp_ajax_aux_setup_plugins' , array( $this, 'ajax_plugins' ) );
135
  add_action( 'admin_enqueue_scripts' , array( $this, 'maybe_add_body_class_name' ) );
136
+
137
+ if( isset( $_POST['action'] ) && $_POST['action'] === "aux_setup_plugins" && wp_doing_ajax() ) {
138
+ add_filter( 'wp_redirect', '__return_false', 999 );
139
+ }
140
+
141
  }
142
  }
143
 
173
 
174
  wp_enqueue_script( 'auxin-wizard' , AUXELS_PUB_URL . '/assets/js/wizard.js' , array(
175
  'jquery',
176
+ 'auxin_plugins',
177
  'jquery-blockui'
178
  ), $this->version );
179
 
393
  echo 'queue';
394
  }
395
  ?>">
396
+ <a href="<?php echo esc_url( $this->get_step_link( $step_key ) ); ?>"><span><?php echo esc_html( $step['name'] ); ?></span></a>
397
  </li>
398
  <?php endforeach; ?>
399
  </ol>
433
  public function setup_introduction() {
434
  if ( 0 && get_transient( 'aux_setup_complete' ) ) {
435
  ?>
436
+ <div class="aux-welcome-step aux-fadein-animation">
437
  <h1><?php printf( __( 'Beautiful Portfolio %s Websites, Free with %s Phlox Theme', 'auxin-elements' ), '<br />', '<br />' ); ?></h1>
438
  <p><?php esc_html_e( 'It looks like you have already run the setup!', 'auxin-elements' ); ?><br><?php esc_html_e( 'Would you like to continue this step?', 'auxin-elements' ); ?></p>
439
  <img src="<?php echo esc_url( AUXELS_ADMIN_URL . '/assets/images/wizard/start.png' ); ?>" width="1012" height="875">
445
  <?php
446
  } else {
447
  ?>
448
+ <div class="aux-welcome-step aux-fadein-animation">
449
  <h1><?php printf( __( 'Beautiful Portfolio %s Websites, Free with %s Phlox Theme', 'auxin-elements' ), '<br />', '<br />' ); ?></h1>
450
  <p><?php esc_html_e( 'Start Building Your Website in a Few Simple Steps', 'auxin-elements' ); ?></p>
451
  <img src="<?php echo esc_url( AUXELS_ADMIN_URL . '/assets/images/wizard/start.png' ); ?>" width="1012" height="875">
464
  /*-----------------------------------------------------------------------------------*/
465
  public function setup_tutorial() {
466
  ?>
467
+ <div class="aux-tutorial-step aux-fadein-animation">
468
 
469
  <div class="aux-section">
470
  <h2><?php esc_html_e( '1. Child Theme (Optional)' ); ?></h2>
574
 
575
  <div class="aux-setup-actions step">
576
  <a href="<?php echo esc_url( $this->get_prev_step_link() ); ?>"
577
+ class="aux-button aux-left aux-has-icon aux-outline button-next"><i class="axicon-angle-left"></i><span><?php esc_html_e( 'Previous Step', 'auxin-elements' ); ?></span></a>
578
 
579
  <a href="<?php echo esc_url( $this->get_next_step_link() ); ?>"
580
+ class="aux-button aux-primary aux-has-icon button-next"><i class="axicon-angle-right"></i><span><?php esc_html_e( 'Next Step', 'auxin-elements' ); ?></span></a>
581
  </div>
582
 
583
  </div>
620
  /* If we arrive here, we have the filesystem */
621
 
622
  ?>
623
+ <div class="aux-plugins-step aux-has-required-plugins aux-fadein-animation">
624
  <h2><?php esc_html_e( 'Recommended Plugins', 'auxin-elements' ); ?></h2>
625
 
626
  <?php
660
  ?>
661
  <tr class="aux-plugin" data-slug="<?php echo esc_attr( $slug ); ?>">
662
  <th scope="row" class="check-column">
663
+ <input class="aux-check-column" name="plugin[]" value="<?php echo esc_attr($slug); ?>" type="checkbox">
664
  <div class="spinner"></div>
665
  </th>
666
  <td class="thumbnail column-thumbnail"
723
 
724
  <div class="aux-setup-actions step">
725
  <a href="<?php echo esc_url( $this->get_prev_step_link() ); ?>"
726
+ class="aux-button aux-left aux-has-icon aux-outline button-next"><i class="axicon-angle-left"></i><span><?php esc_html_e( 'Previous Step', 'auxin-elements' ); ?></span></a>
 
 
727
  <a href="<?php echo esc_url( $this->get_next_step_link() ); ?>"
728
  class="aux-button aux-primary install-plugins disabled button-next"
729
  data-callback="install_plugins"><?php esc_html_e( 'Install Plugins', 'auxin-elements' ); ?></a>
730
+ <?php wp_nonce_field( 'aux-setup' ); ?>
731
+ <a href="<?php echo esc_url( $this->get_next_step_link() ); ?>"
732
+ class="aux-button aux-outline aux-has-icon skip-next button-next"><i class="axicon-angle-right"></i><span><?php esc_html_e( 'Skip This Step', 'auxin-elements' ); ?></span></a>
733
  </div>
734
+
735
  </div>
736
 
737
  <?php
888
  // Get the available demos list from Averta API
889
  $data = $this->parse_json( 'http://averta.net/phlox/wordpress-theme/demo/wp-content/list.json' );
890
  ?>
891
+ <div class="aux-demo-importer-step aux-fadein-animation">
892
  <div class="aux-section">
893
  <h2><?php esc_html_e( 'Demo Importer', 'auxin-elements' ); ?></h2>
894
  <p>
1011
  <p><?php esc_html_e( 'You need to activate all above plugins.', 'auxin-elements' ); ?></p>
1012
  </div>
1013
  <a href="<?php echo esc_url( $this->get_next_step_link() ); ?>"
1014
+ class="aux-button aux-medium install-plugins aux-primary button-next"
1015
  data-callback="install_plugins"
1016
  data-nonce="<?php echo wp_create_nonce( 'aux-import-demo-' . $args['site_id'] ); ?>"
1017
  data-import-id="<?php echo esc_attr( $args['site_id'] ); ?>"
1049
 
1050
  <div class="aux-setup-actions step">
1051
  <a href="<?php echo esc_url( $this->get_prev_step_link() ); ?>"
1052
+ class="aux-button aux-left aux-has-icon aux-outline button-next"><i class="axicon-angle-left"></i><span><?php esc_html_e( 'Previous Step', 'auxin-elements' ); ?></span></a>
 
 
1053
  <a href="#TB_inline?width=640&height=450&inlineId="
1054
+ class="aux-button aux-install-demo aux-primary disabled thickbox"><?php esc_html_e( 'Install Demo', 'auxin-elements' ); ?></a>
1055
+ <a href="<?php echo esc_url( $this->get_next_step_link() ); ?>"
1056
+ class="aux-button aux-outline aux-has-icon skip-next button-next"><i class="axicon-angle-right"></i><span><?php esc_html_e( 'Skip This Step', 'auxin-elements' ); ?></span></a>
1057
  </div>
1058
 
1059
  </div>
1097
  set_transient( 'auxin_hide_core_plugin_notice', time(), 4 * YEAR_IN_SECONDS );
1098
  ?>
1099
 
1100
+ <div class="aux-final-step aux-fadein-animation">
1101
  <i class="auxicon-big auxicon-check-mark-circle-outline"></i>
1102
  <h2><?php esc_html_e( 'Your Website is Ready!', 'auxin-elements' ); ?></h2>
1103
  <p><?php esc_html_e( 'Congratulations! You website has been successfully configured.', 'auxin-elements' ); ?></p>
includes/define.php CHANGED
@@ -12,7 +12,7 @@ if( ! defined( 'THEME_NAME' ) ){
12
  }
13
 
14
 
15
- define( 'AUXELS_VERSION' , '1.7.0' );
16
 
17
  define( 'AUXELS_SLUG' , 'auxin-elements' );
18
 
12
  }
13
 
14
 
15
+ define( 'AUXELS_VERSION' , '1.7.2' );
16
 
17
  define( 'AUXELS_SLUG' , 'auxin-elements' );
18
 
includes/elements/button.php CHANGED
@@ -293,6 +293,7 @@ function auxin_widget_button_callback( $atts = array(), $shortcode_content = nul
293
  'color_name' => 'carmine-pink',
294
  'link' => '',
295
  'target' => '_self',
 
296
 
297
  'extra_classes' => '', // custom css class names for this element
298
  'custom_el_id' => '',
@@ -324,6 +325,25 @@ function auxin_widget_button_callback( $atts = array(), $shortcode_content = nul
324
  $btn_css_classes[] = 'aux-icon-' . $icon_align; // icon align
325
  }
326
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
327
  if( ! empty( $extra_classes ) ) {
328
  $btn_css_classes[] = $extra_classes;
329
  }
@@ -352,7 +372,7 @@ function auxin_widget_button_callback( $atts = array(), $shortcode_content = nul
352
 
353
  // widget custom output -----------------------
354
 
355
- $output .= "<$btn_tag $btn_href $button_class_attr>";
356
  $output .= $btn_content;
357
  $output .= "</$btn_tag>";
358
 
293
  'color_name' => 'carmine-pink',
294
  'link' => '',
295
  'target' => '_self',
296
+ 'btn_attrs' => '', // data-attr1{val1};data-attr2{val2}
297
 
298
  'extra_classes' => '', // custom css class names for this element
299
  'custom_el_id' => '',
325
  $btn_css_classes[] = 'aux-icon-' . $icon_align; // icon align
326
  }
327
 
328
+ // add extra attributes to button element if defined
329
+ $btn_other_attrs = '';
330
+
331
+ if( $btn_attrs = trim( $btn_attrs, ';' ) ){
332
+ preg_match_all('/([\-|\w]+)(?!{})([\w]+)/s', $btn_attrs, $btn_attr_matches );
333
+
334
+ if( ! empty( $btn_attr_matches[0] ) && is_array( $btn_attr_matches[0] ) ){
335
+ foreach( $btn_attr_matches[0] as $i => $attr_name_value ){
336
+ if( 0 == $i % 2 ){
337
+ $btn_other_attrs .= sprintf(' %s', $attr_name_value);
338
+ } else {
339
+ $btn_other_attrs .= sprintf('="%s"', esc_attr( trim( $attr_name_value ) ) );
340
+ }
341
+ }
342
+ $btn_other_attrs = trim( $btn_other_attrs );
343
+ }
344
+ }
345
+
346
+
347
  if( ! empty( $extra_classes ) ) {
348
  $btn_css_classes[] = $extra_classes;
349
  }
372
 
373
  // widget custom output -----------------------
374
 
375
+ $output .= "<$btn_tag $btn_href $btn_other_attrs $button_class_attr>";
376
  $output .= $btn_content;
377
  $output .= "</$btn_tag>";
378
 
includes/elements/gmap.php CHANGED
@@ -233,6 +233,8 @@ function auxin_widget_gmaps_callback( $atts, $shortcode_content = null ){
233
  $result = auxin_get_widget_scafold( $atts, $default_atts, $shortcode_content );
234
  extract( $result['parsed_atts'] );
235
 
 
 
236
  // widget header ------------------------------
237
  echo $result['widget_header'];
238
  echo $result['widget_title'];
@@ -246,7 +248,6 @@ function auxin_widget_gmaps_callback( $atts, $shortcode_content = null ){
246
  $style = rawurldecode( base64_decode( strip_tags( $style ) ) );
247
  }
248
 
249
- ob_start();
250
  ?>
251
 
252
  <div class="aux-col-wrapper aux-no-gutter">
@@ -297,6 +298,8 @@ function auxin_widget_gmaps_callback( $atts, $shortcode_content = null ){
297
  </div><!-- aux-col-wrapper -->
298
 
299
  <?php
 
300
  echo $result['widget_footer'];
 
301
  return ob_get_clean();
302
  }
233
  $result = auxin_get_widget_scafold( $atts, $default_atts, $shortcode_content );
234
  extract( $result['parsed_atts'] );
235
 
236
+ ob_start();
237
+
238
  // widget header ------------------------------
239
  echo $result['widget_header'];
240
  echo $result['widget_title'];
248
  $style = rawurldecode( base64_decode( strip_tags( $style ) ) );
249
  }
250
 
 
251
  ?>
252
 
253
  <div class="aux-col-wrapper aux-no-gutter">
298
  </div><!-- aux-col-wrapper -->
299
 
300
  <?php
301
+ // widget footer ------------------------------
302
  echo $result['widget_footer'];
303
+
304
  return ob_get_clean();
305
  }
includes/elements/instagram-feed.php CHANGED
@@ -20,7 +20,7 @@ function auxin_get_instagram_master_array( $master_array ) {
20
  'show_settings_on_create' => true,
21
  'weight' => 1,
22
  'is_widget' => true,
23
- 'is_shortcode' => false,
24
  'is_so' => true,
25
  'is_vc' => true,
26
  'category' => THEME_NAME,
20
  'show_settings_on_create' => true,
21
  'weight' => 1,
22
  'is_widget' => true,
23
+ 'is_shortcode' => true,
24
  'is_so' => true,
25
  'is_vc' => true,
26
  'category' => THEME_NAME,
includes/elements/recent-posts-grid-carousel.php CHANGED
@@ -1010,4 +1010,4 @@ function auxin_widget_recent_posts_callback( $atts, $shortcode_content = null ){
1010
  echo $result['widget_footer'];
1011
 
1012
  return ob_get_clean();
1013
- }
1010
  echo $result['widget_footer'];
1011
 
1012
  return ob_get_clean();
1013
+ }
includes/elements/recent-posts-tiles-carousel.php ADDED
@@ -0,0 +1,707 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Recent Posts Tiles in Carousel Mode
4
+ *
5
+ *
6
+ * @package Auxin
7
+ * @license LICENSE.txt
8
+ * @author
9
+ * @link http://averta.net/phlox/
10
+ * @copyright (c) 2010-2017
11
+ */
12
+
13
+ function auxin_get_recent_posts_tiles_carousel_master_array( $master_array ) {
14
+
15
+ $master_array['aux_recent_posts_tiles_carousel'] = array(
16
+ 'name' => __('Recent Posts Tiles Carousel', 'auxin-elements' ),
17
+ 'auxin_output_callback' => 'auxin_widget_recent_posts_tiles_carousel_callback',
18
+ 'base' => 'aux_recent_posts_tiles_carousel',
19
+ 'description' => __('It adds recent posts in tiles carousel mode.', 'auxin-elements' ),
20
+ 'class' => 'aux-widget-recent-posts-tiles aux-carousel',
21
+ 'show_settings_on_create' => true,
22
+ 'weight' => 1,
23
+ 'is_widget' => false,
24
+ 'is_shortcode' => true,
25
+ 'is_so' => true,
26
+ 'is_vc' => true,
27
+ 'category' => THEME_NAME,
28
+ 'group' => '',
29
+ 'admin_enqueue_js' => '',
30
+ 'admin_enqueue_css' => '',
31
+ 'front_enqueue_js' => '',
32
+ 'front_enqueue_css' => '',
33
+ 'icon' => 'aux-element aux-pb-icons-tile',
34
+ 'custom_markup' => '',
35
+ 'js_view' => '',
36
+ 'html_template' => '',
37
+ 'deprecated' => '',
38
+ 'content_element' => '',
39
+ 'as_parent' => '',
40
+ 'as_child' => '',
41
+ 'params' => array(
42
+ array(
43
+ 'heading' => __('Title','auxin-elements' ),
44
+ 'description' => __('Recent post title, leave it empty if you don`t need title.', 'auxin-elements'),
45
+ 'param_name' => 'title',
46
+ 'type' => 'textfield',
47
+ 'value' => '',
48
+ 'holder' => 'textfield',
49
+ 'class' => 'title',
50
+ 'admin_label' => false,
51
+ 'dependency' => '',
52
+ 'weight' => '',
53
+ 'group' => '',
54
+ 'edit_field_class' => ''
55
+ ),
56
+ array(
57
+ 'heading' => __('Categories', 'auxin-elements'),
58
+ 'description' => __('Specifies a category that you want to show posts from it.', 'auxin-elements' ),
59
+ 'param_name' => 'cat',
60
+ 'type' => 'aux_taxonomy',
61
+ 'taxonomy' => 'category',
62
+ 'def_value' => ' ',
63
+ 'holder' => '',
64
+ 'class' => 'cat',
65
+ 'admin_label' => false,
66
+ 'dependency' => '',
67
+ 'weight' => '',
68
+ 'group' => 'Query',
69
+ 'edit_field_class' => ''
70
+ ),
71
+ array(
72
+ 'heading' => __('Number of posts to show in per page', 'auxin-elements'),
73
+ 'description' => '',
74
+ 'param_name' => 'num',
75
+ 'type' => 'textfield',
76
+ 'value' => '5',
77
+ 'holder' => '',
78
+ 'class' => 'num',
79
+ 'admin_label' => false,
80
+ 'dependency' => '',
81
+ 'weight' => '',
82
+ 'group' => 'Query',
83
+ 'edit_field_class' => ''
84
+ ),
85
+ array(
86
+ 'heading' => __('Number of Pages', 'auxin-elements'),
87
+ 'description' => '',
88
+ 'param_name' => 'page',
89
+ 'type' => 'textfield',
90
+ 'value' => '2',
91
+ 'holder' => '',
92
+ 'class' => 'num',
93
+ 'admin_label' => false,
94
+ 'dependency' => '',
95
+ 'weight' => '',
96
+ 'group' => 'Query',
97
+ 'edit_field_class' => ''
98
+ ),
99
+ array(
100
+ 'heading' => __('Exclude posts without media','auxin-elements' ),
101
+ 'description' => '',
102
+ 'param_name' => 'exclude_without_media',
103
+ 'type' => 'aux_switch',
104
+ 'value' => '1',
105
+ 'class' => '',
106
+ 'admin_label' => false,
107
+ 'dependency' => '',
108
+ 'weight' => '',
109
+ 'group' => 'Query',
110
+ 'edit_field_class' => ''
111
+ ),
112
+ array(
113
+ 'heading' => __('Exclude custom post formats','auxin-elements' ),
114
+ 'description' => '',
115
+ 'param_name' => 'exclude_custom_post_formats',
116
+ 'type' => 'aux_switch',
117
+ 'value' => '1',
118
+ 'class' => '',
119
+ 'admin_label' => false,
120
+ 'dependency' => '',
121
+ 'weight' => '',
122
+ 'group' => 'Query',
123
+ 'edit_field_class' => ''
124
+ ),
125
+ array(
126
+ 'heading' => __('Exclude quote and link post formats','auxin-elements' ),
127
+ 'description' => '',
128
+ 'param_name' => 'exclude_quote_link',
129
+ 'type' => 'aux_switch',
130
+ 'value' => '1',
131
+ 'class' => '',
132
+ 'admin_label' => false,
133
+ 'dependency' => array(
134
+ 'element' => 'exclude_custom_post_formats',
135
+ 'value' => '0'
136
+ ),
137
+ 'weight' => '',
138
+ 'group' => 'Query',
139
+ 'edit_field_class' => ''
140
+ ),
141
+ array(
142
+ 'heading' => __('Order by', 'auxin-elements'),
143
+ 'description' => '',
144
+ 'param_name' => 'order_by',
145
+ 'type' => 'dropdown',
146
+ 'def_value' => 'date',
147
+ 'holder' => '',
148
+ 'class' => 'order_by',
149
+ 'value' => array (
150
+ 'date' => __('Date', 'auxin-elements'),
151
+ 'menu_order date' => __('Menu Order', 'auxin-elements'),
152
+ 'title' => __('Title', 'auxin-elements'),
153
+ 'ID' => __('ID', 'auxin-elements'),
154
+ 'rand' => __('Random', 'auxin-elements'),
155
+ 'comment_count' => __('Comments', 'auxin-elements'),
156
+ 'modified' => __('Date Modified', 'auxin-elements'),
157
+ 'author' => __('Author', 'auxin-elements'),
158
+ 'post__in' => __('Inserted Post IDs', 'auxin-elements')
159
+ ),
160
+ 'admin_label' => false,
161
+ 'dependency' => '',
162
+ 'weight' => '',
163
+ 'group' => 'Query',
164
+ 'edit_field_class' => ''
165
+ ),
166
+ array(
167
+ 'heading' => __('Order', 'auxin-elements'),
168
+ 'description' => '',
169
+ 'param_name' => 'order',
170
+ 'type' => 'dropdown',
171
+ 'def_value' => 'DESC',
172
+ 'holder' => '',
173
+ 'class' => 'order',
174
+ 'value' =>array (
175
+ 'DESC' => __('Descending', 'auxin-elements'),
176
+ 'ASC' => __('Ascending', 'auxin-elements'),
177
+ ),
178
+ 'admin_label' => false,
179
+ 'dependency' => '',
180
+ 'weight' => '',
181
+ 'group' => 'Query',
182
+ 'edit_field_class' => ''
183
+ ),
184
+ array(
185
+ 'heading' => __('Only posts','auxin-elements' ),
186
+ 'description' => __('If you intend to display ONLY specific posts, you should specify the posts here. You have to insert the post IDs that are separated by comma (eg. 53,34,87,25).', 'auxin-elements' ),
187
+ 'param_name' => 'only_posts__in',
188
+ 'type' => 'textfield',
189
+ 'value' => '',
190
+ 'holder' => '',
191
+ 'class' => '',
192
+ 'admin_label' => false,
193
+ 'dependency' => '',
194
+ 'weight' => '',
195
+ 'group' => 'Query',
196
+ 'edit_field_class' => ''
197
+ ),
198
+ array(
199
+ 'heading' => __('Include posts','auxin-elements' ),
200
+ 'description' => __('If you intend to include additional posts, you should specify the posts here. You have to insert the Post IDs that are separated by comma (eg. 53,34,87,25)', 'auxin-elements' ),
201
+ 'param_name' => 'include',
202
+ 'type' => 'textfield',
203
+ 'value' => '',
204
+ 'holder' => '',
205
+ 'class' => '',
206
+ 'admin_label' => false,
207
+ 'dependency' => '',
208
+ 'weight' => '',
209
+ 'group' => 'Query',
210
+ 'edit_field_class' => ''
211
+ ),
212
+ array(
213
+ 'heading' => __('Exclude posts','auxin-elements' ),
214
+ 'description' => __('If you intend to exclude specific posts from result, you should specify the posts here. You have to insert the Post IDs that are separated by comma (eg. 53,34,87,25)', 'auxin-elements' ),
215
+ 'param_name' => 'exclude',
216
+ 'type' => 'textfield',
217
+ 'value' => '',
218
+ 'holder' => '',
219
+ 'class' => '',
220
+ 'admin_label' => false,
221
+ 'dependency' => '',
222
+ 'weight' => '',
223
+ 'group' => 'Query',
224
+ 'edit_field_class' => ''
225
+ ),
226
+ array(
227
+ 'heading' => __('Order by', 'auxin-elements'),
228
+ 'description' => '',
229
+ 'param_name' => 'order_by',
230
+ 'type' => 'dropdown',
231
+ 'def_value' => 'date',
232
+ 'holder' => '',
233
+ 'class' => 'order_by',
234
+ 'value' => array (
235
+ 'date' => __('Date', 'auxin-elements'),
236
+ 'menu_order date' => __('Menu Order', 'auxin-elements'),
237
+ 'title' => __('Title', 'auxin-elements'),
238
+ 'ID' => __('ID', 'auxin-elements'),
239
+ 'rand' => __('Random', 'auxin-elements'),
240
+ 'comment_count' => __('Comments', 'auxin-elements'),
241
+ 'modified' => __('Date Modified', 'auxin-elements'),
242
+ 'author' => __('Author', 'auxin-elements'),
243
+ 'post__in' => __('Inserted Post IDs', 'auxin-elements')
244
+ ),
245
+ 'admin_label' => false,
246
+ 'dependency' => '',
247
+ 'weight' => '',
248
+ 'group' => 'Query',
249
+ 'edit_field_class' => ''
250
+ ),
251
+ array(
252
+ 'heading' => __('Order', 'auxin-elements'),
253
+ 'description' => '',
254
+ 'param_name' => 'order',
255
+ 'type' => 'dropdown',
256
+ 'def_value' => 'DESC',
257
+ 'holder' => '',
258
+ 'class' => 'order',
259
+ 'value' =>array (
260
+ 'DESC' => __('Descending', 'auxin-elements'),
261
+ 'ASC' => __('Ascending', 'auxin-elements'),
262
+ ),
263
+ 'admin_label' => false,
264
+ 'dependency' => '',
265
+ 'weight' => '',
266
+ 'group' => 'Query',
267
+ 'edit_field_class' => ''
268
+ ),
269
+ array(
270
+ 'heading' => __('Start offset','auxin-elements' ),
271
+ 'description' => __('Number of post to displace or pass over.', 'auxin-elements' ),
272
+ 'param_name' => 'offset',
273
+ 'type' => 'textfield',
274
+ 'value' => '',
275
+ 'holder' => '',
276
+ 'class' => '',
277
+ 'admin_label' => false,
278
+ 'dependency' => '',
279
+ 'weight' => '',
280
+ 'group' => 'Query',
281
+ 'edit_field_class' => ''
282
+ ),
283
+ array(
284
+ 'heading' => __('Post tile style','auxin-elements' ),
285
+ 'description' => '',
286
+ 'param_name' => 'tile_style',
287
+ 'type' => 'dropdown',
288
+ 'def_value' => '',
289
+ 'holder' => '',
290
+ 'class' => 'tile_style',
291
+ 'admin_label' => false,
292
+ 'dependency' => '',
293
+ 'weight' => '',
294
+ 'group' => 'Style',
295
+ 'edit_field_class' => '',
296
+ 'value' => array(
297
+ 'dark' => __('Dark', 'auxin-elements'),
298
+ 'light' => __('Light', 'auxin-elements'),
299
+ 'light-overlay' => __('Light Overlay', 'auxin-elements'),
300
+ ),
301
+ ),
302
+ array(
303
+ 'heading' => __('Button Navigation Style','auxin-elements' ),
304
+ 'description' => '',
305
+ 'param_name' => 'button_style',
306
+ 'type' => 'aux_visual_select',
307
+ 'def_value' => '',
308
+ 'holder' => '',
309
+ 'class' => 'button_style',
310
+ 'admin_label' => false,
311
+ 'dependency' => '',
312
+ 'weight' => '',
313
+ 'group' => 'Style',
314
+ 'edit_field_class' => '',
315
+ 'choices' => array(
316
+ 'pattern-1' => array(
317
+ 'label' => __('Square', 'auxin-elements' ),
318
+ 'image' => AUXIN_URL . 'images/visual-select/button-normal.svg'
319
+ ),
320
+ 'pattern-2' => array(
321
+ 'label' => __('Circle', 'auxin-elements' ),
322
+ 'image' => AUXIN_URL . 'images/visual-select/button-curved.svg'
323
+ ),
324
+ ),
325
+ ),
326
+ array(
327
+ 'heading' => __('Insert post title','auxin-elements' ),
328
+ 'description' => '',
329
+ 'param_name' => 'display_title',
330
+ 'type' => 'aux_switch',
331
+ 'value' => '1',
332
+ 'class' => 'display_title',
333
+ 'admin_label' => false,
334
+ 'dependency' => '',
335
+ 'weight' => '',
336
+ 'group' => '' ,
337
+ 'edit_field_class' => ''
338
+ ),
339
+ array(
340
+ 'heading' => __('Insert post meta','auxin-elements' ),
341
+ 'description' => '',
342
+ 'param_name' => 'show_info',
343
+ 'type' => 'aux_switch',
344
+ 'value' => '1',
345
+ 'class' => '',
346
+ 'admin_label' => false,
347
+ 'weight' => '',
348
+ 'group' => '' ,
349
+ 'edit_field_class' => ''
350
+ ),
351
+ array(
352
+ 'heading' => __('Navigation type', 'auxin-elements'),
353
+ 'description' => '',
354
+ 'param_name' => 'carousel_navigation',
355
+ 'type' => 'dropdown',
356
+ 'def_value' => 'peritem',
357
+ 'holder' => '',
358
+ 'class' => 'num',
359
+ 'value' => array(
360
+ 'peritem' => __('Move per column', 'auxin-elements'),
361
+ 'perpage' => __('Move per page', 'auxin-elements'),
362
+ 'scroll' => __('Smooth scroll', 'auxin-elements'),
363
+ ),
364
+ 'admin_label' => false,
365
+ 'dependency' => array(
366
+ 'element' => 'preview_mode',
367
+ 'value' => 'carousel'
368
+ ),
369
+ 'weight' => '',
370
+ 'group' => 'Carousel',
371
+ 'edit_field_class' => ''
372
+ ),
373
+ array(
374
+ 'heading' => __('Navigation control', 'auxin-elements'),
375
+ 'description' => '',
376
+ 'param_name' => 'carousel_navigation_control',
377
+ 'type' => 'dropdown',
378
+ 'def_value' => 'arrows',
379
+ 'holder' => '',
380
+ 'class' => 'num',
381
+ 'value' => array(
382
+ 'arrows' => __('Arrows', 'auxin-elements'),
383
+ 'bullets' => __('Bullets', 'auxin-elements'),
384
+ '' => __('None', 'auxin-elements'),
385
+ ),
386
+ 'dependency' => array(
387
+ 'element' => 'preview_mode',
388
+ 'value' => 'carousel'
389
+ ),
390
+ 'weight' => '',
391
+ 'admin_label' => false,
392
+ 'group' => 'Carousel',
393
+ 'edit_field_class' => ''
394
+ ),
395
+ array(
396
+ 'heading' => __('Loop navigation','auxin-elements' ),
397
+ 'description' => '',
398
+ 'param_name' => 'carousel_loop',
399
+ 'type' => 'aux_switch',
400
+ 'value' => '1',
401
+ 'class' => '',
402
+ 'dependency' => array(
403
+ 'element' => 'preview_mode',
404
+ 'value' => 'carousel'
405
+ ),
406
+ 'weight' => '',
407
+ 'group' => 'Carousel',
408
+ 'edit_field_class' => ''
409
+ ),
410
+ array(
411
+ 'heading' => __('Autoplay carousel','auxin-elements' ),
412
+ 'description' => '',
413
+ 'param_name' => 'carousel_autoplay',
414
+ 'type' => 'aux_switch',
415
+ 'value' => '0',
416
+ 'class' => '',
417
+ 'admin_label' => false,
418
+ 'dependency' => array(
419
+ 'element' => 'preview_mode',
420
+ 'value' => 'carousel'
421
+ ),
422
+ 'weight' => '',
423
+ 'group' => 'Carousel',
424
+ 'edit_field_class' => ''
425
+ ),
426
+ array(
427
+ 'heading' => __('Autoplay delay','auxin-elements' ),
428
+ 'description' => __('Specifies the delay between auto-forwarding in seconds.', 'auxin-elements' ),
429
+ 'param_name' => 'carousel_autoplay_delay',
430
+ 'type' => 'textfield',
431
+ 'value' => '2',
432
+ 'holder' => '',
433
+ 'class' => 'excerpt_len',
434
+ 'admin_label' => false,
435
+ 'dependency' => array(
436
+ 'element' => 'preview_mode',
437
+ 'value' => 'carousel'
438
+ ),
439
+ 'weight' => '',
440
+ 'group' => 'Carousel',
441
+ 'edit_field_class' => ''
442
+ ),
443
+ array(
444
+ 'heading' => __('Extra class name','auxin-elements' ),
445
+ 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'auxin-elements' ),
446
+ 'param_name' => 'extra_classes',
447
+ 'type' => 'textfield',
448
+ 'value' => '',
449
+ 'holder' => '',
450
+ 'class' => 'extra_classes',
451
+ 'admin_label' => false,
452
+ 'dependency' => '',
453
+ 'weight' => '',
454
+ 'group' => '',
455
+ 'edit_field_class' => ''
456
+ )
457
+ )
458
+ );
459
+
460
+ return $master_array;
461
+ }
462
+
463
+ add_filter( 'auxin_master_array_shortcodes', 'auxin_get_recent_posts_tiles_carousel_master_array', 10, 1 );
464
+
465
+
466
+
467
+
468
+ /**
469
+ * Element without loop and column
470
+ * The front-end output of this element is returned by the following function
471
+ *
472
+ * @param array $atts The array containing the parsed values from shortcode, it should be same as defined params above.
473
+ * @param string $shortcode_content The shorcode content
474
+ * @return string The output of element markup
475
+ */
476
+ function auxin_widget_recent_posts_tiles_carousel_callback( $atts, $shortcode_content = null ){
477
+
478
+ global $aux_content_width;
479
+
480
+ // Defining default attributes
481
+ $default_atts = array(
482
+ 'title' => '', // header title
483
+ 'cat' => ' ',
484
+ 'num' => '5', // max generated entry
485
+ 'only_posts__in' => '', // display only these post IDs. array or string comma separated
486
+ 'include' => '', // include these post IDs in result too. array or string comma separated
487
+ 'exclude' => '', // exclude these post IDs from result. array or string comma separated
488
+ 'posts_per_page' => -1,
489
+ 'offset' => '',
490
+ 'paged' => '',
491
+ 'order_by' => 'date',
492
+ 'order' => 'DESC',
493
+ 'excerpt_len' => '160',
494
+ 'exclude_without_media' => true,
495
+ 'exclude_custom_post_formats' => true,
496
+ 'page' => '2',
497
+ 'exclude_quote_link' => true,
498
+ 'exclude_post_formats_in' => array(), // the list od post formats to exclude
499
+ 'tile_style' => 'light',
500
+ 'button_style' => 'pattern-1',
501
+ 'display_title' => true,
502
+ 'show_info' => true,
503
+ 'extra_classes' => '',
504
+ 'extra_column_classes' => '',
505
+ 'custom_el_id' => '',
506
+ 'template_part_file' => 'theme-parts/entry/post-tile',
507
+ 'extra_template_path' => '',
508
+ 'universal_id' => '',
509
+ 'reset_query' => true,
510
+ 'carousel_autoplay' => false,
511
+ 'carousel_navigation' => 'peritem',
512
+ 'carousel_navigation_control' => 'arrows',
513
+ 'carousel_loop' => 1,
514
+ 'use_wp_query' => false, // true to use the global wp_query, false to use internal custom query
515
+ 'wp_query_args' => array(), // additional wp_query args
516
+ 'loadmore_type' => '', // 'next' (more button), 'scroll', 'next-prev'
517
+ 'loadmore_per_page' => '',
518
+ 'base' => 'aux_recent_posts_tiles_carousel',
519
+ 'base_class' => 'aux-widget-recent-posts-tiles aux-carousel'
520
+ );
521
+
522
+ $result = auxin_get_widget_scafold( $atts, $default_atts, $shortcode_content );
523
+ extract( $result['parsed_atts'] );
524
+
525
+ // specify the post formats that should be excluded -------
526
+ $exclude_post_formats_in = (array) $exclude_post_formats_in;
527
+
528
+ if( $exclude_custom_post_formats ){
529
+ $exclude_post_formats_in = array_merge( $exclude_post_formats_in, array( 'aside', 'gallery', 'image', 'link', 'quote', 'video', 'audio' ) );
530
+ }
531
+ if( $exclude_quote_link ){
532
+ $exclude_post_formats_in[] = 'quote';
533
+ $exclude_post_formats_in[] = 'link';
534
+ }
535
+ $exclude_post_formats_in = array_unique( $exclude_post_formats_in );
536
+
537
+ // --------------
538
+
539
+ ob_start();
540
+
541
+ global $wp_query;
542
+
543
+ if( ! $use_wp_query ){
544
+
545
+ // create wp_query to get latest items -----------
546
+ $args = array(
547
+ 'post_type' => 'post',
548
+ 'orderby' => $order_by,
549
+ 'order' => $order,
550
+ 'offset' => $offset,
551
+ 'cat' => $cat,
552
+ 'post_status' => 'publish',
553
+ 'posts_per_page' => $num * $page,
554
+ 'ignore_sticky_posts' => 1,
555
+ 'include_posts__in' => $include, // include posts in this liat
556
+ 'posts__not_in' => $exclude, // exclude posts in this list
557
+ 'posts__in' => $only_posts__in, // only posts in this list
558
+
559
+ 'exclude_without_media' => $exclude_without_media,
560
+ 'exclude_post_formats_in' => $exclude_post_formats_in
561
+ );
562
+
563
+ // ---------------------------------------------------------------------
564
+
565
+ // add the additional query args if available
566
+ if( $wp_query_args ){
567
+ $args = wp_parse_args( $args, $wp_query_args );
568
+ }
569
+
570
+ // pass the args through the auxin query parser
571
+ $wp_query = new WP_Query( auxin_parse_query_args( $args ) );
572
+ }
573
+
574
+ // widget header ------------------------------
575
+ echo $result['widget_header'];
576
+ echo $result['widget_title'];
577
+
578
+ $tile_style = 'aux-tile-' . esc_attr( $tile_style ) . ' ';
579
+ $phone_break_point = 767;
580
+ $tablet_break_point = 992;
581
+
582
+ $show_comments = true; // shows comments icon
583
+ $post_counter = 0;
584
+ $item_class = 'aux-post-tile aux-image-box';
585
+
586
+ if( ! empty( $loadmore_type ) ) {
587
+ $item_class .= ' aux-ajax-item';
588
+ }
589
+
590
+ $container_class = 'master-carousel aux-no-js aux-mc-before-init ' . $tile_style;
591
+ // genereate the master carousel attributes
592
+ $carousel_attrs = 'data-columns="1"';
593
+ $carousel_attrs .= ' data-autoplay="'. esc_attr( $carousel_autoplay ) .'"';
594
+ $carousel_attrs .= ' data-navigation="' . esc_attr( $carousel_navigation ) . '"';
595
+ $carousel_attrs .= ' data-loop="' . esc_attr( $carousel_loop ) . '"';
596
+ $carousel_attrs .= ' data-wrap-controls="true"';
597
+ $carousel_attrs .= ' data-bullets="' . ('bullets' == $carousel_navigation_control ? 'true' : 'false') . '"';
598
+ $carousel_attrs .= ' data-bullet-class="aux-bullets aux-small aux-mask"';
599
+ $carousel_attrs .= ' data-arrows="' . ('arrows' == $carousel_navigation_control ? 'true' : 'false') . '"';
600
+ $carousel_attrs .= ' data-same-height="true"';
601
+ $column_media_width = auxin_get_content_column_width( 4, 0 );
602
+
603
+ $have_posts = $wp_query->have_posts();
604
+
605
+ if( $have_posts ){
606
+
607
+
608
+ echo ! $skip_wrappers ? sprintf( '<div data-element-id="%s" class="%s" %s>', esc_attr( $universal_id ), esc_attr( $container_class ), $carousel_attrs ) : '';
609
+
610
+ while ( $wp_query->have_posts() ) {
611
+ $item_pattern_info = auxin_get_tile_pattern( 'default', $post_counter, $column_media_width );
612
+
613
+ $post_counter++;
614
+
615
+ if ( ( $post_counter % $num ) == 1 ){
616
+ echo '<div class="aux-mc-item aux-tiles-layout">';
617
+ }
618
+
619
+
620
+ $wp_query->the_post();
621
+ $post = $wp_query->post;
622
+
623
+
624
+ $post_vars = auxin_get_post_format_media(
625
+ $post,
626
+ array(
627
+ 'request_from' => 'archive',
628
+ 'media_width' => $phone_break_point,
629
+ 'media_size' => 'large',
630
+ 'upscale_image' => true,
631
+ 'image_from_content' => ! $exclude_without_media,
632
+ 'ignore_formats' => array( '*' ),
633
+ 'image_sizes' => $item_pattern_info['image_sizes'],
634
+ 'srcset_sizes' => $item_pattern_info['srcset_sizes']
635
+ )
636
+ );
637
+
638
+ extract( $post_vars );
639
+
640
+ $post_classes = $item_class .' post '. $item_pattern_info['classname'];
641
+
642
+ $the_format = get_post_format( $post );
643
+
644
+ include auxin_get_template_file( $template_part_file, '', $extra_template_path );
645
+
646
+ if ( ( $post_counter % $num ) == 0 ){
647
+ $post_counter = 0;
648
+ echo '</div>';
649
+ }
650
+
651
+ }
652
+ if ( $page != 1) {
653
+ ?>
654
+ <div class="aux-carousel-controls">
655
+ <?php if ( $button_style === 'pattern-1' ) { ?>
656
+ <div class="aux-next-arrow aux-arrow-nav aux-outline aux-hover-fill">
657
+ <span class="aux-svg-arrow aux-small-right"></span>
658
+ <span class="aux-hover-arrow aux-white aux-svg-arrow aux-small-right"></span>
659
+ </div>
660
+ <div class="aux-prev-arrow aux-arrow-nav aux-outline aux-hover-fill">
661
+ <span class="aux-svg-arrow aux-small-left"></span>
662
+ <span class="aux-hover-arrow aux-white aux-svg-arrow aux-small-left"></span>
663
+ </div>
664
+ <?php } else { ?>
665
+ <div class="aux-next-arrow aux-arrow-nav aux-hover-slide aux-round aux-outline aux-medium">
666
+ <span class="aux-overlay"></span>
667
+ <span class="aux-svg-arrow aux-medium-right"></span>
668
+ <span class="aux-hover-arrow aux-svg-arrow aux-medium-right aux-white"></span>
669
+ </div>
670
+ <div class="aux-prev-arrow aux-arrow-nav aux-hover-slide aux-round aux-outline aux-medium">
671
+ <span class="aux-overlay"></span>
672
+ <span class="aux-svg-arrow aux-medium-left"></span>
673
+ <span class="aux-hover-arrow aux-svg-arrow aux-medium-left aux-white"></span>
674
+ </div>
675
+ <?php } ?>
676
+ </div>
677
+
678
+ <?php
679
+ }
680
+
681
+ if( ! $skip_wrappers ) {
682
+ // End tag for aux-ajax-view wrapper & Execute load more functionality
683
+ echo '</div>' . auxin_get_load_more_controller( $loadmore_type );
684
+
685
+ } else {
686
+ // Get post counter in the query
687
+ echo '<span class="aux-post-count hidden">'.$wp_query->post_count.'</span>';
688
+ }
689
+ }
690
+
691
+ if( $reset_query ){
692
+ wp_reset_query();
693
+ }
694
+
695
+ // return false if no result found
696
+ if( ! $have_posts ){
697
+ ob_get_clean();
698
+ return false;
699
+ }
700
+
701
+ // widget footer ------------------------------
702
+ echo $result['widget_footer'];
703
+
704
+ return ob_get_clean();
705
+ }
706
+
707
+
includes/general-functions.php CHANGED
@@ -1451,7 +1451,12 @@ if ( ! function_exists( 'auxin_get_gmap_style' ) ) {
1451
  }
1452
  }
1453
 
1454
-
 
 
 
 
 
1455
  function auxin_get_header_button( $button_id_num = 1 ){
1456
 
1457
  if( empty( $button_id_num ) || ! is_numeric( $button_id_num ) ){
@@ -1461,22 +1466,116 @@ function auxin_get_header_button( $button_id_num = 1 ){
1461
  return '';
1462
  }
1463
 
1464
- return auxin_widget_button_callback(
1465
- array(
1466
- 'label' => auxin_get_option( 'site_header_btn'. $button_id_num .'_label' ),
1467
- 'size' => auxin_get_option( 'site_header_btn'. $button_id_num .'_size', 'large' ),
1468
- 'border' => auxin_get_option( 'site_header_btn'. $button_id_num .'_shape' ),
1469
- 'style' => auxin_get_option( 'site_header_btn'. $button_id_num .'_style' ),
1470
- 'dark' => auxin_get_option( 'site_header_btn'. $button_id_num .'_darken', 0 ),
1471
- 'icon' => auxin_get_option( 'site_header_btn'. $button_id_num .'_icon' ),
1472
- 'icon_align' => auxin_get_option( 'site_header_btn'. $button_id_num .'_icon_align' ),
1473
- 'color_name' => auxin_get_option( 'site_header_btn'. $button_id_num .'_color_name' ),
1474
- 'link' => auxin_get_option( 'site_header_btn'. $button_id_num .'_link', "#" ),
1475
- 'target' => auxin_get_option( 'site_header_btn'. $button_id_num .'_target' ),
1476
- 'uppercase' => '0',
1477
- 'extra_classes' => 'aux-ac-btn'. $button_id_num
1478
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1479
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1480
  }
1481
 
1482
 
@@ -1530,3 +1629,20 @@ function auxin_find_all_files( $dir, $recursive = true ){
1530
  return $result;
1531
  }
1532
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1451
  }
1452
  }
1453
 
1454
+ /**
1455
+ * Retrieves markup for a header button
1456
+ *
1457
+ * @param $button_id_num The ID of the header button (1 or 2)
1458
+ * @return string
1459
+ */
1460
  function auxin_get_header_button( $button_id_num = 1 ){
1461
 
1462
  if( empty( $button_id_num ) || ! is_numeric( $button_id_num ) ){
1466
  return '';
1467
  }
1468
 
1469
+ $btn_args = apply_filters( 'auxin_header_button_args', array(
1470
+ 'label' => auxin_get_option( 'site_header_btn'. $button_id_num .'_label' ),
1471
+ 'size' => auxin_get_option( 'site_header_btn'. $button_id_num .'_size', 'large' ),
1472
+ 'border' => auxin_get_option( 'site_header_btn'. $button_id_num .'_shape' ),
1473
+ 'style' => auxin_get_option( 'site_header_btn'. $button_id_num .'_style' ),
1474
+ 'dark' => auxin_get_option( 'site_header_btn'. $button_id_num .'_darken', 0 ),
1475
+ 'icon' => auxin_get_option( 'site_header_btn'. $button_id_num .'_icon' ),
1476
+ 'icon_align' => auxin_get_option( 'site_header_btn'. $button_id_num .'_icon_align' ),
1477
+ 'color_name' => auxin_get_option( 'site_header_btn'. $button_id_num .'_color_name' ),
1478
+ 'link' => auxin_get_option( 'site_header_btn'. $button_id_num .'_link', "#" ),
1479
+ 'target' => auxin_get_option( 'site_header_btn'. $button_id_num .'_target' ),
1480
+ 'btn_attrs' => sprintf( 'data-colorname-default{%s};data-colorname-sticky{%s}',
1481
+ auxin_get_option( 'site_header_btn'. $button_id_num .'_color_name' ),
1482
+ auxin_get_option( 'site_header_btn'. $button_id_num .'_color_name_on_sticky' )
1483
+ ),
1484
+ 'uppercase' => '0',
1485
+ 'extra_classes' => 'aux-ac-btn'. $button_id_num
1486
+ ), $button_id_num );
1487
+
1488
+ return auxin_widget_button_callback( $btn_args );
1489
+ }
1490
+
1491
+
1492
+ /**
1493
+ * Returns the second custom logo, linked to home.
1494
+ *
1495
+ * @param integer $blog_id The site id on multisite
1496
+ * @return string Markup for second custom logo.
1497
+ */
1498
+ function auxin_get_custom_logo2( $blog_id = 0, $args = array() ) {
1499
+
1500
+ $defaults = array(
1501
+ 'anchor_extra_classes' => 'aux-middle aux-logo-sticky',
1502
+ 'image_extra_classes' => 'aux-logo-light'
1503
  );
1504
+
1505
+ $args = wp_parse_args( $args, $defaults );
1506
+
1507
+ $html = '';
1508
+ $switched_blog = false;
1509
+
1510
+ if ( is_multisite() && ! empty( $blog_id ) && (int) $blog_id !== get_current_blog_id() ) {
1511
+ switch_to_blog( $blog_id );
1512
+ $switched_blog = true;
1513
+ }
1514
+
1515
+ $custom_logo_id = auxin_get_option('custom_logo2');
1516
+
1517
+ // We have a logo. Logo is go.
1518
+ if ( $custom_logo_id ) {
1519
+ $custom_logo_attr = array(
1520
+ 'class' => 'custom-logo aux-logo-image aux-logo-image2 '. $args['image_extra_classes'],
1521
+ 'itemprop' => 'logo',
1522
+ );
1523
+
1524
+ /*
1525
+ * If the logo alt attribute is empty, get the site title and explicitly
1526
+ * pass it to the attributes used by wp_get_attachment_image().
1527
+ */
1528
+ $image_alt = get_post_meta( $custom_logo_id, '_wp_attachment_image_alt', true );
1529
+ if ( empty( $image_alt ) ) {
1530
+ $custom_logo_attr['alt'] = get_bloginfo( 'name', 'display' );
1531
+ }
1532
+
1533
+ /*
1534
+ * If the alt attribute is not empty, there's no need to explicitly pass
1535
+ * it because wp_get_attachment_image() already adds the alt attribute.
1536
+ */
1537
+ $html = sprintf( '<a href="%1$s" class="custom-logo-link aux-logo-anchor aux-logo-anchor2 aux-has-logo %2$s" rel="home" itemprop="url">%3$s</a>',
1538
+ esc_url( home_url( '/' ) ),
1539
+ esc_attr( $args['anchor_extra_classes'] ),
1540
+ wp_get_attachment_image( $custom_logo_id, 'full', false, $custom_logo_attr )
1541
+ );
1542
+ }
1543
+
1544
+ if ( $switched_blog ) {
1545
+ restore_current_blog();
1546
+ }
1547
+
1548
+ /**
1549
+ * Filters the custom logo output.
1550
+ *
1551
+ * @param string $html Custom logo HTML output.
1552
+ * @param int $blog_id ID of the blog to get the custom logo for.
1553
+ */
1554
+ return apply_filters( 'auxin_get_custom_logo2', $html, $blog_id );
1555
+ }
1556
+
1557
+
1558
+ /**
1559
+ * Determines whether the site has the second custom logo.
1560
+ *
1561
+ * @param integer $blog_id The site id on multisite
1562
+ * @return bool Whether the site has the custom logo or not.
1563
+ */
1564
+ function auxin_has_custom_logo2( $blog_id = 0 ) {
1565
+ $switched_blog = false;
1566
+
1567
+ if ( is_multisite() && ! empty( $blog_id ) && (int) $blog_id !== get_current_blog_id() ) {
1568
+ switch_to_blog( $blog_id );
1569
+ $switched_blog = true;
1570
+ }
1571
+
1572
+ $custom_logo_id = get_theme_mod( 'custom_logo2' );
1573
+
1574
+ if ( $switched_blog ) {
1575
+ restore_current_blog();
1576
+ }
1577
+
1578
+ return (bool) $custom_logo_id;
1579
  }
1580
 
1581
 
1629
  return $result;
1630
  }
1631
 
1632
+ /**
1633
+ * Flattern an array
1634
+ * Used for flattern grouped data in SiteOrigin widgets
1635
+ * @param array $keys Keys that we need to extract and merge with main array
1636
+ * @param array $array The array that we need to flatten
1637
+ * @return array
1638
+ */
1639
+ function auxin_flatten_array( $keys = array(), $arr = array() ) {
1640
+ foreach ( $keys as $key ) {
1641
+ if ( isset( $arr[$key] ) ) {
1642
+ $temp = $arr[$key];
1643
+ unset($arr[$key]);
1644
+ $arr = array_merge( $arr, $temp );
1645
+ }
1646
+ }
1647
+ return $arr;
1648
+ }
includes/general-hooks.php CHANGED
@@ -505,7 +505,7 @@ function auxin_add_theme_options_in_plugin( $fields_sections_list ){
505
  );
506
 
507
  $fields_sections_list['fields'][] = array(
508
- 'title' => __('Google analytics code', 'auxin-elements'),
509
  'description' => sprintf( __('You can add your Google analytics code here.%s DO NOT use %s tag.', 'auxin-elements'), '<br />' , '<code>&lt;script&gt;</code>' ),
510
  'id' => 'auxin_user_google_analytics',
511
  'section' => 'general-section-seo',
@@ -518,7 +518,7 @@ function auxin_add_theme_options_in_plugin( $fields_sections_list ){
518
  );
519
 
520
  $fields_sections_list['fields'][] = array(
521
- 'title' => __('Google maps API key', 'auxin-elements'),
522
  'description' => sprintf(
523
  __( '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' ),
524
  '<a href="https://developers.google.com/maps/documentation/javascript/" target="_blank">',
@@ -534,7 +534,7 @@ function auxin_add_theme_options_in_plugin( $fields_sections_list ){
534
  );
535
 
536
  $fields_sections_list['fields'][] = array(
537
- 'title' => __('Google marketing code', 'auxin-elements'),
538
  'description' => sprintf( __('You can add your Google marketing code here.%s DO NOT use %s tag.', 'auxin-elements'), '<br />' , '<code>&lt;script&gt;</code>' ),
539
  'id' => 'auxin_user_google_marketing',
540
  'section' => 'general-section-seo',
@@ -546,16 +546,22 @@ function auxin_add_theme_options_in_plugin( $fields_sections_list ){
546
  'type' => 'code'
547
  );
548
 
 
549
 
550
 
 
551
 
552
-
553
-
554
-
555
-
556
-
557
-
558
-
 
 
 
 
559
 
560
 
561
  // Sub section - Button 1 in header -------------------------------
@@ -568,7 +574,7 @@ function auxin_add_theme_options_in_plugin( $fields_sections_list ){
568
  );
569
 
570
  $fields_sections_list['fields'][] = array(
571
- 'title' => __('Display Button 1 Header?','auxin-elements' ),
572
  'description' => __('Enable this option to display a button in header.','auxin-elements' ),
573
  'section' => 'header-section-action-button1',
574
  'id' => 'site_header_show_btn1',
@@ -582,7 +588,7 @@ function auxin_add_theme_options_in_plugin( $fields_sections_list ){
582
  );
583
 
584
  $fields_sections_list['fields'][] = array(
585
- 'title' => __('Button label','auxin-elements' ),
586
  'description' => __('Specifies the label of button.','auxin-elements' ),
587
  'section' => 'header-section-action-button1',
588
  'id' => 'site_header_btn1_label',
@@ -600,7 +606,7 @@ function auxin_add_theme_options_in_plugin( $fields_sections_list ){
600
  );
601
 
602
  $fields_sections_list['fields'][] = array(
603
- 'title' => __('Button size','auxin-elements' ),
604
  'description' => '',
605
  'section' => 'header-section-action-button1',
606
  'id' => 'site_header_btn1_size',
@@ -625,7 +631,7 @@ function auxin_add_theme_options_in_plugin( $fields_sections_list ){
625
  );
626
 
627
  $fields_sections_list['fields'][] = array(
628
- 'title' => __('Button shape','auxin-elements' ),
629
  'description' => '',
630
  'section' => 'header-section-action-button1',
631
  'id' => 'site_header_btn1_shape',
@@ -657,7 +663,7 @@ function auxin_add_theme_options_in_plugin( $fields_sections_list ){
657
  );
658
 
659
  $fields_sections_list['fields'][] = array(
660
- 'title' => __('Button style','auxin-elements' ),
661
  'description' => '',
662
  'section' => 'header-section-action-button1',
663
  'id' => 'site_header_btn1_style',
@@ -689,25 +695,7 @@ function auxin_add_theme_options_in_plugin( $fields_sections_list ){
689
  );
690
 
691
  $fields_sections_list['fields'][] = array(
692
- 'title' => __('Darken the label','auxin-elements' ),
693
- 'description' => __('Darken label of button.','auxin-elements' ),
694
- 'section' => 'header-section-action-button1',
695
- 'id' => 'site_header_btn1_darken',
696
- 'type' => 'switch',
697
- 'default' => '0',
698
- 'dependency' => array(
699
- array(
700
- 'id' => 'site_header_show_btn1',
701
- 'value' => '1',
702
- 'operator'=> '=='
703
- )
704
- ),
705
- 'transport' => 'postMessage',
706
- 'post_js' => '$(".aux-btn1-box .aux-ac-btn1").toggleClass( "aux-dark-text", to );'
707
- );
708
-
709
- $fields_sections_list['fields'][] = array(
710
- 'title' => __('Icon for button','auxin-elements' ),
711
  'description' => '',
712
  'section' => 'header-section-action-button1',
713
  'id' => 'site_header_btn1_icon',
@@ -724,7 +712,7 @@ function auxin_add_theme_options_in_plugin( $fields_sections_list ){
724
  );
725
 
726
  $fields_sections_list['fields'][] = array(
727
- 'title' => __('Icon alignment','auxin-elements' ),
728
  'description' => '',
729
  'section' => 'header-section-action-button1',
730
  'id' => 'site_header_btn1_icon_align',
@@ -768,7 +756,7 @@ function auxin_add_theme_options_in_plugin( $fields_sections_list ){
768
  );
769
 
770
  $fields_sections_list['fields'][] = array(