Version Description
Download this release
Release Info
Developer | averta |
Plugin | Shortcodes and extra features for Phlox theme |
Version | 1.3.6 |
Comparing to | |
See all releases |
Code changes from version 1.3.3 to 1.3.6
- README.txt +7 -4
- admin/class-auxels-admin.php +25 -27
- admin/includes/admin-hooks.php +92 -0
- admin/includes/admin-the-functions.php +42 -1
- admin/includes/compatibility/siteorigin/fields/iconpicker.class.php +2 -2
- admin/includes/index.php +12 -3
- admin/includes/metaboxes/metabox-fields-post-audio.php +9 -9
- admin/includes/metaboxes/metabox-fields-post-gallery.php +2 -2
- admin/includes/metaboxes/metabox-fields-post-quote.php +5 -5
- admin/includes/metaboxes/metabox-fields-post-video.php +12 -12
- auxin-elements.php +60 -33
- function.php +38 -0
- includes/classes/class-auxels-admin-assets.php +47 -0
- includes/classes/class-auxels-import-parser.php +312 -0
- includes/classes/class-auxels-import.php +155 -0
- includes/classes/class-auxin-admin-dashboard.php +61 -0
- includes/classes/class-auxin-import.php +215 -0
- includes/classes/class-auxin-install.php +109 -0
- includes/classes/class-auxin-master-nav-menu-admin.php +157 -0
- includes/classes/class-auxin-permalink.php +268 -0
- includes/classes/class-auxin-plugin-requirements.php +297 -0
- includes/classes/class-auxin-post-type-base.php +120 -0
- includes/classes/class-auxin-siteorigin-widget.php +1 -1
- includes/classes/class-auxin-walker-nav-menu-back.php +384 -0
- includes/classes/class-auxin-widget-indie.php +119 -0
- includes/classes/class-auxin-widget-shortcode-map.php +47 -25
- includes/classes/class-auxin-widget.php +476 -0
- includes/define.php +1 -1
- includes/elements/accordion.php +4 -0
- includes/elements/audio.php +19 -21
- includes/elements/before-after.php +6 -21
- includes/elements/button.php +55 -46
- includes/elements/code.php +31 -23
- includes/elements/contact-box.php +52 -48
- includes/elements/contact-form.php +11 -16
- includes/elements/divider.php +10 -13
- includes/elements/dropcap.php +28 -32
- includes/elements/flickr.php +1 -1
- includes/elements/gallery.php +41 -41
- includes/elements/gmap.php +31 -35
- includes/elements/latest-posts-slider.php +63 -49
- includes/elements/quote.php +11 -29
- includes/elements/recent-posts-grid-carousel.php +290 -298
- includes/elements/recent-posts-land-style.php +143 -163
- includes/elements/recent-posts-masonry.php +137 -160
- includes/elements/recent-posts-tiles.php +153 -123
- includes/elements/recent-posts-timeline.php +145 -148
- includes/elements/search.php +3 -5
- includes/elements/socials-list.php +10 -10
- includes/elements/tabs.php +4 -0
- includes/elements/text.php +3 -3
- includes/elements/touch-slider.php +30 -41
- includes/elements/video.php +29 -38
- includes/general-functions.php +871 -0
- includes/general-hooks.php +333 -21
- includes/index.php +8 -3
- public/assets/js/gmaps.min.js +2 -0
- public/class-auxels.php +69 -29
- public/includes/class-auxels-frontend-assets.php +13 -11
- public/templates/vcomposer/vc_row.php +86 -35
README.txt
CHANGED
@@ -5,8 +5,8 @@ License: GPLv3
|
|
5 |
License URI: http://www.gnu.org/licenses/gpl.html
|
6 |
Tags: banner SEO, shortcode, page-builder, siteorigin, auxin, framework, widget, element, phlox, averta, fullwidth, masonry, timeline
|
7 |
Requires at least: 4.4
|
8 |
-
Tested up to: 4.7.
|
9 |
-
Stable tag: 1.3.
|
10 |
License: GPLv3
|
11 |
License URI: http://www.gnu.org/licenses/gpl.html
|
12 |
|
@@ -140,6 +140,9 @@ Bugs can be reported in our [support forums](http://wordpress.org/tags/auxin-ele
|
|
140 |
|
141 |
== Changelog ==
|
142 |
|
|
|
|
|
|
|
143 |
= Version 1.3.2 / (15.01.2017) =
|
144 |
- [Improvement]: New option for defining google map api key added
|
145 |
|
@@ -191,5 +194,5 @@ Bugs can be reported in our [support forums](http://wordpress.org/tags/auxin-ele
|
|
191 |
|
192 |
== Upgrade Notice ==
|
193 |
|
194 |
-
= 1.3.
|
195 |
-
- [Improvement]: New
|
5 |
License URI: http://www.gnu.org/licenses/gpl.html
|
6 |
Tags: banner SEO, shortcode, page-builder, siteorigin, auxin, framework, widget, element, phlox, averta, fullwidth, masonry, timeline
|
7 |
Requires at least: 4.4
|
8 |
+
Tested up to: 4.7.3
|
9 |
+
Stable tag: 1.3.6
|
10 |
License: GPLv3
|
11 |
License URI: http://www.gnu.org/licenses/gpl.html
|
12 |
|
140 |
|
141 |
== Changelog ==
|
142 |
|
143 |
+
= Version 1.3.6 / (01.05.2017) =
|
144 |
+
- [Improvement]: New changes for auxin framework applied
|
145 |
+
|
146 |
= Version 1.3.2 / (15.01.2017) =
|
147 |
- [Improvement]: New option for defining google map api key added
|
148 |
|
194 |
|
195 |
== Upgrade Notice ==
|
196 |
|
197 |
+
= 1.3.6 =
|
198 |
+
- [Improvement]: New changes for auxin framework applied
|
admin/class-auxels-admin.php
CHANGED
@@ -26,39 +26,37 @@ class AUXELS_Admin {
|
|
26 |
*/
|
27 |
protected static $instance = null;
|
28 |
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
|
38 |
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
-
|
41 |
-
|
42 |
-
*
|
43 |
-
* @since 1.0.0
|
44 |
-
*/
|
45 |
-
private function __construct() {
|
46 |
-
|
47 |
-
// include admin files
|
48 |
-
$this->includes();
|
49 |
|
50 |
$this->enqueue_admin_scripts();
|
51 |
-
|
52 |
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
|
63 |
|
64 |
|
@@ -93,7 +91,7 @@ class AUXELS_Admin {
|
|
93 |
*/
|
94 |
public function enqueue_admin_scripts() {
|
95 |
|
96 |
-
$admin_assets = new
|
97 |
|
98 |
if ( ! isset( $this->screen_hook_suffix ) )
|
99 |
return;
|
26 |
*/
|
27 |
protected static $instance = null;
|
28 |
|
29 |
+
/**
|
30 |
+
* Slug of the plugin screen.
|
31 |
+
*
|
32 |
+
* @since 1.0.0
|
33 |
+
*
|
34 |
+
* @var string
|
35 |
+
*/
|
36 |
+
protected $screen_hook_suffix = null;
|
37 |
|
38 |
|
39 |
+
/**
|
40 |
+
* Initialize the plugin by loading admin classes and functions
|
41 |
+
*
|
42 |
+
*/
|
43 |
+
private function __construct() {
|
44 |
|
45 |
+
// include admin files
|
46 |
+
$this->includes();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
$this->enqueue_admin_scripts();
|
49 |
+
}
|
50 |
|
51 |
|
52 |
+
/**
|
53 |
+
* Include admin essential classes and functions
|
54 |
+
*
|
55 |
+
* @return void
|
56 |
+
*/
|
57 |
+
private function includes(){
|
58 |
+
include_once( AUXELS_ADMIN_DIR . '/includes/index.php' );
|
59 |
+
}
|
60 |
|
61 |
|
62 |
|
91 |
*/
|
92 |
public function enqueue_admin_scripts() {
|
93 |
|
94 |
+
$admin_assets = new Auxels_Admin_Assets();
|
95 |
|
96 |
if ( ! isset( $this->screen_hook_suffix ) )
|
97 |
return;
|
admin/includes/admin-hooks.php
CHANGED
@@ -47,6 +47,52 @@ function auxin_register_mce_buttons_style(){
|
|
47 |
add_action('admin_enqueue_scripts', 'auxin_register_mce_buttons_style');
|
48 |
|
49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
/*-----------------------------------------------------------------------------------*/
|
51 |
/* Adds system status tab in theme about (welcome) page
|
52 |
/*-----------------------------------------------------------------------------------*/
|
@@ -202,8 +248,54 @@ add_filter( 'auxin_metabox_fields', 'auxin_add_metabox_field_to_advanced_setting
|
|
202 |
|
203 |
|
204 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
205 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
|
|
|
207 |
|
208 |
/*======================================================================*/
|
209 |
|
47 |
add_action('admin_enqueue_scripts', 'auxin_register_mce_buttons_style');
|
48 |
|
49 |
|
50 |
+
|
51 |
+
/*-----------------------------------------------------------------------------------*/
|
52 |
+
/* Adds demos tab in theme about (welcome) page
|
53 |
+
/*-----------------------------------------------------------------------------------*/
|
54 |
+
|
55 |
+
function auxin_welcome_page_display_section_demos(){
|
56 |
+
// all the demos information should add into this array
|
57 |
+
$demos_list = auxin_get_demo_info_list();
|
58 |
+
|
59 |
+
if( ! empty( $demos_list ) ){
|
60 |
+
$wpnonce = wp_create_nonce( 'auxin-import' );
|
61 |
+
?>
|
62 |
+
<h2 class="aux-featur"><?php _e('Choose the demo you want.', THEME_DOMAIN); ?></h2>
|
63 |
+
<h4 class="aux-featur demos-subtitle"><?php _e('Please note that, it is recommended to import a demo on a clean WordPress installation.', THEME_DOMAIN); ?></h4>
|
64 |
+
<div class="changelog feature-section three-col">
|
65 |
+
<?php
|
66 |
+
foreach( $demos_list as $demo_id => $demo_info ){
|
67 |
+
?>
|
68 |
+
<div class="col" id="<?php echo esc_attr( $demo_info['id'] ); ?>">
|
69 |
+
<img class="demos-img" src="<?php echo esc_attr( $demo_info['thumb_url'] ); ?>" alt="<?php echo esc_attr( $demo_info['title'] ); ?>">
|
70 |
+
<h3><?php echo $demo_info['title']; ?></h3>
|
71 |
+
<p><?php echo $demo_info['desc' ]; ?></p>
|
72 |
+
<a href="<?php echo esc_url( $demo_info['preview_url'] ); ?>" class="button button-primary aux-button" target="_blank"><?php _e('Preview', THEME_DOMAIN); ?></a>
|
73 |
+
<a href="<?php echo admin_url( 'import.php?import=auxin-importer&demo-id=' . $demo_id. '&_wpnonce=' . $wpnonce ); ?>" class="button button-primary aux-button import-demo">
|
74 |
+
<?php _e( 'Import Demo', THEME_DOMAIN ); ?>
|
75 |
+
</a>
|
76 |
+
</div>
|
77 |
+
<?php
|
78 |
+
}
|
79 |
+
echo '</div>';
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
+
function auxin_welcome_add_section_demos( $sections ){
|
84 |
+
|
85 |
+
$sections['demos'] = array(
|
86 |
+
'label' => __( 'Demos', THEME_DOMAIN ),
|
87 |
+
'description' => sprintf(__( 'you can see and import the %s demos in this section.', THEME_DOMAIN), THEME_NAME_I18N ),
|
88 |
+
'callback' => 'auxin_welcome_page_display_section_demos'
|
89 |
+
);
|
90 |
+
|
91 |
+
return $sections;
|
92 |
+
}
|
93 |
+
|
94 |
+
add_filter( 'auxin_admin_welcome_sections', 'auxin_welcome_add_section_demos', 60 );
|
95 |
+
|
96 |
/*-----------------------------------------------------------------------------------*/
|
97 |
/* Adds system status tab in theme about (welcome) page
|
98 |
/*-----------------------------------------------------------------------------------*/
|
248 |
|
249 |
|
250 |
|
251 |
+
/*-----------------------------------------------------------------------------------*/
|
252 |
+
/* Populate some widgets on global sidebar after theme activation
|
253 |
+
/*-----------------------------------------------------------------------------------*/
|
254 |
+
|
255 |
+
function auxin_populate_widgets_on_theme_activation(){
|
256 |
+
|
257 |
+
if( get_option( THEME_ID.'_are_default_widgets_populated' ) ){
|
258 |
+
return;
|
259 |
+
}
|
260 |
+
|
261 |
+
$sidebars_widgets = get_option( 'sidebars_widgets' );
|
262 |
|
263 |
+
if( empty( $sidebars_widgets['auxin-global-primary-sidebar-widget-area'] ) ){
|
264 |
+
$sidebars_widgets['auxin-global-primary-sidebar-widget-area'] = array(
|
265 |
+
'recent-posts-1',
|
266 |
+
'categories-1',
|
267 |
+
'archives-1'
|
268 |
+
);
|
269 |
+
update_option('widget_recent-posts', array(
|
270 |
+
1 => array('title' => '')
|
271 |
+
));
|
272 |
+
|
273 |
+
update_option('widget_categories', array(
|
274 |
+
1 => array('title' => '')
|
275 |
+
));
|
276 |
+
|
277 |
+
update_option('widget_archives', array(
|
278 |
+
1 => array('title' => '')
|
279 |
+
));
|
280 |
+
update_option( 'sidebars_widgets', $sidebars_widgets );
|
281 |
+
}
|
282 |
+
|
283 |
+
update_option( THEME_ID.'_are_default_widgets_populated', 1 );
|
284 |
+
}
|
285 |
+
|
286 |
+
add_action('after_switch_theme', 'auxin_populate_widgets_on_theme_activation');
|
287 |
+
|
288 |
+
|
289 |
+
/*-----------------------------------------------------------------------------------*/
|
290 |
+
/* Add allowed custom mieme types
|
291 |
+
/*-----------------------------------------------------------------------------------*/
|
292 |
+
|
293 |
+
function auxin_mime_types( $mimes ) {
|
294 |
+
$mimes['svg'] = 'image/svg+xml';
|
295 |
+
return $mimes;
|
296 |
+
}
|
297 |
|
298 |
+
add_filter('upload_mimes', 'auxin_mime_types');
|
299 |
|
300 |
/*======================================================================*/
|
301 |
|
admin/includes/admin-the-functions.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
-
<?php
|
|
|
2 |
|
3 |
|
4 |
function auxin_get_about_system_status(){
|
@@ -186,3 +187,43 @@ function auxin_get_about_system_status(){
|
|
186 |
<?php
|
187 |
}
|
188 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// admin related functions
|
3 |
|
4 |
|
5 |
function auxin_get_about_system_status(){
|
187 |
<?php
|
188 |
}
|
189 |
|
190 |
+
|
191 |
+
|
192 |
+
/**
|
193 |
+
* Retrieves the changelog remotely
|
194 |
+
*
|
195 |
+
* @param string $item_name The name of the project that we intend to get the info of
|
196 |
+
* @return string The changelog context
|
197 |
+
*/
|
198 |
+
function auxin_get_remote_changelog( $item_name = '' ){
|
199 |
+
|
200 |
+
if( empty( $item_name ) ){
|
201 |
+
$item_name = THEME_ID;
|
202 |
+
}
|
203 |
+
|
204 |
+
global $wp_version;
|
205 |
+
|
206 |
+
$args = array(
|
207 |
+
'user-agent' => 'WordPress/'. $wp_version.'; '. get_site_url(),
|
208 |
+
'timeout' => ( ( defined('DOING_CRON') && DOING_CRON ) ? 30 : 10 ),
|
209 |
+
'body' => array(
|
210 |
+
'action' => 'text',
|
211 |
+
'cat' => 'changelog',
|
212 |
+
'item-name' => 'phlox',
|
213 |
+
'context' => 'full',
|
214 |
+
'format' => 'json',
|
215 |
+
'latest' => ''
|
216 |
+
)
|
217 |
+
);
|
218 |
+
|
219 |
+
$request = wp_remote_get( 'http://api.averta.net/envato/items/', $args );
|
220 |
+
|
221 |
+
if ( is_wp_error( $request ) || wp_remote_retrieve_response_code( $request ) !== 200 ) {
|
222 |
+
return new WP_Error( 'no_response', 'Error while receiving remote data' );
|
223 |
+
}
|
224 |
+
|
225 |
+
$response = $request['body'];
|
226 |
+
|
227 |
+
return $response;
|
228 |
+
}
|
229 |
+
|
admin/includes/compatibility/siteorigin/fields/iconpicker.class.php
CHANGED
@@ -7,10 +7,10 @@ class Auxin_SiteOrigin_Field_Iconpicker extends SiteOrigin_Widget_Field_Base {
|
|
7 |
|
8 |
protected function render_field( $value, $instance ) {
|
9 |
|
10 |
-
$font_icons = Auxin()->
|
11 |
$output = '<div class="aux-element-field aux-iconpicker">';
|
12 |
$output .= sprintf( '<select name="%1$s" id="%1$s" class="aux-fonticonpicker aux-select" >', $this->element_name );
|
13 |
-
$output .= '<option value="">' . __('Choose ..',
|
14 |
|
15 |
if( is_array( $font_icons ) ){
|
16 |
foreach ( $font_icons as $icon ) {
|
7 |
|
8 |
protected function render_field( $value, $instance ) {
|
9 |
|
10 |
+
$font_icons = Auxin()->Font_Icons->get_icons_list('fontastic');
|
11 |
$output = '<div class="aux-element-field aux-iconpicker">';
|
12 |
$output .= sprintf( '<select name="%1$s" id="%1$s" class="aux-fonticonpicker aux-select" >', $this->element_name );
|
13 |
+
$output .= '<option value="">' . __('Choose ..', 'auxin-elements') . '</option>';
|
14 |
|
15 |
if( is_array( $font_icons ) ){
|
16 |
foreach ( $font_icons as $icon ) {
|
admin/includes/index.php
CHANGED
@@ -3,11 +3,20 @@
|
|
3 |
// load admin related functions
|
4 |
include_once( 'admin-the-functions.php' );
|
5 |
|
6 |
-
// load admin related classes
|
7 |
-
include_once( 'classes/class-auxels-admin-assets.php' );
|
8 |
-
include_once( 'classes/class-auxels-import.php' );
|
9 |
|
10 |
do_action( 'auxels_admin_classes_loaded' );
|
11 |
|
12 |
// load admin related functions
|
13 |
include_once( 'admin-hooks.php' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
// load admin related functions
|
4 |
include_once( 'admin-the-functions.php' );
|
5 |
|
|
|
|
|
|
|
6 |
|
7 |
do_action( 'auxels_admin_classes_loaded' );
|
8 |
|
9 |
// load admin related functions
|
10 |
include_once( 'admin-hooks.php' );
|
11 |
+
|
12 |
+
// init the class for extending the menu nav in back-end
|
13 |
+
Auxin_Master_Nav_Menu_Admin::get_instance();
|
14 |
+
|
15 |
+
// custom permalink setting fields for custom post types
|
16 |
+
//$axi_permalink = new Auxin_Permalink();
|
17 |
+
//$axi_permalink->setup();
|
18 |
+
|
19 |
+
// init Auxin_Install
|
20 |
+
// init Auxin_Admin_Dashboard
|
21 |
+
// init Auxin_Import
|
22 |
+
// init
|
admin/includes/metaboxes/metabox-fields-post-audio.php
CHANGED
@@ -20,41 +20,41 @@ function auxin_metabox_fields_post_audio(){
|
|
20 |
|
21 |
$model = new Auxin_Metabox_Model();
|
22 |
$model->id = 'post-audio';
|
23 |
-
$model->title = __('Audio Post options',
|
24 |
$model->css_class = 'aux-format-tab';
|
25 |
$model->fields = array(
|
26 |
|
27 |
array(
|
28 |
-
'title' => __('Audio file (MP3 or ogg)',
|
29 |
-
'description' => __('Please upload an MP3 file for self hosted audio player.',
|
30 |
'id' => '_format_audio_attachment',
|
31 |
'type' => 'audio',
|
32 |
'default' => ''
|
33 |
),
|
34 |
array(
|
35 |
-
'title' => __('Audio URL (oEmbed)',
|
36 |
'description' => '',
|
37 |
'id' => '_format_audio_embed',
|
38 |
'type' => 'textarea',
|
39 |
'default' => ''
|
40 |
),
|
41 |
array(
|
42 |
-
'title' => __('Player Skin',
|
43 |
-
'description' => __('Specifies the skin for audio player.',
|
44 |
'id' => '_format_audio_player_skin',
|
45 |
'type' => 'radio-image',
|
46 |
'default' => 'default',
|
47 |
'choices' => array(
|
48 |
'default' => array(
|
49 |
-
'label' => __('Default (set in theme options)',
|
50 |
'image' => AUX_URL . 'images/visual-select/default2.svg'
|
51 |
),
|
52 |
'light' => array(
|
53 |
-
'label' => __('Light',
|
54 |
'image' => AUX_URL . 'images/visual-select/audio-player-light.svg'
|
55 |
),
|
56 |
'dark' => array(
|
57 |
-
'label' => __('Dark',
|
58 |
'image' => AUX_URL . 'images/visual-select/audio-player-dark.svg'
|
59 |
)
|
60 |
)
|
20 |
|
21 |
$model = new Auxin_Metabox_Model();
|
22 |
$model->id = 'post-audio';
|
23 |
+
$model->title = __('Audio Post options', 'auxin-elements');
|
24 |
$model->css_class = 'aux-format-tab';
|
25 |
$model->fields = array(
|
26 |
|
27 |
array(
|
28 |
+
'title' => __('Audio file (MP3 or ogg)', 'auxin-elements'),
|
29 |
+
'description' => __('Please upload an MP3 file for self hosted audio player.', 'auxin-elements'),
|
30 |
'id' => '_format_audio_attachment',
|
31 |
'type' => 'audio',
|
32 |
'default' => ''
|
33 |
),
|
34 |
array(
|
35 |
+
'title' => __('Audio URL (oEmbed)', 'auxin-elements'),
|
36 |
'description' => '',
|
37 |
'id' => '_format_audio_embed',
|
38 |
'type' => 'textarea',
|
39 |
'default' => ''
|
40 |
),
|
41 |
array(
|
42 |
+
'title' => __('Player Skin', 'auxin-elements'),
|
43 |
+
'description' => __('Specifies the skin for audio player.', 'auxin-elements'),
|
44 |
'id' => '_format_audio_player_skin',
|
45 |
'type' => 'radio-image',
|
46 |
'default' => 'default',
|
47 |
'choices' => array(
|
48 |
'default' => array(
|
49 |
+
'label' => __('Default (set in theme options)', 'auxin-elements'),
|
50 |
'image' => AUX_URL . 'images/visual-select/default2.svg'
|
51 |
),
|
52 |
'light' => array(
|
53 |
+
'label' => __('Light', 'auxin-elements'),
|
54 |
'image' => AUX_URL . 'images/visual-select/audio-player-light.svg'
|
55 |
),
|
56 |
'dark' => array(
|
57 |
+
'label' => __('Dark', 'auxin-elements'),
|
58 |
'image' => AUX_URL . 'images/visual-select/audio-player-dark.svg'
|
59 |
)
|
60 |
)
|
admin/includes/metaboxes/metabox-fields-post-gallery.php
CHANGED
@@ -21,12 +21,12 @@ function auxin_metabox_fields_post_gallery(){
|
|
21 |
|
22 |
$model = new Auxin_Metabox_Model();
|
23 |
$model->id = 'post-gallery';
|
24 |
-
$model->title = __('Gallery Post options',
|
25 |
$model->css_class = 'aux-format-tab';
|
26 |
$model->fields = array(
|
27 |
|
28 |
array(
|
29 |
-
'title' => __('The Gallery Images',
|
30 |
'description' => '',
|
31 |
'id' => '_format_gallery_type',
|
32 |
'type' => 'images',
|
21 |
|
22 |
$model = new Auxin_Metabox_Model();
|
23 |
$model->id = 'post-gallery';
|
24 |
+
$model->title = __('Gallery Post options', 'auxin-elements');
|
25 |
$model->css_class = 'aux-format-tab';
|
26 |
$model->fields = array(
|
27 |
|
28 |
array(
|
29 |
+
'title' => __('The Gallery Images', 'auxin-elements'),
|
30 |
'description' => '',
|
31 |
'id' => '_format_gallery_type',
|
32 |
'type' => 'images',
|
admin/includes/metaboxes/metabox-fields-post-quote.php
CHANGED
@@ -20,20 +20,20 @@ function auxin_metabox_fields_post_quote(){
|
|
20 |
|
21 |
$model = new Auxin_Metabox_Model();
|
22 |
$model->id = 'post-quote';
|
23 |
-
$model->title = __('Quote Post options',
|
24 |
$model->css_class = 'aux-format-tab';
|
25 |
$model->fields = array(
|
26 |
|
27 |
array(
|
28 |
-
'title' => __('Source Name',
|
29 |
-
'description' => __('The Source name',
|
30 |
'id' => '_format_quote_source_name',
|
31 |
'type' => 'text',
|
32 |
'default' => ''
|
33 |
),
|
34 |
array(
|
35 |
-
'title' => __('Source URL',
|
36 |
-
'description' => __('Add the URL',
|
37 |
'id' => '_format_quote_source_url',
|
38 |
'type' => 'text',
|
39 |
'default' => ''
|
20 |
|
21 |
$model = new Auxin_Metabox_Model();
|
22 |
$model->id = 'post-quote';
|
23 |
+
$model->title = __('Quote Post options', 'auxin-elements');
|
24 |
$model->css_class = 'aux-format-tab';
|
25 |
$model->fields = array(
|
26 |
|
27 |
array(
|
28 |
+
'title' => __('Source Name', 'auxin-elements'),
|
29 |
+
'description' => __('The Source name', 'auxin-elements'),
|
30 |
'id' => '_format_quote_source_name',
|
31 |
'type' => 'text',
|
32 |
'default' => ''
|
33 |
),
|
34 |
array(
|
35 |
+
'title' => __('Source URL', 'auxin-elements'),
|
36 |
+
'description' => __('Add the URL', 'auxin-elements'),
|
37 |
'id' => '_format_quote_source_url',
|
38 |
'type' => 'text',
|
39 |
'default' => ''
|
admin/includes/metaboxes/metabox-fields-post-video.php
CHANGED
@@ -20,48 +20,48 @@ function auxin_metabox_fields_post_video(){
|
|
20 |
|
21 |
$model = new Auxin_Metabox_Model();
|
22 |
$model->id = 'post-video';
|
23 |
-
$model->title = __('Video Post options',
|
24 |
$model->css_class = 'aux-format-tab';
|
25 |
$model->fields = array(
|
26 |
|
27 |
array(
|
28 |
-
'title' => __('Video file',
|
29 |
-
'description' => __('Please upload an MP4/OGG/WEBM file for self hosted video player.',
|
30 |
'id' => '_format_video_attachment',
|
31 |
'type' => 'video',
|
32 |
'default' => ''
|
33 |
),
|
34 |
array(
|
35 |
-
'title' => __('Poster image',
|
36 |
-
'description' => __('Please specify an image as a poster for self hosted video player.',
|
37 |
'id' => '_format_video_attachment_poster',
|
38 |
'type' => 'image',
|
39 |
'default' => ''
|
40 |
),
|
41 |
array(
|
42 |
-
'title' => __('Video URL (oEmbed)',
|
43 |
-
'description' => __('Youtube or vimeo link',
|
44 |
'id' => '_format_video_embed',
|
45 |
'type' => 'textarea',
|
46 |
'default' => ''
|
47 |
),
|
48 |
array(
|
49 |
-
'title' => __('Player Skin',
|
50 |
-
'description' => __('Specifies the skin for audio player.',
|
51 |
'id' => '_format_video_player_skin',
|
52 |
'type' => 'radio-image',
|
53 |
'default' => 'default',
|
54 |
'choices' => array(
|
55 |
'default' => array(
|
56 |
-
'label' => __('Default (set in theme options)',
|
57 |
'image' => AUX_URL . 'images/visual-select/default2.svg'
|
58 |
),
|
59 |
'light' => array(
|
60 |
-
'label' => __('Light',
|
61 |
'image' => AUX_URL . 'images/visual-select/audio-player-light.svg'
|
62 |
),
|
63 |
'dark' => array(
|
64 |
-
'label' => __('Dark',
|
65 |
'image' => AUX_URL . 'images/visual-select/audio-player-dark.svg'
|
66 |
)
|
67 |
)
|
20 |
|
21 |
$model = new Auxin_Metabox_Model();
|
22 |
$model->id = 'post-video';
|
23 |
+
$model->title = __('Video Post options', 'auxin-elements');
|
24 |
$model->css_class = 'aux-format-tab';
|
25 |
$model->fields = array(
|
26 |
|
27 |
array(
|
28 |
+
'title' => __('Video file', 'auxin-elements'),
|
29 |
+
'description' => __('Please upload an MP4/OGG/WEBM file for self hosted video player.', 'auxin-elements'),
|
30 |
'id' => '_format_video_attachment',
|
31 |
'type' => 'video',
|
32 |
'default' => ''
|
33 |
),
|
34 |
array(
|
35 |
+
'title' => __('Poster image', 'auxin-elements'),
|
36 |
+
'description' => __('Please specify an image as a poster for self hosted video player.', 'auxin-elements'),
|
37 |
'id' => '_format_video_attachment_poster',
|
38 |
'type' => 'image',
|
39 |
'default' => ''
|
40 |
),
|
41 |
array(
|
42 |
+
'title' => __('Video URL (oEmbed)', 'auxin-elements'),
|
43 |
+
'description' => __('Youtube or vimeo link', 'auxin-elements'),
|
44 |
'id' => '_format_video_embed',
|
45 |
'type' => 'textarea',
|
46 |
'default' => ''
|
47 |
),
|
48 |
array(
|
49 |
+
'title' => __('Player Skin', 'auxin-elements'),
|
50 |
+
'description' => __('Specifies the skin for audio player.', 'auxin-elements'),
|
51 |
'id' => '_format_video_player_skin',
|
52 |
'type' => 'radio-image',
|
53 |
'default' => 'default',
|
54 |
'choices' => array(
|
55 |
'default' => array(
|
56 |
+
'label' => __('Default (set in theme options)', 'auxin-elements'),
|
57 |
'image' => AUX_URL . 'images/visual-select/default2.svg'
|
58 |
),
|
59 |
'light' => array(
|
60 |
+
'label' => __('Light', 'auxin-elements'),
|
61 |
'image' => AUX_URL . 'images/visual-select/audio-player-light.svg'
|
62 |
),
|
63 |
'dark' => array(
|
64 |
+
'label' => __('Dark', 'auxin-elements'),
|
65 |
'image' => AUX_URL . 'images/visual-select/audio-player-dark.svg'
|
66 |
)
|
67 |
)
|
auxin-elements.php
CHANGED
@@ -12,13 +12,13 @@
|
|
12 |
* Plugin Name: Auxin Essential 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.3.
|
16 |
* Author: averta
|
17 |
* Author URI: http://averta.net
|
18 |
* Text Domain: auxin-elements
|
19 |
* License URI: LICENSE.txt
|
20 |
* Domain Path: /languages
|
21 |
-
* Tested up to: 4.7.
|
22 |
*/
|
23 |
|
24 |
// If this file is called directly, abort.
|
@@ -31,50 +31,77 @@ if ( defined( 'WP_INSTALLING' ) && WP_INSTALLING ) {
|
|
31 |
return;
|
32 |
}
|
33 |
|
34 |
-
|
|
|
|
|
35 |
|
|
|
|
|
36 |
|
37 |
-
|
38 |
-
if ( ! wp_installing() || 'wp-activate.php' === $pagenow ) {
|
39 |
-
if ( ! file_exists( get_template_directory() . '/auxin/auxin-include/auxin.php' ) ){
|
40 |
-
return;
|
41 |
-
}
|
42 |
-
}
|
43 |
|
|
|
|
|
44 |
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
}
|
67 |
}
|
68 |
-
add_action( 'admin_notices', 'auel_auxin_theme_requirement_notice' );
|
69 |
-
|
70 |
|
71 |
-
|
|
|
|
|
72 |
|
73 |
-
require_once( plugin_dir_path( __FILE__ ) . 'includes/define.php'
|
74 |
require_once( plugin_dir_path( __FILE__ ) . 'public/class-auxels.php' );
|
75 |
|
76 |
// Register hooks that are fired when the plugin is activated or deactivated.
|
77 |
register_activation_hook ( __FILE__, array( 'AUXELS', 'activate' ) );
|
78 |
register_deactivation_hook( __FILE__, array( 'AUXELS', 'deactivate' ) );
|
79 |
|
80 |
-
|
12 |
* Plugin Name: Auxin Essential 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.3.6
|
16 |
* Author: averta
|
17 |
* Author URI: http://averta.net
|
18 |
* Text Domain: auxin-elements
|
19 |
* License URI: LICENSE.txt
|
20 |
* Domain Path: /languages
|
21 |
+
* Tested up to: 4.7.3
|
22 |
*/
|
23 |
|
24 |
// If this file is called directly, abort.
|
31 |
return;
|
32 |
}
|
33 |
|
34 |
+
/**
|
35 |
+
* Check plugin requirements
|
36 |
+
* ===========================================================================*/
|
37 |
|
38 |
+
// Don't check the requirements if it's frontend or AUXIN_DUBUG set to false
|
39 |
+
if( is_admin() && ! ( defined( 'AUXIN_DUBUG' ) && ! AUXIN_DUBUG ) ){
|
40 |
|
41 |
+
require_once( plugin_dir_path( __FILE__ ) . 'includes/classes/class-auxin-plugin-requirements.php' );
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
+
$plugin_requirements = new Auxin_Plugin_Requirements();
|
44 |
+
$plugin_requirements->requirements = array(
|
45 |
|
46 |
+
'plugins' => array(
|
47 |
+
array(
|
48 |
+
'name' => __('Page Builder by SiteOrigin', 'auxin-elements'), // The plugin name.
|
49 |
+
'basename' => 'siteorigin-panels/siteorigin-panels.php', // The plugin basename (typically the folder name and main php file)
|
50 |
+
'required' => false, // If true, the user will be notified with a notice to install the plugin.
|
51 |
+
'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher.
|
52 |
+
'dependency' => true, // If true, and the plugin is activated, the plugin will be loaded before as a dependeny.
|
53 |
+
'is_callable' => '' // If set, this callable will be be checked for availability to determine if a plugin is active.
|
54 |
+
),
|
55 |
+
array(
|
56 |
+
'name' => __('SiteOrigin Widgets Bundle', 'auxin-elements'), // The plugin name.
|
57 |
+
'basename' => 'so-widgets-bundle/so-widgets-bundle.php', // The plugin basename (typically the folder name and main php file)
|
58 |
+
'required' => false, // If true, the user will be notified with a notice to install the plugin.
|
59 |
+
'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher.
|
60 |
+
'dependency' => true, // If true, and the plugin is activated, the plugin will be loaded before as a dependeny.
|
61 |
+
'is_callable' => '' // If set, this callable will be be checked for availability to determine if a plugin is active.
|
62 |
+
)
|
63 |
+
),
|
64 |
|
65 |
+
'themes' => array(
|
66 |
+
array(
|
67 |
+
'name' => __('Phlox', 'auxin-elements'), // The theme name.
|
68 |
+
'version' => '1.6.6', // E.g. 1.0.0. If set, the active theme must be this version or higher.
|
69 |
+
'is_callable' => '', // If set, this callable will be be checked for availability to determine if a theme is active.
|
70 |
+
'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.
|
71 |
+
)
|
72 |
+
),
|
73 |
|
74 |
+
'php' => array(
|
75 |
+
'version' => '5.3.0' // The minimum PHP version for this plugin, otherwise, throw a notice
|
76 |
+
),
|
77 |
+
|
78 |
+
'config' => array(
|
79 |
+
'plugin_name' => __('Auxin Elements', 'auxin-elements'), // Current plugin name.
|
80 |
+
'plugin_basename' => plugin_basename( __FILE__ ),
|
81 |
+
'plugin_dir_path' => plugin_dir_path( __FILE__ ),
|
82 |
+
'debug' => false
|
83 |
+
)
|
84 |
+
|
85 |
+
);
|
86 |
+
|
87 |
+
// Check the requirements
|
88 |
+
$validation = $plugin_requirements->validate();
|
89 |
+
|
90 |
+
// If the requirements were not met, dont initialize the plugin
|
91 |
+
if( true !== $validation ){
|
92 |
+
return;
|
93 |
}
|
94 |
}
|
|
|
|
|
95 |
|
96 |
+
/**
|
97 |
+
* Initialize the plugin
|
98 |
+
* ===========================================================================*/
|
99 |
|
100 |
+
require_once( plugin_dir_path( __FILE__ ) . 'includes/define.php' );
|
101 |
require_once( plugin_dir_path( __FILE__ ) . 'public/class-auxels.php' );
|
102 |
|
103 |
// Register hooks that are fired when the plugin is activated or deactivated.
|
104 |
register_activation_hook ( __FILE__, array( 'AUXELS', 'activate' ) );
|
105 |
register_deactivation_hook( __FILE__, array( 'AUXELS', 'deactivate' ) );
|
106 |
|
107 |
+
/*============================================================================*/
|
function.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
add_action( 'vc_load_default_templates_action','phlox_vc_page_templates' ); // Hook in
|
3 |
+
function phlox_vc_page_templates() {
|
4 |
+
$data = array(); // Create new array
|
5 |
+
$data['name'] = __( 'Phlox Blog template', 'Phlox' ); // Assign name for your custom template
|
6 |
+
$data['weight'] = 0; // Weight of your template in the template list
|
7 |
+
// $data['image_path'] = preg_replace( '/\s/', '%20', plugins_url( 'images/custom_template_thumbnail.jpg', __FILE__ ) ); // Always use preg replace to be sure that "space" will not break logic. Thumbnail should have this dimensions: 114x154px
|
8 |
+
$data['image_path'] = preg_replace( '/\s/', '%20', plugins_url( 'images/temp1.jpeg', __FILE__ ) ); // Always use preg replace to be sure that "space" will not break logic. Thumbnail should have this dimensions: 114x154px
|
9 |
+
// $data['custom_class'] = 'custom_template_for_vc_custom_template'; // CSS class name
|
10 |
+
$data['content'] = '[vc_row][vc_column][aux_quote]Proin eget tortor risus. Curabitur aliquet quam id dui posuere blandit. Cras ultricies ligula sed magna dictum porta. Nulla quis lorem ut libero malesuada feugiat. Praesent sapien massa, convallis a pellentesque nec, egestas non nisi. Praesent sapien ma[/aux_quote][/vc_column][/vc_row][vc_row][vc_column width="1/2"][aux_contact_box title="kamtar shenasim" email="jame@bade.ghese" telephone="021.54868745" address="25 Ave" extra_classes="customm"][/vc_column][vc_column width="1/2"][aux_search title="shipping them out"][aux_divider style=""][aux_button label="sabzeie khake ma" icon="fa fa-pied-piper"][/vc_column][/vc_row][vc_row][vc_column][aux_recent_posts_land_style title="oooW" num="4"][/vc_column][/vc_row]';
|
11 |
+
|
12 |
+
vc_add_default_templates( $data );
|
13 |
+
|
14 |
+
$template = array();
|
15 |
+
$template['name'] = __( 'Phlox contt template', 'Phlox' );
|
16 |
+
$data['image_path'] = preg_replace( '/\s/', '%20', plugins_url( 'images/temp2.jpg', __FILE__ ) );
|
17 |
+
|
18 |
+
// $template['custom_class'] = 'custom_template_for_vc_custom_template'; // CSS class name
|
19 |
+
$template['content'] = '[vc_row][vc_column][aux_quote type=""]Proin eget tortor risus. Curabitur aliquet quam id dui posuere blandit. Cras ultricies ligula sed magna dictum porta. Nulla quis lorem ut libero malesuada feugiat. Praesent sapien massa, convallis a pellentesque nec, egestas non nisi. Praesent sapien ma[/aux_quote][/vc_column][/vc_row][vc_row][vc_column width="1/2"][aux_gallery layout="masonry" columns="1" tablet_cnum="inherit" phone_cnum="1" link="none" include="81,71,109,153,155,147,42,6"][/vc_column][vc_column width="1/2"][aux_search title="shipping them out"][aux_divider style=""][aux_button label="sabzeie khake ma" border="" style="" icon="fa fa-pied-piper" color_name=""][/vc_column][/vc_row][vc_row][vc_column][aux_recent_posts_land_style title="oooW" num="4"][/vc_column][/vc_row]';
|
20 |
+
|
21 |
+
vc_add_default_templates( $template );
|
22 |
+
}
|
23 |
+
|
24 |
+
// @TODO: VC page template sample of reordering
|
25 |
+
// add_filter( 'vc_load_default_templates', 'my_custom_template_at_first_position' ); // Hook in
|
26 |
+
// function my_custom_template_at_first_position( $data ) {
|
27 |
+
// $template = array();
|
28 |
+
// $template['name'] = __( 'Phlox contt template', 'Phlox' );
|
29 |
+
// $data['image_path'] = preg_replace( '/\s/', '%20', plugins_url( 'images/temp2.jpg', __FILE__ ) );
|
30 |
+
|
31 |
+
// // $template['custom_class'] = 'custom_template_for_vc_custom_template'; // CSS class name
|
32 |
+
// $template['content'] = '[vc_row][vc_column][aux_quote type=""]Proin eget tortor risus. Curabitur aliquet quam id dui posuere blandit. Cras ultricies ligula sed magna dictum porta. Nulla quis lorem ut libero malesuada feugiat. Praesent sapien massa, convallis a pellentesque nec, egestas non nisi. Praesent sapien ma[/aux_quote][/vc_column][/vc_row][vc_row][vc_column width="1/2"][aux_gallery layout="masonry" columns="1" tablet_cnum="inherit" phone_cnum="1" link="none" include="81,71,109,153,155,147,42,6"][/vc_column][vc_column width="1/2"][aux_search title="shipping them out"][aux_divider style=""][aux_button label="sabzeie khake ma" border="" style="" icon="fa fa-pied-piper" color_name=""][/vc_column][/vc_row][vc_row][vc_column][aux_recent_posts_land_style title="oooW" num="4"][/vc_column][/vc_row]';
|
33 |
+
// array_unshift( $data, $template );
|
34 |
+
|
35 |
+
|
36 |
+
|
37 |
+
// return $data;
|
38 |
+
// }
|
includes/classes/class-auxels-admin-assets.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Master Slider Admin Scripts Class.
|
4 |
+
*
|
5 |
+
* @
|
6 |
+
*/
|
7 |
+
|
8 |
+
// no direct access allowed
|
9 |
+
if ( ! defined('ABSPATH') ) {
|
10 |
+
die();
|
11 |
+
}
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Class to load and print master slider panel scripts
|
15 |
+
*/
|
16 |
+
class Auxels_Admin_Assets {
|
17 |
+
|
18 |
+
|
19 |
+
/**
|
20 |
+
* __construct
|
21 |
+
*/
|
22 |
+
function __construct() {
|
23 |
+
// general assets
|
24 |
+
$this->load_styles();
|
25 |
+
$this->load_scripts();
|
26 |
+
}
|
27 |
+
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Styles for admin
|
31 |
+
*
|
32 |
+
* @return void
|
33 |
+
*/
|
34 |
+
public function load_styles() {
|
35 |
+
// wp_enqueue_style( AUXELS_SLUG .'-admin-styles', AUXELS_ADMIN_URL . '/assets/css/msp-general.css', array(), AUXELS_VERSION );
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Scripts for admin
|
40 |
+
*
|
41 |
+
* @return void
|
42 |
+
*/
|
43 |
+
public function load_scripts() {
|
44 |
+
//wp_enqueue_script( AUXELS_SLUG .'-admin-scripts', AUXELS_ADMIN_URL . '/assets/js/admin.js', array('jquery', 'jquery-ui-core', 'jquery-ui-dialog'), AUXELS_VERSION, true );
|
45 |
+
}
|
46 |
+
|
47 |
+
}
|
includes/classes/class-auxels-import-parser.php
ADDED
@@ -0,0 +1,312 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WordPress eXtended RSS file parser implementations
|
4 |
+
*
|
5 |
+
* @package WordPress
|
6 |
+
* @subpackage Importer
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* WordPress Importer class for managing parsing of WXR files.
|
11 |
+
*/
|
12 |
+
class Auxels_Import_Parser {
|
13 |
+
function parse( $file ) {
|
14 |
+
// Attempt to use proper XML parsers first
|
15 |
+
if ( extension_loaded( 'simplexml' ) ) {
|
16 |
+
$parser = new AUXELS_WXR_Parser_SimpleXML;
|
17 |
+
$result = $parser->parse( $file );
|
18 |
+
|
19 |
+
// If SimpleXML succeeds or this is an invalid WXR file then return the results
|
20 |
+
if ( ! is_wp_error( $result ) || 'SimpleXML_parse_error' != $result->get_error_code() )
|
21 |
+
return $result;
|
22 |
+
} else if ( extension_loaded( 'xml' ) ) {
|
23 |
+
$parser = new AUXELS_WXR_Parser_XML;
|
24 |
+
$result = $parser->parse( $file );
|
25 |
+
|
26 |
+
// If XMLParser succeeds or this is an invalid WXR file then return the results
|
27 |
+
if ( ! is_wp_error( $result ) || 'XML_parse_error' != $result->get_error_code() )
|
28 |
+
return $result;
|
29 |
+
}
|
30 |
+
|
31 |
+
// We have a malformed XML file, so display the error and fallthrough to regex
|
32 |
+
if ( isset($result) && defined('IMPORT_DEBUG') && IMPORT_DEBUG ) {
|
33 |
+
echo '<pre>';
|
34 |
+
if ( 'SimpleXML_parse_error' == $result->get_error_code() ) {
|
35 |
+
foreach ( $result->get_error_data() as $error )
|
36 |
+
echo $error->line . ':' . $error->column . ' ' . esc_html( $error->message ) . "\n";
|
37 |
+
} else if ( 'XML_parse_error' == $result->get_error_code() ) {
|
38 |
+
$error = $result->get_error_data();
|
39 |
+
echo $error[0] . ':' . $error[1] . ' ' . esc_html( $error[2] );
|
40 |
+
}
|
41 |
+
echo '</pre>';
|
42 |
+
echo '<p><strong>' . __( 'There was an error when reading this WXR file', 'wordpress-importer' ) . '</strong><br />';
|
43 |
+
echo __( 'Details are shown above. The importer will now try again with a different parser...', 'wordpress-importer' ) . '</p>';
|
44 |
+
}
|
45 |
+
|
46 |
+
// use regular expressions if nothing else available or this is bad XML
|
47 |
+
$parser = new AUXELS_WXR_Parser_Regex;
|
48 |
+
return $parser->parse( $file );
|
49 |
+
}
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* WXR Parser that makes use of the SimpleXML PHP extension.
|
54 |
+
*/
|
55 |
+
class AUXELS_WXR_Parser_SimpleXML {
|
56 |
+
|
57 |
+
function parse( $file ) {
|
58 |
+
|
59 |
+
$options = $option = array();
|
60 |
+
|
61 |
+
$internal_errors = libxml_use_internal_errors(true);
|
62 |
+
|
63 |
+
$dom = new DOMDocument;
|
64 |
+
$old_value = null;
|
65 |
+
if ( function_exists( 'libxml_disable_entity_loader' ) ) {
|
66 |
+
$old_value = libxml_disable_entity_loader( true );
|
67 |
+
}
|
68 |
+
$success = $dom->loadXML( file_get_contents( $file ) );
|
69 |
+
if ( ! is_null( $old_value ) ) {
|
70 |
+
libxml_disable_entity_loader( $old_value );
|
71 |
+
}
|
72 |
+
|
73 |
+
if ( ! $success || isset( $dom->doctype ) ) {
|
74 |
+
return new WP_Error( 'SimpleXML_parse_error', __( 'There was an error when reading this WXR file', 'wordpress-importer' ), libxml_get_errors() );
|
75 |
+
}
|
76 |
+
|
77 |
+
$xml = simplexml_import_dom( $dom );
|
78 |
+
unset( $dom );
|
79 |
+
|
80 |
+
// halt if loading produces an error
|
81 |
+
if ( ! $xml )
|
82 |
+
return new WP_Error( 'SimpleXML_parse_error', __( 'There was an error when reading this WXR file', 'wordpress-importer' ), libxml_get_errors() );
|
83 |
+
|
84 |
+
$wxr_version = $xml->xpath('/rss/channel/wp:wxr_version');
|
85 |
+
if ( ! $wxr_version )
|
86 |
+
return new WP_Error( 'AUXELS_WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'wordpress-importer' ) );
|
87 |
+
|
88 |
+
$wxr_version = (string) trim( $wxr_version[0] );
|
89 |
+
// confirm that we are dealing with the correct file format
|
90 |
+
if ( ! preg_match( '/^\d+\.\d+$/', $wxr_version ) )
|
91 |
+
return new WP_Error( 'AUXELS_WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'wordpress-importer' ) );
|
92 |
+
|
93 |
+
$base_url = $xml->xpath('/rss/channel/wp:base_site_url');
|
94 |
+
$base_url = (string) trim( $base_url[0] );
|
95 |
+
|
96 |
+
$namespaces = $xml->getDocNamespaces();
|
97 |
+
if ( ! isset( $namespaces['wp'] ) )
|
98 |
+
$namespaces['wp'] = 'http://wordpress.org/export/1.1/';
|
99 |
+
if ( ! isset( $namespaces['excerpt'] ) )
|
100 |
+
$namespaces['excerpt'] = 'http://wordpress.org/export/1.1/excerpt/';
|
101 |
+
|
102 |
+
$wp = $xml->channel->children( $namespaces['wp'] );
|
103 |
+
// grab cats, tags and terms
|
104 |
+
|
105 |
+
foreach ( $wp->option as $option ) {
|
106 |
+
$options[ $option->option_key[0]->__toString() ] = $option->option_value[0]->__toString();
|
107 |
+
}
|
108 |
+
|
109 |
+
return $options;
|
110 |
+
}
|
111 |
+
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* WXR Parser that makes use of the XML Parser PHP extension.
|
116 |
+
*/
|
117 |
+
class AUXELS_WXR_Parser_XML {
|
118 |
+
|
119 |
+
var $wp_tags = array(
|
120 |
+
'wp:option'
|
121 |
+
);
|
122 |
+
var $wp_sub_tags = array(
|
123 |
+
'wp:option_name', 'wp:option_value'
|
124 |
+
);
|
125 |
+
|
126 |
+
function parse( $file ) {
|
127 |
+
|
128 |
+
$this->wxr_version = $this->in_post = $this->cdata = $this->data = $this->sub_data = $this->in_tag = $this->in_sub_tag = false;
|
129 |
+
$this->authors = $this->posts = $this->term = $this->category = $this->tag = array();
|
130 |
+
|
131 |
+
$xml = xml_parser_create( 'UTF-8' );
|
132 |
+
xml_parser_set_option( $xml, XML_OPTION_SKIP_WHITE, 1 );
|
133 |
+
xml_parser_set_option( $xml, XML_OPTION_CASE_FOLDING, 0 );
|
134 |
+
xml_set_object( $xml, $this );
|
135 |
+
xml_set_character_data_handler( $xml, 'cdata' );
|
136 |
+
xml_set_element_handler( $xml, 'tag_open', 'tag_close' );
|
137 |
+
|
138 |
+
if ( ! xml_parse( $xml, file_get_contents( $file ), true ) ) {
|
139 |
+
$current_line = xml_get_current_line_number( $xml );
|
140 |
+
$current_column = xml_get_current_column_number( $xml );
|
141 |
+
$error_code = xml_get_error_code( $xml );
|
142 |
+
$error_string = xml_error_string( $error_code );
|
143 |
+
return new WP_Error( 'XML_parse_error', 'There was an error when reading this WXR file', array( $current_line, $current_column, $error_string ) );
|
144 |
+
}
|
145 |
+
xml_parser_free( $xml );
|
146 |
+
|
147 |
+
if ( ! preg_match( '/^\d+\.\d+$/', $this->wxr_version ) )
|
148 |
+
return new WP_Error( 'AUXELS_WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'wordpress-importer' ) );
|
149 |
+
|
150 |
+
return array(
|
151 |
+
'authors' => $this->authors,
|
152 |
+
'posts' => $this->posts,
|
153 |
+
'categories' => $this->category,
|
154 |
+
'tags' => $this->tag,
|
155 |
+
'terms' => $this->term,
|
156 |
+
'base_url' => $this->base_url,
|
157 |
+
'version' => $this->wxr_version
|
158 |
+
);
|
159 |
+
}
|
160 |
+
|
161 |
+
function tag_open( $parse, $tag, $attr ) {
|
162 |
+
if ( in_array( $tag, $this->wp_tags ) ) {
|
163 |
+
$this->in_tag = substr( $tag, 3 );
|
164 |
+
return;
|
165 |
+
}
|
166 |
+
|
167 |
+
if ( in_array( $tag, $this->wp_sub_tags ) ) {
|
168 |
+
$this->in_sub_tag = substr( $tag, 3 );
|
169 |
+
return;
|
170 |
+
}
|
171 |
+
|
172 |
+
switch ( $tag ) {
|
173 |
+
case 'category':
|
174 |
+
if ( isset($attr['domain'], $attr['nicename']) ) {
|
175 |
+
$this->sub_data['domain'] = $attr['domain'];
|
176 |
+
$this->sub_data['slug'] = $attr['nicename'];
|
177 |
+
}
|
178 |
+
break;
|
179 |
+
case 'item': $this->in_post = true;
|
180 |
+
case 'title': if ( $this->in_post ) $this->in_tag = 'post_title'; break;
|
181 |
+
case 'guid': $this->in_tag = 'guid'; break;
|
182 |
+
case 'dc:creator': $this->in_tag = 'post_author'; break;
|
183 |
+
case 'content:encoded': $this->in_tag = 'post_content'; break;
|
184 |
+
case 'excerpt:encoded': $this->in_tag = 'post_excerpt'; break;
|
185 |
+
|
186 |
+
case 'wp:term_slug': $this->in_tag = 'slug'; break;
|
187 |
+
case 'wp:meta_key': $this->in_sub_tag = 'key'; break;
|
188 |
+
case 'wp:meta_value': $this->in_sub_tag = 'value'; break;
|
189 |
+
}
|
190 |
+
}
|
191 |
+
|
192 |
+
function cdata( $parser, $cdata ) {
|
193 |
+
if ( ! trim( $cdata ) )
|
194 |
+
return;
|
195 |
+
|
196 |
+
if ( false !== $this->in_tag || false !== $this->in_sub_tag ) {
|
197 |
+
$this->cdata .= $cdata;
|
198 |
+
} else {
|
199 |
+
$this->cdata .= trim( $cdata );
|
200 |
+
}
|
201 |
+
}
|
202 |
+
|
203 |
+
function tag_close( $parser, $tag ) {
|
204 |
+
switch ( $tag ) {
|
205 |
+
case 'wp:option':
|
206 |
+
$n = substr( $tag, 3 );
|
207 |
+
array_push( $this->$n, $this->data );
|
208 |
+
$this->data = false;
|
209 |
+
break;
|
210 |
+
}
|
211 |
+
|
212 |
+
$this->cdata = false;
|
213 |
+
}
|
214 |
+
}
|
215 |
+
|
216 |
+
/**
|
217 |
+
* WXR Parser that uses regular expressions. Fallback for installs without an XML parser.
|
218 |
+
*/
|
219 |
+
class AUXELS_WXR_Parser_Regex {
|
220 |
+
|
221 |
+
var $options = array();
|
222 |
+
|
223 |
+
function __construct() {
|
224 |
+
$this->has_gzip = is_callable( 'gzopen' );
|
225 |
+
}
|
226 |
+
|
227 |
+
function parse( $file ) {
|
228 |
+
$wxr_version = $in_post = false;
|
229 |
+
|
230 |
+
$fp = $this->fopen( $file, 'r' );
|
231 |
+
if ( $fp ) {
|
232 |
+
while ( ! $this->feof( $fp ) ) {
|
233 |
+
$importline = rtrim( $this->fgets( $fp ) );
|
234 |
+
|
235 |
+
if ( false !== strpos( $importline, '<wp:option>' ) ) {
|
236 |
+
preg_match( '|<wp:option>(.*?)</wp:option>|is', $importline, $option );
|
237 |
+
$this->options[] = $this->process_option( $option[1] );
|
238 |
+
continue;
|
239 |
+
}
|
240 |
+
if ( $in_post ) {
|
241 |
+
$post .= $importline . "\n";
|
242 |
+
}
|
243 |
+
}
|
244 |
+
|
245 |
+
$this->fclose($fp);
|
246 |
+
}
|
247 |
+
|
248 |
+
if ( ! $wxr_version )
|
249 |
+
return new WP_Error( 'AUXELS_WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'wordpress-importer' ) );
|
250 |
+
|
251 |
+
return array(
|
252 |
+
'options' => $this->options
|
253 |
+
);
|
254 |
+
}
|
255 |
+
|
256 |
+
function get_tag( $string, $tag ) {
|
257 |
+
preg_match( "|<$tag.*?>(.*?)</$tag>|is", $string, $return );
|
258 |
+
if ( isset( $return[1] ) ) {
|
259 |
+
if ( substr( $return[1], 0, 9 ) == '<![CDATA[' ) {
|
260 |
+
if ( strpos( $return[1], ']]]]><![CDATA[>' ) !== false ) {
|
261 |
+
preg_match_all( '|<!\[CDATA\[(.*?)\]\]>|s', $return[1], $matches );
|
262 |
+
$return = '';
|
263 |
+
foreach( $matches[1] as $match )
|
264 |
+
$return .= $match;
|
265 |
+
} else {
|
266 |
+
$return = preg_replace( '|^<!\[CDATA\[(.*)\]\]>$|s', '$1', $return[1] );
|
267 |
+
}
|
268 |
+
} else {
|
269 |
+
$return = $return[1];
|
270 |
+
}
|
271 |
+
} else {
|
272 |
+
$return = '';
|
273 |
+
}
|
274 |
+
return $return;
|
275 |
+
}
|
276 |
+
|
277 |
+
function process_option( $t ) {
|
278 |
+
return array(
|
279 |
+
'option_name' => $this->get_tag( $t, 'wp:option_name' ),
|
280 |
+
'option_value' => $this->get_tag( $t, 'wp:option_value' )
|
281 |
+
);
|
282 |
+
}
|
283 |
+
|
284 |
+
function _normalize_tag( $matches ) {
|
285 |
+
return '<' . strtolower( $matches[1] );
|
286 |
+
}
|
287 |
+
|
288 |
+
function fopen( $filename, $mode = 'r' ) {
|
289 |
+
if ( $this->has_gzip )
|
290 |
+
return gzopen( $filename, $mode );
|
291 |
+
return fopen( $filename, $mode );
|
292 |
+
}
|
293 |
+
|
294 |
+
function feof( $fp ) {
|
295 |
+
if ( $this->has_gzip )
|
296 |
+
return gzeof( $fp );
|
297 |
+
return feof( $fp );
|
298 |
+
}
|
299 |
+
|
300 |
+
function fgets( $fp, $len = 8192 ) {
|
301 |
+
if ( $this->has_gzip )
|
302 |
+
return gzgets( $fp, $len );
|
303 |
+
return fgets( $fp, $len );
|
304 |
+
}
|
305 |
+
|
306 |
+
function fclose( $fp ) {
|
307 |
+
if ( $this->has_gzip )
|
308 |
+
return gzclose( $fp );
|
309 |
+
return fclose( $fp );
|
310 |
+
}
|
311 |
+
|
312 |
+
}
|
includes/classes/class-auxels-import.php
ADDED
@@ -0,0 +1,155 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class for importing and exporting theme options
|
4 |
+
*/
|
5 |
+
|
6 |
+
class Auxels_Import {
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Instance of this class.
|
10 |
+
*
|
11 |
+
* @var object
|
12 |
+
*/
|
13 |
+
protected static $instance = null;
|
14 |
+
|
15 |
+
|
16 |
+
function __construct(){
|
17 |
+
// Add a radio option for exporting auxin options to wp export options.
|
18 |
+
add_action( 'export_filters', array( $this, 'export_filters' ) );
|
19 |
+
// Process the check field for auxin options while export submited
|
20 |
+
add_filter( 'export_args', array( $this, 'export_args' ) );
|
21 |
+
|
22 |
+
// adding options to export file
|
23 |
+
add_action( 'rss2_head', array( $this, 'add_xml_tag_option_in_export' ) );
|
24 |
+
// Import the options based on parsed data from xml file
|
25 |
+
add_action( 'import_start', array( $this, 'import_start' ) );
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Add a radio option for exporting auxin options to available export options.
|
30 |
+
*
|
31 |
+
* @return void
|
32 |
+
*/
|
33 |
+
public function export_filters() {
|
34 |
+
?>
|
35 |
+
<hr />
|
36 |
+
<p><label>
|
37 |
+
<input type="checkbox" name="auxin-options" checked="checked" aria-describedby="all-content-desc" />
|
38 |
+
<?php _e( 'Include theme options', 'auxin-elements' ); ?>
|
39 |
+
</label></p>
|
40 |
+
<?php
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Process the check field for auxin options
|
45 |
+
*
|
46 |
+
* @param [type] $args [description]
|
47 |
+
* @return [type] [description]
|
48 |
+
*/
|
49 |
+
public function export_args( $args ){
|
50 |
+
|
51 |
+
if ( ! empty( $_GET['auxin-options'] ) ) {
|
52 |
+
$args['auxin-options'] = true;
|
53 |
+
return $args;
|
54 |
+
}
|
55 |
+
|
56 |
+
return $args;
|
57 |
+
}
|
58 |
+
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Generate option page for wp options in xml format
|
62 |
+
*/
|
63 |
+
public function add_xml_tag_option_in_export(){
|
64 |
+
global $wpdb;
|
65 |
+
|
66 |
+
$options_ref = $this->get_export_option_list();
|
67 |
+
|
68 |
+
foreach ( $options_ref as $option_export_name => $option_import_name ) {
|
69 |
+
$sql = $wpdb->prepare("SELECT option_name, option_value FROM $wpdb->options WHERE option_name = %s", $option_import_name );
|
70 |
+
$result = $wpdb->get_results( $sql );
|
71 |
+
|
72 |
+
if( ! empty( $result[0]->option_value ) ){
|
73 |
+
?>
|
74 |
+
<wp:option>
|
75 |
+
<wp:option_key><?php echo $this->wxr_cdata( $option_export_name ); ?></wp:option_key>
|
76 |
+
<wp:option_value><?php echo $this->wxr_cdata( $result[0]->option_value ); ?></wp:option_value>
|
77 |
+
</wp:option>
|
78 |
+
<?php
|
79 |
+
}
|
80 |
+
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Import the options based on parsed data from xml file
|
87 |
+
*/
|
88 |
+
public function import_start(){
|
89 |
+
global $wp_import;
|
90 |
+
|
91 |
+
$options_ref = $this->get_export_option_list();
|
92 |
+
|
93 |
+
$file = get_attached_file( $wp_import->id );
|
94 |
+
// if export file is not uploaded and is a link to a file in theme files
|
95 |
+
if( empty( $file ) && property_exists( $wp_import, 'import_file' ) ){
|
96 |
+
$file = $wp_import->import_file;
|
97 |
+
}
|
98 |
+
|
99 |
+
include 'class-auxels-import-parser.php';
|
100 |
+
|
101 |
+
$parser = new Auxels_Import_Parser;
|
102 |
+
$options = $parser->parse( $file );
|
103 |
+
|
104 |
+
foreach ( $options as $option_key => $option_value ){
|
105 |
+
if( ! empty( $options_ref[ $option_key ] ) ){
|
106 |
+
update_option( $options_ref[ $option_key ], maybe_unserialize( $option_value ) );
|
107 |
+
}
|
108 |
+
}
|
109 |
+
|
110 |
+
}
|
111 |
+
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Retrieves the list of options we intended to include in export file
|
115 |
+
*/
|
116 |
+
public function get_export_option_list(){
|
117 |
+
return array(
|
118 |
+
'formatted_options' => THEME_ID . '_formatted_options'
|
119 |
+
);
|
120 |
+
}
|
121 |
+
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Print the data in cdata and utf8 format
|
125 |
+
* @param string $str
|
126 |
+
*/
|
127 |
+
function wxr_cdata( $str ) {
|
128 |
+
if ( ! seems_utf8( $str ) ) {
|
129 |
+
$str = utf8_encode( $str );
|
130 |
+
}
|
131 |
+
|
132 |
+
$str = '<![CDATA[' . str_replace( ']]>', ']]]]><![CDATA[>', $str ) . ']]>';
|
133 |
+
|
134 |
+
return $str;
|
135 |
+
}
|
136 |
+
|
137 |
+
|
138 |
+
/**
|
139 |
+
* Return an instance of this class.
|
140 |
+
*
|
141 |
+
* @return object A single instance of this class.
|
142 |
+
*/
|
143 |
+
public static function get_instance() {
|
144 |
+
|
145 |
+
// If the single instance hasn't been set, set it now.
|
146 |
+
if ( null == self::$instance ) {
|
147 |
+
self::$instance = new self;
|
148 |
+
}
|
149 |
+
|
150 |
+
return self::$instance;
|
151 |
+
}
|
152 |
+
|
153 |
+
}
|
154 |
+
|
155 |
+
new Auxels_Import();
|
includes/classes/class-auxin-admin-dashboard.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin Dashboard Widgets
|
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 |
+
// no direct access allowed
|
14 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
15 |
+
|
16 |
+
|
17 |
+
if ( ! class_exists( 'Auxin_Admin_Dashboard' ) ) :
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Auxin_Admin_Dashboard Class
|
21 |
+
*/
|
22 |
+
class Auxin_Admin_Dashboard {
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Hook in admin dashboards
|
26 |
+
*/
|
27 |
+
public function __construct() {
|
28 |
+
|
29 |
+
if ( current_user_can( 'manage_options' ) ) {
|
30 |
+
add_action( 'wp_dashboard_setup', array( $this, 'init' ) );
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Add dashboard widgets on dashboard setup
|
36 |
+
*/
|
37 |
+
public function init() {
|
38 |
+
wp_add_dashboard_widget( 'auxin_dashboard_status', sprintf( __( '%s Status', 'auxin-elements' ), THEME_NAME ), array( $this, 'status_widget' ) );
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Show theme status widget
|
43 |
+
*/
|
44 |
+
public function status_widget() {
|
45 |
+
$auxin_active_post_types = auxin_get_possible_post_types( true );
|
46 |
+
|
47 |
+
$post_types = get_post_types( array( '_builtin' => false ), 'objects' );
|
48 |
+
|
49 |
+
echo '<table>';
|
50 |
+
foreach( $post_types as $pt => $args ) {
|
51 |
+
if( isset( $auxin_active_post_types[ $pt ] ) && $auxin_active_post_types[$pt] ){
|
52 |
+
$edit_url = 'edit.php?post_type='. $pt;
|
53 |
+
echo '<tr><td class="t"><a href="'. $edit_url .'">'. $args->labels->name .'</a></td><td class="b">( '. wp_count_posts( $pt )->publish .' )</td></tr>';
|
54 |
+
}
|
55 |
+
}
|
56 |
+
echo '</table>';
|
57 |
+
}
|
58 |
+
|
59 |
+
}
|
60 |
+
|
61 |
+
endif;
|
includes/classes/class-auxin-import.php
ADDED
@@ -0,0 +1,215 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class for simplifying the demo import process
|
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 |
+
// no direct access allowed
|
14 |
+
if ( ! defined('ABSPATH') ) {
|
15 |
+
die();
|
16 |
+
}
|
17 |
+
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Master Slider Import/Export Class.
|
21 |
+
*
|
22 |
+
* @since 1.2.0
|
23 |
+
*/
|
24 |
+
class Auxin_Import {
|
25 |
+
|
26 |
+
|
27 |
+
var $upload_baseurl = '';
|
28 |
+
|
29 |
+
var $upload_basedir = '';
|
30 |
+
|
31 |
+
/**
|
32 |
+
* The ID of this importer
|
33 |
+
* @var string
|
34 |
+
*/
|
35 |
+
var $importer_id = '';
|
36 |
+
|
37 |
+
/**
|
38 |
+
* The link to welcome page in admin
|
39 |
+
* @var string
|
40 |
+
*/
|
41 |
+
var $welcome_page_url = '';
|
42 |
+
|
43 |
+
/**
|
44 |
+
* The link to demos page in admin
|
45 |
+
* @var string
|
46 |
+
*/
|
47 |
+
var $demo_page_url = '';
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Instance of this class.
|
51 |
+
*
|
52 |
+
* @var object
|
53 |
+
*/
|
54 |
+
protected static $instance = null;
|
55 |
+
|
56 |
+
|
57 |
+
|
58 |
+
function __construct() {
|
59 |
+
|
60 |
+
$this->importer_id = 'auxin-importer';
|
61 |
+
|
62 |
+
|
63 |
+
$this->welcome_page_url = admin_url( 'admin.php?page=auxin-welcome' );
|
64 |
+
$this->demo_page_url = $this->welcome_page_url . '&tab=demos';
|
65 |
+
|
66 |
+
add_action( 'admin_init', array( $this, 'admin_init' ) );
|
67 |
+
|
68 |
+
// process and redirect the import page prior to rendering the header
|
69 |
+
add_action( 'load-importer-'. $this->importer_id, array( $this, 'process_before_header_output' ) );
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Return an instance of this class.
|
74 |
+
*
|
75 |
+
* @return object A single instance of this class.
|
76 |
+
*/
|
77 |
+
public static function get_instance() {
|
78 |
+
|
79 |
+
// If the single instance hasn't been set, set it now.
|
80 |
+
if ( null == self::$instance ) {
|
81 |
+
self::$instance = new self;
|
82 |
+
}
|
83 |
+
|
84 |
+
return self::$instance;
|
85 |
+
}
|
86 |
+
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Print and process the output of auxin importer page
|
90 |
+
* @return string Importer page output
|
91 |
+
*/
|
92 |
+
public function admin_init() {
|
93 |
+
|
94 |
+
$upload = wp_upload_dir();
|
95 |
+
$this->upload_baseurl = $upload['baseurl'];
|
96 |
+
$this->upload_basedir = $upload['basedir'];
|
97 |
+
|
98 |
+
|
99 |
+
register_importer( 'auxin-importer',
|
100 |
+
__( 'Auxin Importer', 'auxin-elements' ),
|
101 |
+
sprintf( __( 'Import demo data for %s theme.', 'auxin-elements' ), '<strong>' . THEME_NAME_I18N . '</strong>' ),
|
102 |
+
array( $this, 'render_importer_page' )
|
103 |
+
);
|
104 |
+
}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Check if the request for importer page is valid and authorized, otherwise redirect client to demos page
|
108 |
+
*
|
109 |
+
* @return void
|
110 |
+
*/
|
111 |
+
public function process_before_header_output(){
|
112 |
+
|
113 |
+
// authorize the request and make sure it is from admin page, otherwise take the client back to demos page
|
114 |
+
if ( ! $this->is_valid_request() ) {
|
115 |
+
wp_redirect( $this->demo_page_url, 301 );
|
116 |
+
exit();
|
117 |
+
}
|
118 |
+
|
119 |
+
}
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Outputs the custom import page for auxin
|
123 |
+
*
|
124 |
+
*/
|
125 |
+
public function render_importer_page() {
|
126 |
+
|
127 |
+
$this->header();
|
128 |
+
|
129 |
+
$this->process_import_request();
|
130 |
+
|
131 |
+
$this->footer();
|
132 |
+
}
|
133 |
+
|
134 |
+
|
135 |
+
/**
|
136 |
+
* Display import page title
|
137 |
+
*/
|
138 |
+
function header() {
|
139 |
+
echo '<div class="wrap">';
|
140 |
+
echo '<h2>' . __( 'Importing Demo Data', 'auxin-elements' ) . '</h2><br />';
|
141 |
+
echo '<div class="aux-import-wrapper">';
|
142 |
+
}
|
143 |
+
|
144 |
+
/**
|
145 |
+
* Close div.wrap
|
146 |
+
*/
|
147 |
+
function footer() {
|
148 |
+
echo '</div></div>';
|
149 |
+
}
|
150 |
+
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Process incoming requests for importing demo data
|
154 |
+
* @return void
|
155 |
+
*/
|
156 |
+
public function process_import_request(){
|
157 |
+
|
158 |
+
// make sure the demo-id is specified
|
159 |
+
if( ! empty( $_GET['demo-id'] ) ) {
|
160 |
+
$demo_id = sanitize_key( $_GET['demo-id'] );
|
161 |
+
$demo_list = auxin_get_demo_info_list();
|
162 |
+
|
163 |
+
// if demo-id is valid, start importing the data
|
164 |
+
if( ! empty( $demo_list[ $demo_id ]['file'] ) ){
|
165 |
+
$file = $demo_list[ $demo_id ]['file'];
|
166 |
+
|
167 |
+
// if wordpress importer is not available, try to install it
|
168 |
+
if ( ! class_exists( 'WP_Importer' ) ) {
|
169 |
+
|
170 |
+
printf( __( 'In order to import the demo data, you need to have "WordPress Importer" plugin installed. Please %s install and activate "WordPress Importer"%s and then try importing the demo data again.', 'auxin-elements' ),
|
171 |
+
'<a href="'. admin_url( 'plugin-install.php?s=WordPress+Importer+zourbuth&tab=search' ) .'&tab=plugins">',
|
172 |
+
'</a>'
|
173 |
+
);
|
174 |
+
|
175 |
+
|
176 |
+
// start parsing and importing the data
|
177 |
+
} else {
|
178 |
+
global $wp_import;
|
179 |
+
set_time_limit(0);
|
180 |
+
$wp_import->fetch_attachments = true;
|
181 |
+
$wp_import->import_file = $file;
|
182 |
+
$wp_import->import( $file );
|
183 |
+
}
|
184 |
+
|
185 |
+
|
186 |
+
} else {
|
187 |
+
|
188 |
+
printf( __( 'The demo that you have requested is not valid. Please try to %s select a demo %s to import.', 'auxin-elements' ),
|
189 |
+
'<a href="'. $this->demo_page_url .'">',
|
190 |
+
'</a>'
|
191 |
+
);
|
192 |
+
|
193 |
+
}
|
194 |
+
|
195 |
+
} else {
|
196 |
+
printf( __( 'Please %s select a demo %s to import.', 'auxin-elements' ), '<a href="'. $this->demo_page_url .'">', '</a>' );
|
197 |
+
}
|
198 |
+
|
199 |
+
}
|
200 |
+
|
201 |
+
/**
|
202 |
+
* Makes sure that a user was referred from another admin page.
|
203 |
+
*
|
204 |
+
* @return boolean True if user was referred from an admin page, false otherwise
|
205 |
+
*/
|
206 |
+
private function is_valid_request(){
|
207 |
+
$adminurl = strtolower( admin_url() );
|
208 |
+
$referer = strtolower( wp_get_referer() );
|
209 |
+
$result = isset( $_REQUEST['_wpnonce'] ) ? wp_verify_nonce( $_REQUEST['_wpnonce'], 'auxin-import' ) : false;
|
210 |
+
|
211 |
+
return $result && ( strpos( $referer, $adminurl ) === 0 );
|
212 |
+
}
|
213 |
+
|
214 |
+
}
|
215 |
+
|
includes/classes/class-auxin-install.php
ADDED
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Adding options and capabilities while theme is installed
|
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 |
+
// no direct access allowed
|
14 |
+
if ( ! defined('ABSPATH') ) exit;
|
15 |
+
|
16 |
+
|
17 |
+
|
18 |
+
class Auxin_Install {
|
19 |
+
|
20 |
+
function __construct(){
|
21 |
+
|
22 |
+
// Add theme capabilities on theme activation
|
23 |
+
add_action( 'after_switch_theme', array( $this, 'install' ) );
|
24 |
+
}
|
25 |
+
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Install theme requirements
|
29 |
+
*/
|
30 |
+
public function install(){
|
31 |
+
$this->add_capabilities();
|
32 |
+
}
|
33 |
+
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Add theme custom capabilities
|
37 |
+
*/
|
38 |
+
public function add_capabilities() {
|
39 |
+
global $wp_roles;
|
40 |
+
|
41 |
+
if ( class_exists( 'WP_Roles' ) ) {
|
42 |
+
if ( ! isset( $wp_roles ) ) {
|
43 |
+
$wp_roles = new WP_Roles();
|
44 |
+
}
|
45 |
+
}
|
46 |
+
|
47 |
+
if ( is_object( $wp_roles ) ) {
|
48 |
+
|
49 |
+
$capabilities = $this->get_theme_capabilities();
|
50 |
+
|
51 |
+
foreach ( $capabilities as $cap_group ) {
|
52 |
+
foreach ( $cap_group as $cap ) {
|
53 |
+
$wp_roles->add_cap( 'administrator', $cap );
|
54 |
+
$wp_roles->add_cap( 'editor' , $cap );
|
55 |
+
}
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
|
60 |
+
// check if custom capabilities are added before or not
|
61 |
+
$is_added = get_option( 'auxin_capabilities_added', 0 );
|
62 |
+
|
63 |
+
update_option( 'auxin_capabilities_added', 1 );
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Get capabilities for auxin - Will be assigned during theme activation
|
70 |
+
*
|
71 |
+
* @return array
|
72 |
+
*/
|
73 |
+
public function get_theme_capabilities() {
|
74 |
+
|
75 |
+
$capabilities = array();
|
76 |
+
$active_post_types = auxin_get_possible_post_types(true);
|
77 |
+
|
78 |
+
|
79 |
+
foreach ( $active_post_types as $post_type => $is_active ) {
|
80 |
+
|
81 |
+
$capabilities[ $post_type ] = array(
|
82 |
+
// Post type
|
83 |
+
"edit_{$post_type}",
|
84 |
+
"read_{$post_type}",
|
85 |
+
"delete_{$post_type}",
|
86 |
+
"edit_{$post_type}s",
|
87 |
+
"edit_others_{$post_type}s",
|
88 |
+
"publish_{$post_type}s",
|
89 |
+
"read_private_{$post_type}s",
|
90 |
+
"delete_{$post_type}s",
|
91 |
+
"delete_private_{$post_type}s",
|
92 |
+
"delete_published_{$post_type}s",
|
93 |
+
"delete_others_{$post_type}s",
|
94 |
+
"edit_private_{$post_type}s",
|
95 |
+
"edit_published_{$post_type}s",
|
96 |
+
|
97 |
+
// Terms
|
98 |
+
"manage_{$post_type}_terms",
|
99 |
+
"edit_{$post_type}_terms",
|
100 |
+
"delete_{$post_type}_terms",
|
101 |
+
"assign_{$post_type}_terms"
|
102 |
+
);
|
103 |
+
}
|
104 |
+
|
105 |
+
return $capabilities;
|
106 |
+
}
|
107 |
+
|
108 |
+
}
|
109 |
+
|
includes/classes/class-auxin-master-nav-menu-admin.php
ADDED
@@ -0,0 +1,157 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Main class for adding configurations and custom menu item fields in admin area
|
4 |
+
*
|
5 |
+
*
|
6 |
+
* @package Auxin
|
7 |
+
* @license LICENSE.txt
|
8 |
+
* @author
|
9 |
+
* @link http://averta.net/phlox/
|
10 |
+
* @copyright (c) 2010-2017
|
11 |
+
*/
|
12 |
+
class Auxin_Master_Nav_Menu_Admin {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Instance of this class.
|
16 |
+
*
|
17 |
+
* @var object
|
18 |
+
*/
|
19 |
+
protected static $instance = null;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* List of custom meta fields for menu items
|
23 |
+
*
|
24 |
+
* @var array
|
25 |
+
*/
|
26 |
+
private $menu_item_fields = array();
|
27 |
+
|
28 |
+
|
29 |
+
function __construct(){
|
30 |
+
|
31 |
+
// Back-end modification hooks
|
32 |
+
|
33 |
+
// Add extra fields to menu items in back-end menu editor
|
34 |
+
add_filter( 'wp_setup_nav_menu_item' , array( $this, 'add_custom_nav_item_fields' ) );
|
35 |
+
|
36 |
+
// Save and update the value of custom menu fields
|
37 |
+
add_action( 'wp_update_nav_menu_item', array( $this, 'update_backend_nav_menu_fields' ), 9, 3 );
|
38 |
+
|
39 |
+
// Change the walker class for back-end menu editor
|
40 |
+
add_filter( 'wp_edit_nav_menu_walker', array( $this, 'change_nav_menu_backend_walker' ), 9, 1 );
|
41 |
+
|
42 |
+
// Register stylesheet and javascript for edit menu page
|
43 |
+
add_action( 'admin_menu' , array( $this, 'enqueue_edit_menu_assests' ) );
|
44 |
+
|
45 |
+
}
|
46 |
+
|
47 |
+
/* Back End
|
48 |
+
==========================================================================*/
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Adds all custom fields to menu item object in back-end
|
52 |
+
*
|
53 |
+
* @param object $menu_item The menu item object
|
54 |
+
*/
|
55 |
+
public function add_custom_nav_item_fields( $menu_item ){
|
56 |
+
|
57 |
+
// Loop through all custom fields and add them to menu item object
|
58 |
+
foreach ( $this->menu_item_fields as $field_id => $field_info ) {
|
59 |
+
$menu_item->{$field_id} = get_post_meta( $menu_item->ID, '_menu_item_' . $field_id , true );
|
60 |
+
}
|
61 |
+
|
62 |
+
return $menu_item;
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Saves and updates the value of custom menu item fields
|
67 |
+
*/
|
68 |
+
public function update_backend_nav_menu_fields( $menu_id, $menu_item_db_id, $args ){
|
69 |
+
|
70 |
+
foreach ( $this->menu_item_fields as $field_id => $field_info ){
|
71 |
+
|
72 |
+
// considering exception for checkbox field
|
73 |
+
if( 'switch' == $field_info['type'] ) {
|
74 |
+
|
75 |
+
if( ! isset( $_POST['menu-item-'. $field_id ][ $menu_item_db_id ] ) ){
|
76 |
+
$_POST['menu-item-'. $field_id ][ $menu_item_db_id ] = '0';
|
77 |
+
} else {
|
78 |
+
$_POST['menu-item-'. $field_id ][ $menu_item_db_id ] = '1';
|
79 |
+
}
|
80 |
+
|
81 |
+
} elseif( ! isset( $_POST['menu-item-'. $field_id ][ $menu_item_db_id ] ) ){
|
82 |
+
$_POST['menu-item-'. $field_id ][ $menu_item_db_id ] = '';
|
83 |
+
}
|
84 |
+
|
85 |
+
// save custom style in custom css file
|
86 |
+
if( 'custom_style' == $field_id ){
|
87 |
+
|
88 |
+
if( $custom_style = $_POST['menu-item-'. $field_id ][ $menu_item_db_id ] ){
|
89 |
+
auxin_add_custom_css( ".menu-item-$menu_item_db_id { $custom_style }", 'menu-item-' . $menu_item_db_id );
|
90 |
+
} else {
|
91 |
+
auxin_remove_custom_css( 'menu-item-' . $menu_item_db_id );
|
92 |
+
}
|
93 |
+
|
94 |
+
}
|
95 |
+
|
96 |
+
update_post_meta( $menu_item_db_id, '_menu_item_'. $field_id , $_POST['menu-item-'. $field_id ][ $menu_item_db_id ] );
|
97 |
+
}
|
98 |
+
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Modifies the walker class of back-end menu editor
|
103 |
+
*/
|
104 |
+
public function change_nav_menu_backend_walker( $walker ){
|
105 |
+
return 'Auxin_Walker_Nav_Menu_Back';
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Loads specific asset files only on edit menu page
|
110 |
+
*/
|
111 |
+
public function enqueue_edit_menu_assests(){
|
112 |
+
global $pagenow;
|
113 |
+
|
114 |
+
if( 'nav-menus.php' == $pagenow ){
|
115 |
+
wp_enqueue_style ( 'auxin-edit-menus-css' , ADMIN_CSS_URL . 'other/edit-menus.css' , NULL, '1.1' );
|
116 |
+
wp_enqueue_script( 'auxin-edit-menus-js' , ADMIN_JS_URL . 'solo/edit-menus.js' , array('jquery'), '1.1', true );
|
117 |
+
}
|
118 |
+
}
|
119 |
+
|
120 |
+
/* Get methods
|
121 |
+
==========================================================================*/
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Magic method to get the value of accessible properties
|
125 |
+
*
|
126 |
+
* @param string The property name
|
127 |
+
* @return string The value of property
|
128 |
+
*/
|
129 |
+
public function __get( $name ){
|
130 |
+
|
131 |
+
// Retrieve the menu item fields from Master Menu class
|
132 |
+
if( 'menu_item_fields' == $name ){
|
133 |
+
return Auxin()->Master_Menu->menu_item_fields;
|
134 |
+
}
|
135 |
+
|
136 |
+
if( property_exists( $this, $name ) ){
|
137 |
+
return $this->$name;
|
138 |
+
}
|
139 |
+
|
140 |
+
return null;
|
141 |
+
}
|
142 |
+
|
143 |
+
/**
|
144 |
+
* Return an instance of this class.
|
145 |
+
*
|
146 |
+
* @return object A single instance of this class.
|
147 |
+
*/
|
148 |
+
public static function get_instance() {
|
149 |
+
|
150 |
+
// If the single instance hasn't been set, set it now.
|
151 |
+
if ( null == self::$instance ) {
|
152 |
+
self::$instance = new self;
|
153 |
+
}
|
154 |
+
return self::$instance;
|
155 |
+
}
|
156 |
+
|
157 |
+
}
|
includes/classes/class-auxin-permalink.php
ADDED
@@ -0,0 +1,268 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class to add permalink setting for post types of theme
|
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 |
+
// no direct access allowed
|
14 |
+
if ( ! defined('ABSPATH') ) {
|
15 |
+
die();
|
16 |
+
}
|
17 |
+
|
18 |
+
/**
|
19 |
+
*
|
20 |
+
*/
|
21 |
+
class Auxin_Permalink {
|
22 |
+
|
23 |
+
public $prefix = "auxin";
|
24 |
+
public $theme_name = "averta";
|
25 |
+
public $option_group = "permalink";
|
26 |
+
public $default_post_types = array();
|
27 |
+
|
28 |
+
|
29 |
+
function __construct() {
|
30 |
+
if( defined('THEME_ID' ) ) $this->prefix = THEME_ID;
|
31 |
+
if( defined('THEME_NAME') ) $this->theme_name = THEME_NAME;
|
32 |
+
|
33 |
+
$this->default_post_types = auxin_registered_post_types(true );
|
34 |
+
}
|
35 |
+
|
36 |
+
|
37 |
+
|
38 |
+
public function setup(){
|
39 |
+
// setup hooks
|
40 |
+
add_action( 'admin_init', array( $this, 'extend_permalinks_page' ) );
|
41 |
+
add_action( 'admin_init', array( $this, 'flush_rewrite_rules_queue') );
|
42 |
+
add_action( 'load-options-permalink.php' , array( $this, 'on_permalink_page' ) );
|
43 |
+
}
|
44 |
+
|
45 |
+
|
46 |
+
|
47 |
+
|
48 |
+
public function on_permalink_page(){
|
49 |
+
|
50 |
+
if( ! $this->default_post_types ){
|
51 |
+
return;
|
52 |
+
}
|
53 |
+
|
54 |
+
$this->add_section();
|
55 |
+
|
56 |
+
foreach ( $this->default_post_types as $post_type ) {
|
57 |
+
$this->add_update_hooks( $post_type );
|
58 |
+
$this->add_posttype_fields( $post_type );
|
59 |
+
}
|
60 |
+
|
61 |
+
// store posted custom permalink slugs
|
62 |
+
foreach ( $this->default_post_types as $post_type ) {
|
63 |
+
|
64 |
+
if( isset( $_POST['submit'] ) && isset( $_POST['_wp_http_referer'] ) ){
|
65 |
+
|
66 |
+
if( strpos( $_POST['_wp_http_referer'],'options-permalink.php' ) !== FALSE ) {
|
67 |
+
|
68 |
+
$single_option_name = $this->prefix.'_'.$post_type.'_structure';
|
69 |
+
|
70 |
+
// get post type structure
|
71 |
+
$structure = trim( esc_attr( $_POST[ $single_option_name ] ) );
|
72 |
+
|
73 |
+
// default permalink structure
|
74 |
+
if( ! $structure ) $structure = $post_type;
|
75 |
+
|
76 |
+
$structure = trim( $structure, '/' );
|
77 |
+
|
78 |
+
update_option( $single_option_name, $structure );
|
79 |
+
|
80 |
+
// get post type object if available
|
81 |
+
$post_type_object = get_post_type_object( $post_type );
|
82 |
+
|
83 |
+
// if post type has archive enabled
|
84 |
+
if( ! empty( $post_type_object ) && $post_type_object->has_archive ){
|
85 |
+
|
86 |
+
$archive_option_name = $this->prefix.'_'.$post_type.'_archive_structure';
|
87 |
+
|
88 |
+
// get post type structure
|
89 |
+
$structure = trim( esc_attr( $_POST[$archive_option_name] ) );
|
90 |
+
|
91 |
+
// default permalink structure
|
92 |
+
if( ! $structure ) $structure = $post_type."/all";
|
93 |
+
|
94 |
+
$structure = trim( $structure, '/' );
|
95 |
+
|
96 |
+
update_option( $archive_option_name, $structure );
|
97 |
+
}
|
98 |
+
}
|
99 |
+
}
|
100 |
+
|
101 |
+
}
|
102 |
+
}
|
103 |
+
|
104 |
+
|
105 |
+
|
106 |
+
|
107 |
+
public function pending_rewrite_rules(){
|
108 |
+
update_option( $this->prefix."_pending_rewrite_rules", 1 );
|
109 |
+
}
|
110 |
+
|
111 |
+
|
112 |
+
|
113 |
+
|
114 |
+
public function flush_rewrite_rules_queue () {
|
115 |
+
|
116 |
+
if( get_option( $this->prefix."_pending_rewrite_rules", 1 ) ){
|
117 |
+
flush_rewrite_rules();
|
118 |
+
update_option( $this->prefix."_pending_rewrite_rules", 0 );
|
119 |
+
}
|
120 |
+
}
|
121 |
+
|
122 |
+
|
123 |
+
|
124 |
+
|
125 |
+
public function extend_permalinks_page(){
|
126 |
+
// Get enabled post types of theme
|
127 |
+
$this->set_current_post_types();
|
128 |
+
// This method fires for just one time
|
129 |
+
$this->set_default_permalink_slugs();
|
130 |
+
}
|
131 |
+
|
132 |
+
|
133 |
+
|
134 |
+
private function set_current_post_types(){
|
135 |
+
$auxin_active_post_types = auxin_get_possible_post_types(true);
|
136 |
+
$this->default_post_types = array_keys( $auxin_active_post_types );
|
137 |
+
}
|
138 |
+
|
139 |
+
|
140 |
+
|
141 |
+
private function add_section(){
|
142 |
+
|
143 |
+
add_settings_section(
|
144 |
+
'auxin_posttypes_permalink_setting_section',
|
145 |
+
sprintf( '<hr /><br />'.__( '%s Permalink Setting', 'auxin-elements' ), $this->theme_name ),
|
146 |
+
array( $this, 'posttypes_permalink_section_callback_function' ),
|
147 |
+
$this->option_group
|
148 |
+
);
|
149 |
+
}
|
150 |
+
|
151 |
+
|
152 |
+
|
153 |
+
|
154 |
+
private function set_default_permalink_slugs(){
|
155 |
+
|
156 |
+
if( get_option( $this->prefix.'_permalink_options_initialized', 0 ) )
|
157 |
+
return;
|
158 |
+
|
159 |
+
|
160 |
+
foreach ( $this->default_post_types as $post_type ) {
|
161 |
+
|
162 |
+
$single_option_name = $this->prefix.'_'.$post_type.'_structure';
|
163 |
+
|
164 |
+
// get post type structure
|
165 |
+
$structure = get_option( $single_option_name, '' );
|
166 |
+
|
167 |
+
// default permalink structure
|
168 |
+
if( ! $structure ) {
|
169 |
+
$structure = ( strpos( $post_type, 'axi_' ) !== FALSE ) ? trim( $post_type, 'axi_' ) : $post_type;
|
170 |
+
}
|
171 |
+
|
172 |
+
$structure = trim( $structure, '/' );
|
173 |
+
update_option( $single_option_name, $structure );
|
174 |
+
|
175 |
+
// get post type object if available
|
176 |
+
$post_type_object = get_post_type_object( $post_type );
|
177 |
+
|
178 |
+
// if post type has archive enabled
|
179 |
+
if( ! empty( $post_type_object ) && $post_type_object->has_archive ){
|
180 |
+
|
181 |
+
$archive_option_name = $this->prefix.'_'.$post_type.'_archive_structure';
|
182 |
+
|
183 |
+
// get post type structure
|
184 |
+
$structure = get_option( $archive_option_name, '' );
|
185 |
+
|
186 |
+
// default permalink structure
|
187 |
+
if( ! $structure ) {
|
188 |
+
$structure = ( strpos( $post_type, 'axi_' ) !== FALSE ) ? trim( $post_type, 'axi_' ) : $post_type;
|
189 |
+
$structure .= '/all';
|
190 |
+
}
|
191 |
+
|
192 |
+
$structure = trim( $structure, '/' );
|
193 |
+
update_option( $archive_option_name, $structure );
|
194 |
+
}
|
195 |
+
}
|
196 |
+
|
197 |
+
update_option( $this->prefix.'_permalink_options_initialized', 1 );
|
198 |
+
}
|
199 |
+
|
200 |
+
|
201 |
+
|
202 |
+
public function add_update_hooks( $post_type ){
|
203 |
+
add_action( 'update_option_'.$this->prefix.'_'.$post_type.'_structure' , array( $this, 'pending_rewrite_rules' ), 10, 2 );
|
204 |
+
|
205 |
+
if( $this->post_type_has_archive( $post_type ) ){
|
206 |
+
add_action( 'update_option_'.$this->prefix.'_'.$post_type.'_archive_structure' , array( $this, 'pending_rewrite_rules' ), 10, 2 );
|
207 |
+
}
|
208 |
+
}
|
209 |
+
|
210 |
+
|
211 |
+
|
212 |
+
|
213 |
+
private function add_posttype_fields( $post_type ){
|
214 |
+
|
215 |
+
add_settings_field( 'auxin_'.$post_type.'_structure',
|
216 |
+
sprintf(__('Setting for <strong>%s single</strong> page', 'auxin-elements' ), $post_type ),
|
217 |
+
array( $this, 'posttypes_permalink_fields_callback_function' ),
|
218 |
+
$this->option_group,
|
219 |
+
'auxin_posttypes_permalink_setting_section',
|
220 |
+
array( 'post_type' => $post_type, 'is_archive' => 'no' )
|
221 |
+
);
|
222 |
+
|
223 |
+
register_setting( $this->option_group,'auxin_'.$post_type.'_structure' );
|
224 |
+
|
225 |
+
if( $this->post_type_has_archive( $post_type ) ){
|
226 |
+
|
227 |
+
add_settings_field( 'auxin_'.$post_type.'_archive_structure',
|
228 |
+
sprintf(__('Setting for <strong>%s archive</strong> page ', 'auxin-elements' ), $post_type),
|
229 |
+
array($this, 'posttypes_permalink_fields_callback_function'),
|
230 |
+
$this->option_group,
|
231 |
+
'auxin_posttypes_permalink_setting_section',
|
232 |
+
array('post_type' => $post_type, 'is_archive' => 'yes')
|
233 |
+
);
|
234 |
+
|
235 |
+
register_setting( $this->option_group,'auxin_'.$post_type.'_archive_structure' );
|
236 |
+
}
|
237 |
+
}
|
238 |
+
|
239 |
+
|
240 |
+
|
241 |
+
public function posttypes_permalink_section_callback_function(){
|
242 |
+
_e('These settings control the permalinks used for theme\'s post types. These settings only apply when <strong>not using "default" permalink structure.</strong>.', 'auxin-elements' );
|
243 |
+
echo "<br /><br />";
|
244 |
+
}
|
245 |
+
|
246 |
+
|
247 |
+
|
248 |
+
|
249 |
+
public function posttypes_permalink_fields_callback_function( $options ) {
|
250 |
+
|
251 |
+
$post_type_obj = get_post_type_object( $options['post_type'] );
|
252 |
+
|
253 |
+
$suffix = $options['is_archive'] == 'yes' ? '_archive_structure' : '_structure';
|
254 |
+
$output_suffix = $options['is_archive'] == 'yes' ? '' : '<code>/' . __( 'sample-post', 'auxin-elements' ).'/</code>';
|
255 |
+
|
256 |
+
$option_id = $this->prefix.'_'.$options['post_type'].$suffix;
|
257 |
+
$val = get_option( $option_id );
|
258 |
+
|
259 |
+
printf( '<code>%1$s/</code><input id="%2$s" name="%2$s" type="text" value="%3$s" />%4$s', home_url(), $option_id, $val, $output_suffix );
|
260 |
+
}
|
261 |
+
|
262 |
+
|
263 |
+
private function post_type_has_archive( $post_type ){
|
264 |
+
$post_type_object = get_post_type_object( $post_type );
|
265 |
+
return ! empty( $post_type_object ) && $post_type_object->has_archive;
|
266 |
+
}
|
267 |
+
|
268 |
+
}
|
includes/classes/class-auxin-plugin-requirements.php
ADDED
@@ -0,0 +1,297 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if( ! class_exists( 'Auxin_Plugin_Requirements' ) ){
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Checks the requirements for a plugin
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class Auxin_Plugin_Requirements {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* An array containing the list of requirements
|
13 |
+
*
|
14 |
+
* @var array
|
15 |
+
*/
|
16 |
+
public $requirements = array();
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Whether the requirements are available or not
|
20 |
+
*
|
21 |
+
* @var boolean
|
22 |
+
*/
|
23 |
+
private $requirements_passed = true;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Collects error notices
|
27 |
+
*
|
28 |
+
* @var array
|
29 |
+
*/
|
30 |
+
public $admin_notices = array();
|
31 |
+
|
32 |
+
|
33 |
+
|
34 |
+
function __construct(){
|
35 |
+
add_action( 'admin_notices' , array( $this, 'admin_notices' ) );
|
36 |
+
add_action( 'activated_plugin' , array( $this, 'update_plugins_dependencies' ) );
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Make sure the client has required PHP version, otherwise, throw a notice
|
41 |
+
*
|
42 |
+
* @return void
|
43 |
+
*/
|
44 |
+
public function admin_notices(){
|
45 |
+
if( $notices = implode( '</li><li>', $this->admin_notices ) ) {
|
46 |
+
echo '<div class="error aux-admin-error"><p>';
|
47 |
+
printf(
|
48 |
+
__( '%s plugin has been disabled automatically due to following reason:', 'auxin-elements' ),
|
49 |
+
'<strong>'. $this->requirements['config']['plugin_name'] . '</strong>'
|
50 |
+
);
|
51 |
+
echo '<ul><li>'. $notices . '</li></ul></p></div>';
|
52 |
+
}
|
53 |
+
|
54 |
+
if( $this->requirements['config']['debug'] ){
|
55 |
+
$active_plugins = get_option( 'active_plugins' );
|
56 |
+
echo "<pre>"; print_r( $active_plugins ); echo "</pre>";
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Wrapper around the core WP get_plugins function, making sure it's actually available.
|
62 |
+
*
|
63 |
+
* @return array Array of installed plugins with plugin information.
|
64 |
+
*/
|
65 |
+
public function get_plugins() {
|
66 |
+
if ( ! function_exists( 'get_plugins' ) ) {
|
67 |
+
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
68 |
+
}
|
69 |
+
|
70 |
+
return get_plugins();
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Check whether a plugin is active.
|
75 |
+
*
|
76 |
+
* @param string $plugin Base plugin path from plugins directory.
|
77 |
+
*
|
78 |
+
* @return bool True, if in the active plugins list. False, not in the list.
|
79 |
+
*/
|
80 |
+
function is_plugin_active( $plugin ) {
|
81 |
+
|
82 |
+
if ( ! function_exists( 'is_plugin_active' ) ) {
|
83 |
+
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
84 |
+
}
|
85 |
+
return is_plugin_active( $plugin );
|
86 |
+
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Load the dependency plugins before the current plugin
|
91 |
+
*
|
92 |
+
* @return void
|
93 |
+
*/
|
94 |
+
function update_plugins_dependencies(){
|
95 |
+
|
96 |
+
if( empty( $this->requirements['plugins'] ) ){
|
97 |
+
return;
|
98 |
+
}
|
99 |
+
|
100 |
+
if( $plugin_requirements = $this->requirements['plugins'] ){
|
101 |
+
|
102 |
+
// Walk through the plugins
|
103 |
+
foreach ( $plugin_requirements as $plugin_requirement ) {
|
104 |
+
|
105 |
+
// Make sure if the plugin is expected to be loaded prior to our main plugin
|
106 |
+
if( ! empty( $plugin_requirement['dependency'] ) && true == $plugin_requirement['dependency'] && $this->is_plugin_active( $plugin_requirement['basename'] ) ){
|
107 |
+
// Get all activated plugins
|
108 |
+
$active_plugins = get_option( 'active_plugins' );
|
109 |
+
|
110 |
+
// Get the load orders
|
111 |
+
$this_plugin_load_order = array_search( $this->requirements['config']['plugin_basename'], $active_plugins );
|
112 |
+
$dependency_plugin_load_order = array_search( $plugin_requirement['basename'], $active_plugins );
|
113 |
+
|
114 |
+
// Replace the orders and update the order list
|
115 |
+
if( $dependency_plugin_load_order > $this_plugin_load_order ){
|
116 |
+
$sliced_basename = array_splice( $active_plugins, $this_plugin_load_order , 1 );
|
117 |
+
array_splice( $active_plugins, $dependency_plugin_load_order , 0, $sliced_basename );
|
118 |
+
update_option( 'active_plugins', $active_plugins );
|
119 |
+
}
|
120 |
+
|
121 |
+
}
|
122 |
+
|
123 |
+
}
|
124 |
+
|
125 |
+
}
|
126 |
+
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Check plugin requirements
|
131 |
+
*
|
132 |
+
* @return void
|
133 |
+
*/
|
134 |
+
function check_plugins_requirement(){
|
135 |
+
|
136 |
+
if( empty( $this->requirements['plugins'] ) ){
|
137 |
+
return;
|
138 |
+
}
|
139 |
+
|
140 |
+
if( $plugin_requirements = $this->requirements['plugins'] ){
|
141 |
+
if ( ! wp_installing() || 'wp-activate.php' === $pagenow ) {
|
142 |
+
|
143 |
+
// Walk through the plugins
|
144 |
+
foreach ( $plugin_requirements as $plugin_requirement ) {
|
145 |
+
|
146 |
+
// check if the plugin is active
|
147 |
+
$is_plugin_active = $this->is_plugin_active( $plugin_requirement['basename'] );
|
148 |
+
|
149 |
+
// if activating the plugin is required
|
150 |
+
if(
|
151 |
+
( ! empty( $plugin_requirement['required'] ) && true == $plugin_requirement['required'] && ! $is_plugin_active ) ||
|
152 |
+
( ! empty( $plugin_requirement['is_callable'] ) && ! function_exists( $plugin_requirement['is_callable'] ) )
|
153 |
+
){
|
154 |
+
|
155 |
+
$this->admin_notices[] = sprintf(
|
156 |
+
__( '%s plugin is required in order to use this plugin. Please install and activate the plugin.', 'auxin-elements' ),
|
157 |
+
'<strong>'. $plugin_requirement['name'] . '</strong>'
|
158 |
+
);
|
159 |
+
|
160 |
+
$this->requirements_passed = false;
|
161 |
+
|
162 |
+
// if minimum plugin version was specified
|
163 |
+
} elseif( ! empty( $plugin_requirement['version'] ) && $is_plugin_active ){
|
164 |
+
|
165 |
+
$all_plugins = $this->get_plugins();
|
166 |
+
|
167 |
+
if( empty( $all_plugins[ $plugin_requirement['basename'] ]['Version'] ) ){
|
168 |
+
continue;
|
169 |
+
}
|
170 |
+
|
171 |
+
$current_plugin_version = $all_plugins[ $plugin_requirement['basename'] ]['Version'];
|
172 |
+
|
173 |
+
if ( version_compare( $current_plugin_version, $plugin_requirement['version'], '<' ) ) {
|
174 |
+
|
175 |
+
$this->admin_notices[] = sprintf(
|
176 |
+
__( 'The plugin requires %s plugin version %s or higher (current version is %s). Please update it to the latest version.', 'auxin-elements' ),
|
177 |
+
'<strong>'. $plugin_requirement['name'] . '</strong>',
|
178 |
+
'<strong>'. $plugin_requirement['version'] . '</strong>',
|
179 |
+
'<strong>'. $current_plugin_version . '</strong>'
|
180 |
+
);
|
181 |
+
|
182 |
+
$this->requirements_passed = false;
|
183 |
+
}
|
184 |
+
|
185 |
+
}
|
186 |
+
|
187 |
+
}
|
188 |
+
|
189 |
+
}
|
190 |
+
|
191 |
+
}
|
192 |
+
|
193 |
+
}
|
194 |
+
|
195 |
+
/**
|
196 |
+
* Check them requirements
|
197 |
+
*
|
198 |
+
* @return void
|
199 |
+
*/
|
200 |
+
function check_theme_requirement(){
|
201 |
+
|
202 |
+
if( empty( $this->requirements['themes'] ) ){
|
203 |
+
return;
|
204 |
+
}
|
205 |
+
|
206 |
+
if( $theme_requirements = $this->requirements['themes'] ){
|
207 |
+
|
208 |
+
// Walk through the themes
|
209 |
+
foreach ( $theme_requirements as $theme_requirement ) {
|
210 |
+
|
211 |
+
if (
|
212 |
+
( ! empty( $theme_requirement['file_exists'] ) && ! file_exists( $theme_requirement['file_exists'] ) ) ||
|
213 |
+
( ! empty( $theme_requirement['is_callable'] ) && ! function_exists( $theme_requirement['is_callable'] ) )
|
214 |
+
){
|
215 |
+
|
216 |
+
$this->admin_notices[] = sprintf(
|
217 |
+
__( '%s theme is required in order to use this plugin. Please install and activate the theme.', 'auxin-elements' ),
|
218 |
+
'<strong>'. $theme_requirement['name'] . '</strong>'
|
219 |
+
);
|
220 |
+
|
221 |
+
$this->requirements_passed = false;
|
222 |
+
return;
|
223 |
+
|
224 |
+
} elseif ( $theme_requirement['version'] ){
|
225 |
+
|
226 |
+
$theme_data = wp_get_theme();
|
227 |
+
$theme_data = $theme_data->parent() ? $theme_data->parent() : $theme_data;
|
228 |
+
|
229 |
+
if ( version_compare( $theme_data->Version, $theme_requirement['version'], '<' ) ) {
|
230 |
+
|
231 |
+
$this->admin_notices[] = sprintf(
|
232 |
+
__( 'The plugin requires %s theme version %s or higher in order to function property. Your current theme version is %s, please update it to the latest version.', 'auxin-elements' ),
|
233 |
+
'<strong>'. $theme_requirement['name'] . '</strong>',
|
234 |
+
'<strong>'. $theme_requirement['version'] . '</strong>',
|
235 |
+
'<strong>'. $theme_data->Version . '</strong>'
|
236 |
+
);
|
237 |
+
|
238 |
+
$this->requirements_passed = false;
|
239 |
+
return;
|
240 |
+
}
|
241 |
+
|
242 |
+
}
|
243 |
+
|
244 |
+
}
|
245 |
+
|
246 |
+
}
|
247 |
+
|
248 |
+
}
|
249 |
+
|
250 |
+
/**
|
251 |
+
* Check PHP requirements
|
252 |
+
*
|
253 |
+
* @return void
|
254 |
+
*/
|
255 |
+
function check_php_requirement(){
|
256 |
+
|
257 |
+
if( empty( $this->requirements['php']['version'] ) ){
|
258 |
+
return;
|
259 |
+
}
|
260 |
+
|
261 |
+
if ( version_compare( PHP_VERSION, $this->requirements['php']['version'], '<' ) ) {
|
262 |
+
|
263 |
+
$this->admin_notices[] = sprintf(
|
264 |
+
__( 'PHP version %s or above is required for this plugin while your the current PHP version is %s.', 'auxin-elements' ),
|
265 |
+
'<strong>'. $this->requirements['php']['version'] . '</strong>',
|
266 |
+
'<strong>'. PHP_VERSION . '</strong>'
|
267 |
+
);
|
268 |
+
|
269 |
+
$this->requirements_passed = false;
|
270 |
+
return;
|
271 |
+
}
|
272 |
+
|
273 |
+
}
|
274 |
+
|
275 |
+
/**
|
276 |
+
* Checks all requirements
|
277 |
+
*
|
278 |
+
* @return string|boolean True if all requirements are passed, false or error message on failure
|
279 |
+
*/
|
280 |
+
public function validate(){
|
281 |
+
|
282 |
+
$this->check_php_requirement();
|
283 |
+
|
284 |
+
if( true !== $this->requirements_passed ){ return $this->requirements_passed; }
|
285 |
+
|
286 |
+
$this->check_theme_requirement();
|
287 |
+
|
288 |
+
if( true !== $this->requirements_passed ){ return $this->requirements_passed; }
|
289 |
+
|
290 |
+
$this->check_plugins_requirement();
|
291 |
+
|
292 |
+
return $this->requirements_passed;
|
293 |
+
}
|
294 |
+
|
295 |
+
}
|
296 |
+
|
297 |
+
}
|
includes/classes/class-auxin-post-type-base.php
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Add new post type and corresponding taxonomies
|
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 |
+
// no direct access allowed
|
14 |
+
if ( ! defined('ABSPATH') ) exit;
|
15 |
+
|
16 |
+
|
17 |
+
if( ! class_exists( 'Auxin_Post_Type_Base' ) ){
|
18 |
+
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Register custom post type and taxonomies
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
class Auxin_Post_Type_Base {
|
25 |
+
|
26 |
+
/**
|
27 |
+
* The custom post type name
|
28 |
+
*
|
29 |
+
* @var string
|
30 |
+
*/
|
31 |
+
protected $post_type = '';
|
32 |
+
|
33 |
+
/**
|
34 |
+
* The instance of WP_Post_Type class
|
35 |
+
*
|
36 |
+
* @var WP_Post_Type
|
37 |
+
*/
|
38 |
+
private $wp_post_type;
|
39 |
+
|
40 |
+
|
41 |
+
function __construct( $post_type = '' ) {
|
42 |
+
|
43 |
+
if( ! empty( $post_type ) ){
|
44 |
+
$this->post_type = $post_type;
|
45 |
+
}
|
46 |
+
if( ! $this->post_type ){
|
47 |
+
return;
|
48 |
+
}
|
49 |
+
|
50 |
+
// Register the post type and get corresponding WP_Post_Type instance
|
51 |
+
$this->wp_post_type = $this->register_post_type();
|
52 |
+
|
53 |
+
// Add taxonomies
|
54 |
+
add_action( 'init', array( $this, 'register_taxonomies' ), 0 );
|
55 |
+
|
56 |
+
// Filter the list of columns to print on the manage posts screen
|
57 |
+
add_filter( "manage_edit-{$this->post_type}_columns", array( $this, 'manage_edit_columns' ) );
|
58 |
+
|
59 |
+
// Filter the list of columns shown when listing posts of the post type
|
60 |
+
add_action( "manage_{$this->post_type}_posts_custom_column", array( $this, 'manage_posttype_custom_columns' ) );
|
61 |
+
}
|
62 |
+
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Retrieves/Returns the instance of WP_Post_Type class instead of current class
|
66 |
+
*
|
67 |
+
* @return void
|
68 |
+
*/
|
69 |
+
public function __toString(){
|
70 |
+
return $this->wp_post_type;
|
71 |
+
}
|
72 |
+
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Register post type
|
76 |
+
*
|
77 |
+
* @return void
|
78 |
+
*/
|
79 |
+
public function register_post_type() { }
|
80 |
+
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Register taxonomies
|
84 |
+
*
|
85 |
+
* @return void
|
86 |
+
*/
|
87 |
+
public function register_taxonomies() { }
|
88 |
+
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Customizing post type list Columns
|
92 |
+
*
|
93 |
+
* @param array $column An array of column name => label
|
94 |
+
* @return array List of columns shown when listing posts of the post type
|
95 |
+
*/
|
96 |
+
public function manage_edit_columns( $columns ){ }
|
97 |
+
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Applied to the list of columns to print on the manage posts screen for current post type
|
101 |
+
*
|
102 |
+
* @param array $column An array of column name => label
|
103 |
+
* @return array List of columns shown when listing posts of the post type
|
104 |
+
*/
|
105 |
+
function manage_posttype_custom_columns( $column ){ }
|
106 |
+
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Remove featured image box
|
110 |
+
*
|
111 |
+
* @return void
|
112 |
+
*/
|
113 |
+
public function remove_thumbnail_box(){
|
114 |
+
remove_meta_box( 'postimagediv', $this->post_type, 'side' );
|
115 |
+
}
|
116 |
+
|
117 |
+
}
|
118 |
+
|
119 |
+
|
120 |
+
}
|
includes/classes/class-auxin-siteorigin-widget.php
CHANGED
@@ -226,7 +226,7 @@ class Auxin_SiteOrigin_Widget extends SiteOrigin_Widget {
|
|
226 |
if( function_exists( $this->widget_fun_name ) ){
|
227 |
return call_user_func( $this->widget_fun_name, $instance );
|
228 |
} else {
|
229 |
-
auxin_error( __('The callback for widget does not exists.',
|
230 |
}
|
231 |
}
|
232 |
|
226 |
if( function_exists( $this->widget_fun_name ) ){
|
227 |
return call_user_func( $this->widget_fun_name, $instance );
|
228 |
} else {
|
229 |
+
auxin_error( __('The callback for widget does not exists.', 'auxin-elements') );
|
230 |
}
|
231 |
}
|
232 |
|
includes/classes/class-auxin-walker-nav-menu-back.php
ADDED
@@ -0,0 +1,384 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Create HTML list of custom nav menu input items.
|
4 |
+
*
|
5 |
+
*
|
6 |
+
* @package Auxin
|
7 |
+
* @license LICENSE.txt
|
8 |
+
* @author
|
9 |
+
* @link http://averta.net/phlox/
|
10 |
+
* @copyright (c) 2010-2017
|
11 |
+
*/
|
12 |
+
class Auxin_Walker_Nav_Menu_Back extends Walker_Nav_Menu {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* List of custom meta fields for menu items
|
16 |
+
*
|
17 |
+
* @var array
|
18 |
+
*/
|
19 |
+
protected $menu_item_fields;
|
20 |
+
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Starts the list before the elements are added.
|
24 |
+
*
|
25 |
+
* @see Walker_Nav_Menu::start_lvl()
|
26 |
+
*
|
27 |
+
* @since 3.0.0
|
28 |
+
*
|
29 |
+
* @param string $output Passed by reference.
|
30 |
+
* @param int $depth Depth of menu item. Used for padding.
|
31 |
+
* @param array $args Not used.
|
32 |
+
*/
|
33 |
+
public function start_lvl( &$output, $depth = 0, $args = array() ) {}
|
34 |
+
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Ends the list of after the elements are added.
|
38 |
+
*
|
39 |
+
* @see Walker_Nav_Menu::end_lvl()
|
40 |
+
*
|
41 |
+
* @since 3.0.0
|
42 |
+
*
|
43 |
+
* @param string $output Passed by reference.
|
44 |
+
* @param int $depth Depth of menu item. Used for padding.
|
45 |
+
* @param array $args Not used.
|
46 |
+
*/
|
47 |
+
public function end_lvl( &$output, $depth = 0, $args = array() ) {}
|
48 |
+
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Start the element output.
|
52 |
+
*
|
53 |
+
* @see Walker_Nav_Menu::start_el()
|
54 |
+
* @since 3.0.0
|
55 |
+
*
|
56 |
+
* @global int $_wp_nav_menu_max_depth
|
57 |
+
*
|
58 |
+
* @param string $output Passed by reference. Used to append additional content.
|
59 |
+
* @param object $item Menu item data object.
|
60 |
+
* @param int $depth Depth of menu item. Used for padding.
|
61 |
+
* @param array $args Not used.
|
62 |
+
* @param int $id Not used.
|
63 |
+
*/
|
64 |
+
public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
|
65 |
+
|
66 |
+
$this->menu_item_fields = Auxin_Master_Nav_Menu::get_instance()->menu_item_fields; //@Edit
|
67 |
+
|
68 |
+
global $_wp_nav_menu_max_depth;
|
69 |
+
$_wp_nav_menu_max_depth = $depth > $_wp_nav_menu_max_depth ? $depth : $_wp_nav_menu_max_depth;
|
70 |
+
|
71 |
+
ob_start();
|
72 |
+
$item_id = esc_attr( $item->ID );
|
73 |
+
$removed_args = array(
|
74 |
+
'action',
|
75 |
+
'customlink-tab',
|
76 |
+
'edit-menu-item',
|
77 |
+
'menu-item',
|
78 |
+
'page-tab',
|
79 |
+
'_wpnonce',
|
80 |
+
);
|
81 |
+
|
82 |
+
$original_title = '';
|
83 |
+
if ( 'taxonomy' == $item->type ) {
|
84 |
+
$original_title = get_term_field( 'name', $item->object_id, $item->object, 'raw' );
|
85 |
+
if ( is_wp_error( $original_title ) )
|
86 |
+
$original_title = false;
|
87 |
+
} elseif ( 'post_type' == $item->type ) {
|
88 |
+
$original_object = get_post( $item->object_id );
|
89 |
+
$original_title = get_the_title( $original_object->ID );
|
90 |
+
}
|
91 |
+
|
92 |
+
$classes = array(
|
93 |
+
'menu-item menu-item-depth-' . $depth,
|
94 |
+
'menu-item-' . esc_attr( $item->object ),
|
95 |
+
'menu-item-edit-' . ( ( isset( $_GET['edit-menu-item'] ) && $item_id == $_GET['edit-menu-item'] ) ? 'active' : 'inactive'),
|
96 |
+
);
|
97 |
+
|
98 |
+
$title = $item->title;
|
99 |
+
|
100 |
+
if ( ! empty( $item->_invalid ) ) {
|
101 |
+
$classes[] = 'menu-item-invalid';
|
102 |
+
/* translators: %s: title of menu item which is invalid */
|
103 |
+
$title = sprintf( __( '%s (Invalid)', 'auxin-elements' ), $item->title );
|
104 |
+
} elseif ( isset( $item->post_status ) && 'draft' == $item->post_status ) {
|
105 |
+
$classes[] = 'pending';
|
106 |
+
/* translators: %s: title of menu item in draft status */
|
107 |
+
$title = sprintf( __('%s (Pending)', 'auxin-elements'), $item->title );
|
108 |
+
}
|
109 |
+
|
110 |
+
$title = ( ! isset( $item->label ) || '' == $item->label ) ? $title : $item->label;
|
111 |
+
|
112 |
+
$submenu_text = '';
|
113 |
+
if ( 0 == $depth )
|
114 |
+
$submenu_text = 'style="display: none;"';
|
115 |
+
|
116 |
+
?>
|
117 |
+
<li id="menu-item-<?php echo $item_id; ?>" class="<?php echo esc_attr( implode(' ', $classes ) ); ?>">
|
118 |
+
<div class="menu-item-bar">
|
119 |
+
<div class="menu-item-handle">
|
120 |
+
<span class="item-title">
|
121 |
+
<span class="menu-item-title"><?php echo esc_html( $title ); ?></span>
|
122 |
+
<span class="is-submenu" <?php echo $submenu_text; ?>><?php _e( 'sub item', 'auxin-elements' ); ?></span>
|
123 |
+
</span>
|
124 |
+
<span class="item-controls">
|
125 |
+
<span class="item-type"><?php echo esc_html( $item->type_label ); ?></span>
|
126 |
+
|
127 |
+
<span class="item-type aux-mm-mega-badge"><?php _e( 'Mega' , 'auxin-elements' ); //@Edit ?></span>
|
128 |
+
<span class="item-type aux-mm-col-badge" ><?php _e( 'Column', 'auxin-elements' ); //@Edit ?></span>
|
129 |
+
|
130 |
+
<span class="item-order hide-if-js">
|
131 |
+
<a href="<?php
|
132 |
+
echo wp_nonce_url(
|
133 |
+
add_query_arg(
|
134 |
+
array(
|
135 |
+
'action' => 'move-up-menu-item',
|
136 |
+
'menu-item' => $item_id,
|
137 |
+
),
|
138 |
+
remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) )
|
139 |
+
),
|
140 |
+
'move-menu_item'
|
141 |
+
);
|
142 |
+
?>" class="item-move-up"><abbr title="<?php esc_attr_e('Move up', 'auxin-elements'); ?>">↑</abbr></a>
|
143 |
+
|
|
144 |
+
<a href="<?php
|
145 |
+
echo wp_nonce_url(
|
146 |
+
add_query_arg(
|
147 |
+
array(
|
148 |
+
'action' => 'move-down-menu-item',
|
149 |
+
'menu-item' => $item_id,
|
150 |
+
),
|
151 |
+
remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) )
|
152 |
+
),
|
153 |
+
'move-menu_item'
|
154 |
+
);
|
155 |
+
?>" class="item-move-down"><abbr title="<?php esc_attr_e('Move down', 'auxin-elements'); ?>">↓</abbr></a>
|
156 |
+
</span>
|
157 |
+
<a class="item-edit" id="edit-<?php echo $item_id; ?>" title="<?php esc_attr_e('Edit Menu Item', 'auxin-elements'); ?>" href="<?php
|
158 |
+
echo ( isset( $_GET['edit-menu-item'] ) && $item_id == $_GET['edit-menu-item'] ) ? admin_url( 'nav-menus.php' ) : add_query_arg( 'edit-menu-item', $item_id, remove_query_arg( $removed_args, admin_url( 'nav-menus.php#menu-item-settings-' . $item_id ) ) );
|
159 |
+
?>"><?php _e( 'Edit Menu Item', 'auxin-elements' ); ?></a>
|
160 |
+
</span>
|
161 |
+
</div>
|
162 |
+
</div>
|
163 |
+
|
164 |
+
<div class="menu-item-settings wp-clearfix" id="menu-item-settings-<?php echo $item_id; ?>">
|
165 |
+
<?php if ( 'custom' == $item->type ) : ?>
|
166 |
+
<p class="field-url `ption description-wide">
|
167 |
+
<label for="edit-menu-item-url-<?php echo $item_id; ?>">
|
168 |
+
<?php _e( 'URL', 'auxin-elements' ); ?><br />
|
169 |
+
<input type="text" id="edit-menu-item-url-<?php echo $item_id; ?>" class="widefat code edit-menu-item-url" name="menu-item-url[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->url ); ?>" />
|
170 |
+
</label>
|
171 |
+
</p>
|
172 |
+
<?php endif; ?>
|
173 |
+
<p class="description description-wide">
|
174 |
+
<label for="edit-menu-item-title-<?php echo $item_id; ?>">
|
175 |
+
<?php _e( 'Navigation Label', 'auxin-elements' ); ?><br />
|
176 |
+
<input type="text" id="edit-menu-item-title-<?php echo $item_id; ?>" class="widefat edit-menu-item-title" name="menu-item-title[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->title ); ?>" />
|
177 |
+
</label>
|
178 |
+
</p>
|
179 |
+
<p class="field-title-attribute description description-wide">
|
180 |
+
<label for="edit-menu-item-attr-title-<?php echo $item_id; ?>">
|
181 |
+
<?php _e( 'Title Attribute', 'auxin-elements' ); ?><br />
|
182 |
+
<input type="text" id="edit-menu-item-attr-title-<?php echo $item_id; ?>" class="widefat edit-menu-item-attr-title" name="menu-item-attr-title[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->post_excerpt ); ?>" />
|
183 |
+
</label>
|
184 |
+
</p>
|
185 |
+
<p class="field-link-target description">
|
186 |
+
<label for="edit-menu-item-target-<?php echo $item_id; ?>">
|
187 |
+
<input type="checkbox" id="edit-menu-item-target-<?php echo $item_id; ?>" value="_blank" name="menu-item-target[<?php echo $item_id; ?>]"<?php checked( $item->target, '_blank' ); ?> />
|
188 |
+
<?php _e( 'Open link in a new window/tab', 'auxin-elements' ); ?>
|
189 |
+
</label>
|
190 |
+
</p>
|
191 |
+
<p class="field-css-classes description description-thin">
|
192 |
+
<label for="edit-menu-item-classes-<?php echo $item_id; ?>">
|
193 |
+
<?php _e( 'CSS Classes (optional)', 'auxin-elements' ); ?><br />
|
194 |
+
<input type="text" id="edit-menu-item-classes-<?php echo $item_id; ?>" class="widefat code edit-menu-item-classes" name="menu-item-classes[<?php echo $item_id; ?>]" value="<?php echo esc_attr( implode(' ', $item->classes ) ); ?>" />
|
195 |
+
</label>
|
196 |
+
</p>
|
197 |
+
<p class="field-xfn description description-thin">
|
198 |
+
<label for="edit-menu-item-xfn-<?php echo $item_id; ?>">
|
199 |
+
<?php _e( 'Link Relationship (XFN)', 'auxin-elements' ); ?><br />
|
200 |
+
<input type="text" id="edit-menu-item-xfn-<?php echo $item_id; ?>" class="widefat code edit-menu-item-xfn" name="menu-item-xfn[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->xfn ); ?>" />
|
201 |
+
</label>
|
202 |
+
</p>
|
203 |
+
<p class="field-description description description-wide">
|
204 |
+
<label for="edit-menu-item-description-<?php echo $item_id; ?>">
|
205 |
+
<?php _e( 'Description', 'auxin-elements' ); ?><br />
|
206 |
+
<textarea id="edit-menu-item-description-<?php echo $item_id; ?>" class="widefat edit-menu-item-description" rows="3" cols="20" name="menu-item-description[<?php echo $item_id; ?>]"><?php echo esc_html( $item->description ); // textarea_escaped ?></textarea>
|
207 |
+
<span class="description"><?php _e('The description will be displayed in the menu if the current theme supports it.', 'auxin-elements'); ?></span>
|
208 |
+
</label>
|
209 |
+
</p>
|
210 |
+
|
211 |
+
|
212 |
+
|
213 |
+
<div class="aux-master-menu-setting-wrapper">
|
214 |
+
<?php
|
215 |
+
foreach ( $this->menu_item_fields as $field_id => $field_info ) {
|
216 |
+
|
217 |
+
if( ! isset( $field_info['min_depth'] ) ){
|
218 |
+
$field_info['min_depth'] = 0;
|
219 |
+
}
|
220 |
+
if( ! isset( $field_info['max_depth'] ) ){
|
221 |
+
$field_info['max_depth'] = 100;
|
222 |
+
}
|
223 |
+
|
224 |
+
// skip if it does not meet minimum or maximum depth requirements
|
225 |
+
if( (int)$field_info['min_depth'] > $depth || (int)$field_info['max_depth'] < $depth ){
|
226 |
+
//continue;
|
227 |
+
}
|
228 |
+
|
229 |
+
if( ! isset( $field_info['type'] ) ){
|
230 |
+
$field_info['type'] = 'text';
|
231 |
+
}
|
232 |
+
|
233 |
+
if( ! isset( $field_info['default'] ) ){
|
234 |
+
$field_info['default'] = '';
|
235 |
+
}
|
236 |
+
|
237 |
+
$data_depth = 'data-min-depth="' . $field_info['min_depth'] . '" ';
|
238 |
+
$data_depth .= 'data-max-depth="' . $field_info['max_depth'] . '" ';
|
239 |
+
|
240 |
+
switch ( $field_info['type'] ) {
|
241 |
+
|
242 |
+
case 'switch':
|
243 |
+
|
244 |
+
$field_info['type'] = 'checkbox';
|
245 |
+
?>
|
246 |
+
<p class="field-<?php echo $field_id; ?> description aux-mm-setting-field-<?php echo $field_info['type']; ?> aux-mm-setting-<?php echo $field_id; ?>" <?php echo $data_depth; ?> >
|
247 |
+
<label for="edit-menu-item-<?php echo $field_id; ?>-<?php echo $item_id; ?>">
|
248 |
+
<input type="checkbox" id="edit-menu-item-<?php echo $field_id; ?>-<?php echo $item_id; ?>" name="menu-item-<?php echo $field_id; ?>[<?php echo $item_id; ?>]" <?php checked( $item->{$field_id}, '1' ); ?> />
|
249 |
+
<?php echo $field_info['label']; ?>
|
250 |
+
</label>
|
251 |
+
</p>
|
252 |
+
|
253 |
+
<?php
|
254 |
+
break;
|
255 |
+
|
256 |
+
case 'select':
|
257 |
+
|
258 |
+
if( ! isset( $field_info['choices'] ) ){
|
259 |
+
$field_info['choices'] = array();
|
260 |
+
}
|
261 |
+
?>
|
262 |
+
<p class="field-<?php echo $field_id; ?> description aux-mm-setting-field-<?php echo $field_info['type']; ?> aux-mm-setting-<?php echo $field_id; ?>" <?php echo $data_depth; ?> >
|
263 |
+
<label for="edit-menu-item-<?php echo $field_id; ?>-<?php echo $item_id; ?>">
|
264 |
+
<select id="edit-menu-item-<?php echo $field_id; ?>-<?php echo $item_id; ?>" name="menu-item-<?php echo $field_id; ?>[<?php echo $item_id; ?>]" >
|
265 |
+
<?php
|
266 |
+
foreach ( $field_info['choices'] as $choice_id => $choice_value ) {
|
267 |
+
echo '<option value="'. $choice_id .'" ' .selected( $item->{$field_id}, $choice_id, false ) .' >'. $choice_value . '</option>';
|
268 |
+
}
|
269 |
+
?>
|
270 |
+
</select>
|
271 |
+
<?php echo $field_info['label']; ?>
|
272 |
+
</label>
|
273 |
+
</p>
|
274 |
+
|
275 |
+
<?php
|
276 |
+
break;
|
277 |
+
|
278 |
+
case 'icon':
|
279 |
+
$font_icons = Auxin()->Font_Icons->get_icons_list('fontastic');
|
280 |
+
|
281 |
+
if( ! isset( $field_info['choices'] ) ){
|
282 |
+
$field_info['choices'] = array();
|
283 |
+
}
|
284 |
+
?>
|
285 |
+
<p class="field-<?php echo $field_id; ?> description aux-mm-setting-field-<?php echo $field_info['type']; ?> aux-mm-setting-<?php echo $field_id; ?>" <?php echo $data_depth; ?> >
|
286 |
+
<label for="edit-menu-item-<?php echo $field_id; ?>-<?php echo $item_id; ?>">
|
287 |
+
<select id="edit-menu-item-<?php echo $field_id; ?>-<?php echo $item_id; ?>" name="menu-item-<?php echo $field_id; ?>[<?php echo $item_id; ?>]" class="aux-fonticonpicker" >
|
288 |
+
<?php
|
289 |
+
echo '<option value="">' . __( 'Choose', 'auxin-elements' ) . '</option>';
|
290 |
+
|
291 |
+
if( is_array( $font_icons ) ){
|
292 |
+
foreach ( $font_icons as $icon ) {
|
293 |
+
$icon_id = trim( $icon->classname, '.' );
|
294 |
+
echo '<option value="'. $icon_id .'" '. selected( $item->{$field_id}, $icon_id, false ) .' >'. $icon->name . '</option>';
|
295 |
+
}
|
296 |
+
}
|
297 |
+
?>
|
298 |
+
</select>
|
299 |
+
<?php echo $field_info['label']; ?>
|
300 |
+
</label>
|
301 |
+
</p>
|
302 |
+
|
303 |
+
<?php
|
304 |
+
break;
|
305 |
+
|
306 |
+
case 'textarea':
|
307 |
+
?>
|
308 |
+
<p class="field-<?php echo $field_id; ?> description description-wide aux-mm-setting-field-<?php echo $field_info['type']; ?> aux-mm-setting-<?php echo $field_id; ?>" <?php echo $data_depth; ?> >
|
309 |
+
<label for="edit-menu-item-<?php echo $field_id; ?>-<?php echo $item_id; ?>">
|
310 |
+
<?php echo $field_info['label']; ?><br />
|
311 |
+
<textarea id="edit-menu-item-<?php echo $field_id; ?>-<?php echo $item_id; ?>" class="widefat edit-menu-item-<?php echo $field_id; ?>" rows="3" cols="20" name="menu-item-<?php echo $field_id; ?>[<?php echo $item_id; ?>]" ><?php echo esc_html( $item->{$field_id} ); // textarea_escaped ?></textarea>
|
312 |
+
</label>
|
313 |
+
</p>
|
314 |
+
|
315 |
+
<?php
|
316 |
+
break;
|
317 |
+
|
318 |
+
case 'text':
|
319 |
+
default:
|
320 |
+
?>
|
321 |
+
|
322 |
+
<p class="description description-wide aux-mm-setting-field-<?php echo $field_info['type']; ?> aux-mm-setting-<?php echo $field_id; ?>" <?php echo $data_depth; ?>>
|
323 |
+
<label for="edit-menu-item-<?php echo $field_id; ?>-<?php echo $item_id; ?>">
|
324 |
+
<?php echo $field_info['label']; ?><br />
|
325 |
+
<input type="text" id="edit-menu-item-<?php echo $field_id; ?>-<?php echo $item_id; ?>" class="widefat edit-menu-item-<?php echo $field_id; ?>" name="menu-item-<?php echo $field_id; ?>[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->{$field_id} ); ?>" />
|
326 |
+
</label>
|
327 |
+
</p>
|
328 |
+
|
329 |
+
<?php
|
330 |
+
break;
|
331 |
+
}
|
332 |
+
|
333 |
+
}
|
334 |
+
?>
|
335 |
+
</div>
|
336 |
+
|
337 |
+
|
338 |
+
|
339 |
+
<p class="field-move hide-if-no-js description description-wide">
|
340 |
+
<label>
|
341 |
+
<span><?php _e( 'Move', 'auxin-elements' ); ?></span>
|
342 |
+
<a href="#" class="menus-move menus-move-up" data-dir="up"><?php _e( 'Up one', 'auxin-elements' ); ?></a>
|
343 |
+
<a href="#" class="menus-move menus-move-down" data-dir="down"><?php _e( 'Down one', 'auxin-elements' ); ?></a>
|
344 |
+
<a href="#" class="menus-move menus-move-left" data-dir="left"></a>
|
345 |
+
<a href="#" class="menus-move menus-move-right" data-dir="right"></a>
|
346 |
+
<a href="#" class="menus-move menus-move-top" data-dir="top"><?php _e( 'To the top', 'auxin-elements' ); ?></a>
|
347 |
+
</label>
|
348 |
+
</p>
|
349 |
+
|
350 |
+
<div class="menu-item-actions description-wide submitbox">
|
351 |
+
<?php if ( 'custom' != $item->type && $original_title !== false ) : ?>
|
352 |
+
<p class="link-to-original">
|
353 |
+
<?php printf( __('Original: %s', 'auxin-elements'), '<a href="' . esc_attr( $item->url ) . '">' . esc_html( $original_title ) . '</a>' ); ?>
|
354 |
+
</p>
|
355 |
+
<?php endif; ?>
|
356 |
+
<a class="item-delete submitdelete deletion" id="delete-<?php echo $item_id; ?>" href="<?php
|
357 |
+
echo wp_nonce_url(
|
358 |
+
add_query_arg(
|
359 |
+
array(
|
360 |
+
'action' => 'delete-menu-item',
|
361 |
+
'menu-item' => $item_id,
|
362 |
+
),
|
363 |
+
admin_url( 'nav-menus.php' )
|
364 |
+
),
|
365 |
+
'delete-menu_item_' . $item_id
|
366 |
+
); ?>"><?php _e( 'Remove', 'auxin-elements' ); ?></a> <span class="meta-sep hide-if-no-js"> | </span> <a class="item-cancel submitcancel hide-if-no-js" id="cancel-<?php echo $item_id; ?>" href="<?php echo esc_url( add_query_arg( array( 'edit-menu-item' => $item_id, 'cancel' => time() ), admin_url( 'nav-menus.php' ) ) );
|
367 |
+
?>#menu-item-settings-<?php echo $item_id; ?>"><?php _e('Cancel', 'auxin-elements'); ?></a>
|
368 |
+
</div>
|
369 |
+
|
370 |
+
<input class="menu-item-data-db-id" type="hidden" name="menu-item-db-id[<?php echo esc_attr( $item_id ); ?>]" value="<?php echo esc_Attr( $item_id ); ?>" />
|
371 |
+
<input class="menu-item-data-object-id" type="hidden" name="menu-item-object-id[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->object_id ); ?>" />
|
372 |
+
<input class="menu-item-data-object" type="hidden" name="menu-item-object[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->object ); ?>" />
|
373 |
+
<input class="menu-item-data-parent-id" type="hidden" name="menu-item-parent-id[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->menu_item_parent ); ?>" />
|
374 |
+
<input class="menu-item-data-position" type="hidden" name="menu-item-position[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->menu_order ); ?>" />
|
375 |
+
<input class="menu-item-data-type" type="hidden" name="menu-item-type[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->type ); ?>" />
|
376 |
+
|
377 |
+
|
378 |
+
</div><!-- .menu-item-settings-->
|
379 |
+
<ul class="menu-item-transport"></ul>
|
380 |
+
<?php
|
381 |
+
$output .= ob_get_clean();
|
382 |
+
}
|
383 |
+
|
384 |
+
}
|
includes/classes/class-auxin-widget-indie.php
ADDED
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Main class for creating independent widgets in auxin framework
|
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 |
+
// no direct access allowed
|
14 |
+
if ( ! defined('ABSPATH') ) exit;
|
15 |
+
|
16 |
+
/*--------------------------------*/
|
17 |
+
|
18 |
+
|
19 |
+
if( ! class_exists( 'Auxin_Widget_Indie' ) ) :
|
20 |
+
|
21 |
+
|
22 |
+
class Auxin_Widget_Indie extends WP_Widget {
|
23 |
+
|
24 |
+
private $defaults = array();
|
25 |
+
public $fields = array();
|
26 |
+
|
27 |
+
|
28 |
+
/** constructor */
|
29 |
+
|
30 |
+
function __construct( $id_base, $name, $widget_options = array(), $control_options = array() ) {
|
31 |
+
parent::__construct( $id_base, $name, $widget_options, $control_options );
|
32 |
+
$this->set_defaults();
|
33 |
+
}
|
34 |
+
|
35 |
+
|
36 |
+
public function set_fields( $fields ){
|
37 |
+
$this->fields = $fields;
|
38 |
+
}
|
39 |
+
|
40 |
+
|
41 |
+
private function set_defaults(){
|
42 |
+
foreach ( $this->fields as $field ) {
|
43 |
+
$this->defaults[ $field["id"] ] = $field["value"];
|
44 |
+
}
|
45 |
+
}
|
46 |
+
|
47 |
+
|
48 |
+
// outputs the content of the widget
|
49 |
+
public function widget( $args, $instance ) {
|
50 |
+
|
51 |
+
}
|
52 |
+
|
53 |
+
|
54 |
+
|
55 |
+
// processes widget options to be saved
|
56 |
+
public function update( $new_instance, $old_instance ) {
|
57 |
+
|
58 |
+
$instance = $old_instance;
|
59 |
+
$new_instance = wp_parse_args( (array) $new_instance, $this->defaults );
|
60 |
+
|
61 |
+
foreach ( $this->fields as $field ) {
|
62 |
+
$id = $field["id"];
|
63 |
+
$instance[ $id ] = strip_tags( $new_instance[ $id ] );
|
64 |
+
}
|
65 |
+
|
66 |
+
return $instance;
|
67 |
+
}
|
68 |
+
|
69 |
+
|
70 |
+
|
71 |
+
// outputs the options form on admin
|
72 |
+
|
73 |
+
public function form( $instance ) {
|
74 |
+
|
75 |
+
$instance = wp_parse_args( (array) $instance, $this->defaults );
|
76 |
+
|
77 |
+
// get_field_id (string $field_name)
|
78 |
+
// creates id attributes for fields to be saved by update()
|
79 |
+
foreach ($this->fields as $field) {
|
80 |
+
|
81 |
+
$id = $field['id'];
|
82 |
+
|
83 |
+
switch ( $field['type'] ) {
|
84 |
+
|
85 |
+
case 'textbox':
|
86 |
+
|
87 |
+
echo '<p>',
|
88 |
+
'<label for="'.$this->get_field_id( $id ).'" >'. $field["name"].'</label>',
|
89 |
+
'<input class="widefat" id="'.$this->get_field_id( $id ).'" name="'.$this->get_field_name( $id ).'" type="text" value="'.$instance[ $id ].'" />',
|
90 |
+
'</p>';
|
91 |
+
|
92 |
+
break;
|
93 |
+
|
94 |
+
case 'select':
|
95 |
+
echo '<p>',
|
96 |
+
'<label for="'.$this->get_field_id( $id ).'" >'. $field['name']. '</label>',
|
97 |
+
'<select name="'.$this->get_field_name( $id ).'" id="'.$this->get_field_id( $id ).'" value="'.$instance[ $id ].'" style="width:97%;" >';
|
98 |
+
foreach ( $field['options'] as $key => $value ) {
|
99 |
+
echo '<option value="'.$key.'" '.( ( $instance[$id] == $key ) ? 'selected="selected"' : '' ).' >'. $value. '</option>';
|
100 |
+
}
|
101 |
+
|
102 |
+
echo '</select>',
|
103 |
+
'</p>';
|
104 |
+
break;
|
105 |
+
|
106 |
+
default:
|
107 |
+
|
108 |
+
break;
|
109 |
+
}
|
110 |
+
|
111 |
+
}
|
112 |
+
|
113 |
+
}
|
114 |
+
|
115 |
+
|
116 |
+
} // end widget class
|
117 |
+
|
118 |
+
|
119 |
+
endif;
|
includes/classes/class-auxin-widget-shortcode-map.php
CHANGED
@@ -125,24 +125,18 @@ class Auxin_Widget_Shortcode_Map {
|
|
125 |
}
|
126 |
}
|
127 |
|
|
|
|
|
128 |
|
129 |
-
|
130 |
-
* It removes all the none defined array keys
|
131 |
-
*/
|
132 |
-
protected function visual_compatible( $compelet_array ){
|
133 |
-
$validated_complete_array = array();
|
134 |
-
|
135 |
-
foreach( $compelet_array as $node_key => $node ) {
|
136 |
if( is_array( $node ) ){
|
137 |
-
$
|
138 |
-
} else {
|
139 |
-
|
140 |
-
$validated_complete_array[ $node_key ] = $compelet_array[ $node_key ];
|
141 |
-
}
|
142 |
}
|
143 |
}
|
144 |
|
145 |
-
return $
|
146 |
}
|
147 |
|
148 |
|
@@ -237,7 +231,7 @@ class Auxin_Widget_Shortcode_Map {
|
|
237 |
// TODO: It shoould convert to array an array when dependency js writes
|
238 |
// $widget_params['dependency'] = array( $param['dependency'] );
|
239 |
|
240 |
-
if( in_array( $param['type'], array( 'select', 'dropdown', '
|
241 |
$widget_params['options'] = $param['value'];
|
242 |
}
|
243 |
|
@@ -254,29 +248,59 @@ class Auxin_Widget_Shortcode_Map {
|
|
254 |
*/
|
255 |
public function vc_mapper(){
|
256 |
$master_array = $this->get_master_array();
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
|
|
261 |
}
|
262 |
}
|
263 |
}
|
264 |
|
265 |
/**
|
266 |
-
*
|
267 |
*/
|
268 |
-
public function
|
269 |
-
$result;
|
|
|
270 |
foreach ( $params as $params_cell => $params_value ) {
|
271 |
-
if( $params_value['type']
|
272 |
-
$params_value['value'] =
|
|
|
|
|
|
|
|
|
|
|
273 |
}
|
274 |
$result[] = $params_value;
|
275 |
}
|
|
|
276 |
return $result;
|
277 |
}
|
278 |
|
279 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
280 |
/**
|
281 |
* Register elements in siteorigin page builder
|
282 |
*/
|
@@ -378,5 +402,3 @@ class Auxin_Widget_Shortcode_Map {
|
|
378 |
|
379 |
}
|
380 |
|
381 |
-
|
382 |
-
Auxin_Widget_Shortcode_Map::get_instance();
|
125 |
}
|
126 |
}
|
127 |
|
128 |
+
protected function remove_empty_nodes_recuresively( $array ){
|
129 |
+
$cleared_array = array();
|
130 |
|
131 |
+
foreach( $array as $key => $node ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
if( is_array( $node ) ){
|
133 |
+
$cleared_array[ $key ] = $this->remove_empty_nodes_recuresively( $node );
|
134 |
+
} else if ( ! empty( $node ) || $node === false ){
|
135 |
+
$cleared_array[ $key ] = $array[ $key ];
|
|
|
|
|
136 |
}
|
137 |
}
|
138 |
|
139 |
+
return $cleared_array;
|
140 |
}
|
141 |
|
142 |
|
231 |
// TODO: It shoould convert to array an array when dependency js writes
|
232 |
// $widget_params['dependency'] = array( $param['dependency'] );
|
233 |
|
234 |
+
if( in_array( $param['type'], array( 'select', 'dropdown', 'aux_select2_multiple', 'aux_select2_single' ) ) ) {
|
235 |
$widget_params['options'] = $param['value'];
|
236 |
}
|
237 |
|
248 |
*/
|
249 |
public function vc_mapper(){
|
250 |
$master_array = $this->get_master_array();
|
251 |
+
|
252 |
+
foreach ( $master_array as $array_node ) {
|
253 |
+
if( $array_node['is_vc'] !== false ) {
|
254 |
+
$array_node['params'] = $this->exchange_vc_fields( $array_node['params'] );
|
255 |
+
vc_map( $this->make_vc_compatible( $array_node ) );
|
256 |
}
|
257 |
}
|
258 |
}
|
259 |
|
260 |
/**
|
261 |
+
* Get the params array and flip the value array of its value key
|
262 |
*/
|
263 |
+
public function exchange_vc_fields( $params ){
|
264 |
+
$result = array();
|
265 |
+
|
266 |
foreach ( $params as $params_cell => $params_value ) {
|
267 |
+
if( in_array( $params_value['type'], array( 'aux_visual_select', 'dropdown', 'aux_select2_multiple', 'aux_select2_single' ) ) ){
|
268 |
+
$params_value['value'] = ! empty( $params_value['value'] ) ? $params_value['value'] : '';
|
269 |
+
$params_value['std' ] = ! empty( $params_value['def_value'] ) ? $params_value['def_value'] : $params_value['value'];
|
270 |
+
|
271 |
+
if( $params_value['type' ] == 'dropdown' ){
|
272 |
+
$params_value['value'] = array_flip( $params_value['value'] );
|
273 |
+
}
|
274 |
}
|
275 |
$result[] = $params_value;
|
276 |
}
|
277 |
+
|
278 |
return $result;
|
279 |
}
|
280 |
|
281 |
|
282 |
+
/**
|
283 |
+
* Removes all empty array keys and appends some special fields for visual composer
|
284 |
+
*/
|
285 |
+
protected function make_vc_compatible( $element_config ){
|
286 |
+
|
287 |
+
// Removes all empty array keys
|
288 |
+
$element_config = $this->remove_empty_nodes_recuresively( $element_config );
|
289 |
+
|
290 |
+
// Appending some special fields for visual composer
|
291 |
+
if( isset( $element_config['params'] ) ){
|
292 |
+
$element_config['params'][] = array(
|
293 |
+
'type' => 'css_editor',
|
294 |
+
'heading' => __( 'CSS', 'auxin-elements' ),
|
295 |
+
'param_name' => 'vc_css',
|
296 |
+
'group' => __( 'Design options', 'auxin-elements' )
|
297 |
+
);
|
298 |
+
}
|
299 |
+
|
300 |
+
return $element_config;
|
301 |
+
}
|
302 |
+
|
303 |
+
|
304 |
/**
|
305 |
* Register elements in siteorigin page builder
|
306 |
*/
|
402 |
|
403 |
}
|
404 |
|
|
|
|
includes/classes/class-auxin-widget.php
ADDED
@@ -0,0 +1,476 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* A class for creating widgets dynamically base of Master widget list
|
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 |
+
// no direct access allowed
|
14 |
+
if ( ! defined('ABSPATH') ) exit;
|
15 |
+
|
16 |
+
/*--------------------------------*/
|
17 |
+
|
18 |
+
|
19 |
+
if( ! class_exists( 'Auxin_Widget' ) ) :
|
20 |
+
|
21 |
+
|
22 |
+
class Auxin_Widget extends WP_Widget {
|
23 |
+
|
24 |
+
private $defaults = array();
|
25 |
+
public $fields = array();
|
26 |
+
|
27 |
+
public $widget_fun_name;
|
28 |
+
|
29 |
+
private $dependency_list = array();
|
30 |
+
private $widget_info;
|
31 |
+
|
32 |
+
private $attach_ids_list = null;
|
33 |
+
private $att_ids = null;
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Sets up the widgets name, Id, description and etc
|
37 |
+
*/
|
38 |
+
function __construct( $widget_info ) {
|
39 |
+
|
40 |
+
parent::__construct( $widget_info['base_ID'] , $name = $widget_info['name'], $widget_info['args'] );
|
41 |
+
|
42 |
+
$this->widget_info = $widget_info;
|
43 |
+
$this->fields = $widget_info['params'];
|
44 |
+
$this->widget_fun_name = $widget_info['auxin_output_callback'];
|
45 |
+
|
46 |
+
$this->set_defaults();
|
47 |
+
}
|
48 |
+
|
49 |
+
|
50 |
+
private function set_defaults(){
|
51 |
+
foreach ( $this->fields as $field ) {
|
52 |
+
$this->defaults[ $field["id"] ] = $field["value"];
|
53 |
+
}
|
54 |
+
$this->defaults[ '__uid' ] = $this->widget_info['base_ID'] . '_' . substr( uniqid( ''. rand() ), -8 );
|
55 |
+
}
|
56 |
+
|
57 |
+
//
|
58 |
+
/**
|
59 |
+
* Outputs the content of the widget
|
60 |
+
*
|
61 |
+
* @param array $args The field keys and their real values
|
62 |
+
* @param array $instance The widget name, id and global configs
|
63 |
+
* @return string The widget output for front-end
|
64 |
+
*/
|
65 |
+
function widget( $args, $instance ) {
|
66 |
+
// if the 'widget_info' was available in passed array, we can determine
|
67 |
+
// whether the array is from widget class or not
|
68 |
+
|
69 |
+
// make sure to pass same class name for wrapper to widget too
|
70 |
+
if( isset( $this->widget_info['base_class'] ) ){
|
71 |
+
$args['base_class'] = $this->widget_info['base_class'];
|
72 |
+
}
|
73 |
+
$instance['widget_info'] = $args;
|
74 |
+
|
75 |
+
if( function_exists( $this->widget_fun_name ) ){
|
76 |
+
echo call_user_func( $this->widget_fun_name, $instance );
|
77 |
+
} else {
|
78 |
+
auxin_error( __('The callback for widget does not exists.', 'auxin-elements') );
|
79 |
+
}
|
80 |
+
}
|
81 |
+
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Outputs the options form on admin
|
85 |
+
*
|
86 |
+
* @param array $instance The widget options
|
87 |
+
*/
|
88 |
+
function form( $instance ) {
|
89 |
+
$instance = wp_parse_args( (array) $instance, $this->defaults );
|
90 |
+
|
91 |
+
echo '<div id="'.$this->defaults[ '__uid' ].'" class="auxin-admin-widget-wrapper">';
|
92 |
+
|
93 |
+
// creates id attributes for fields to be saved by update()
|
94 |
+
foreach ( $this->fields as $field ) {
|
95 |
+
$id = $field['id'];
|
96 |
+
// make sure description is set
|
97 |
+
$field["description"] = ! isset( $field["description"] ) ? '': $field["description"];
|
98 |
+
// print_r($field);
|
99 |
+
|
100 |
+
$this->watch_for_field_dependencies( $field );
|
101 |
+
|
102 |
+
switch ( $field['type'] ) {
|
103 |
+
|
104 |
+
case 'iconpicker':
|
105 |
+
case 'aux_iconpicker':
|
106 |
+
$font_icons = Auxin()->Font_Icons->get_icons_list('fontastic');
|
107 |
+
$output = '<div class="aux-element-field aux-iconpicker">';
|
108 |
+
$output .= '<label for="'.$this->get_field_name($id).'" >'.$field["name"].'</label><br />';
|
109 |
+
$output .= sprintf( '<select name="%1$s" id="%1$s" class="aux-fonticonpicker aux-select" >', $this->get_field_name($id) );
|
110 |
+
$output .= '<option value="">' . __('Choose ..', 'auxin-elements') . '</option>';
|
111 |
+
|
112 |
+
if( is_array( $font_icons ) ){
|
113 |
+
foreach ( $font_icons as $icon ) {
|
114 |
+
$icon_id = trim( $icon->classname, '.' );
|
115 |
+
$output .= '<option value="'. $icon_id .'" '. selected( $instance[$id], $icon_id, false ) .' >'. $icon->name . '</option>';
|
116 |
+
|
117 |
+
}
|
118 |
+
}
|
119 |
+
|
120 |
+
$output .= '</select>';
|
121 |
+
if ( $field["description"] ) {
|
122 |
+
$output .= '<p class="option-description">' . $field["description"] . '</p>';
|
123 |
+
}
|
124 |
+
$output .= '</div>';
|
125 |
+
echo $output;
|
126 |
+
|
127 |
+
break;
|
128 |
+
|
129 |
+
|
130 |
+
|
131 |
+
case 'textarea_html':
|
132 |
+
case 'textarea_raw_html':
|
133 |
+
echo '<div class="aux-element-field aux-visual-selector">',
|
134 |
+
'<label for="'.$this->get_field_id($id).'" >'.$field["name"].'</label>',
|
135 |
+
'<textarea class="widefat" id="'.$this->get_field_id($id).'" name="'.$this->get_field_name($id).'" name="'.$this->get_field_name($id).'">',
|
136 |
+
$instance[$id].'</textarea>';
|
137 |
+
if ( $field["description"] ) {
|
138 |
+
echo '<p class="option-description textarea-desc">' . $field["description"] . '</p>';
|
139 |
+
}
|
140 |
+
echo '</div>';
|
141 |
+
break;
|
142 |
+
|
143 |
+
case 'textbox':
|
144 |
+
case 'textfield':
|
145 |
+
echo '<div class="aux-element-field aux-visual-selector">',
|
146 |
+
'<label for="'.$this->get_field_id($id).'" >'.$field["name"].'</label>',
|
147 |
+
'<input class="widefat" id="'.$this->get_field_id($id).'" name="'.$this->get_field_name($id).'" type="text" value="'.$instance[$id].'" />';
|
148 |
+
if ( $field["description"] ) {
|
149 |
+
echo '<p class="option-description">' . $field["description"] . '</p>';
|
150 |
+
}
|
151 |
+
echo '</div>';
|
152 |
+
break;
|
153 |
+
|
154 |
+
case 'dropdown':
|
155 |
+
case 'select':
|
156 |
+
echo '<div class="aux-element-field aux-dropdown">',
|
157 |
+
'<label for="'.$this->get_field_id( $id ).'" >'. $field['name']. '</label>',
|
158 |
+
'<select name="' .$this->get_field_name( $id ) . '" id="' . $this->get_field_id( $id ) . '" value="' . $instance[$id] . '" >';
|
159 |
+
foreach ( $field['options'] as $key => $value ) {
|
160 |
+
echo '<option value="'.$key.'" '.selected( $instance[$id], $key, false ).' >'. $value. '</option>';
|
161 |
+
}
|
162 |
+
|
163 |
+
echo '</select>';
|
164 |
+
if ( $field["description"] ) {
|
165 |
+
echo '<p class="option-description">' . $field["description"] . '</p>';
|
166 |
+
}
|
167 |
+
echo '</div>';
|
168 |
+
break;
|
169 |
+
|
170 |
+
// Select2 single
|
171 |
+
case 'aux_select2_single' :
|
172 |
+
echo '<div class="aux-element-field aux-multiple-selector ">',
|
173 |
+
'<label for="'.$this->get_field_id($id).'" >'.$field["name"].'</label>',
|
174 |
+
'<div class="section-row-right" >' ,
|
175 |
+
'<select name="'.$this->get_field_name($id).'" id="'.$this->get_field_id($id).'" class="aux-orig-select2 aux-admin-select2 aux-select2-single" data-value="' . $instance[$id] . '" value="' . $instance[$id] . '" style="width:150px" >';
|
176 |
+
foreach ( $field['options'] as $key => $value ) {
|
177 |
+
echo '<option value="'.$key.'" '.selected( $instance[$id], $key, false ).' >'. $value. '</option>';
|
178 |
+
}
|
179 |
+
echo '</select></div>';
|
180 |
+
if ( $field["description"] ) {
|
181 |
+
echo '<p class="option-description">' . $field["description"] . '</p>';
|
182 |
+
}
|
183 |
+
echo '</div>' ;
|
184 |
+
break;
|
185 |
+
|
186 |
+
// defining of aux_select2_multiple field type for widget and siteorigin.
|
187 |
+
case 'aux_select2_multiple' :
|
188 |
+
|
189 |
+
if( gettype( $instance[ $id ] ) ==="string" ) {
|
190 |
+
$select = array( $instance[ $id ] );
|
191 |
+
}
|
192 |
+
else
|
193 |
+
$select = $instance[ $id ];
|
194 |
+
|
195 |
+
echo '<div class="aux-element-field aux-multiple-selector ">',
|
196 |
+
'<label for="'.$this->get_field_id($id).'" >'.$field["name"].'</label>',
|
197 |
+
'<select multiple="multiple" name="' . $this->get_field_name($id) . '" id="' . $this->get_field_name($id) . '" class="aux-orig-select2 aux-admin-select2 aux-select2-multiple">';
|
198 |
+
foreach ( $field['options'] as $key => $value ) {
|
199 |
+
printf(
|
200 |
+
'<option value="%s" class="hot-topic" %s style="margin-bottom:3px;">%s</option>',
|
201 |
+
$key,
|
202 |
+
in_array( $key, $select) ? 'selected="selected"' : '',
|
203 |
+
$value
|
204 |
+
);
|
205 |
+
}
|
206 |
+
echo '</select>';
|
207 |
+
if ( $field["description"] ) {
|
208 |
+
echo '<p class="option-description">' . $field["description"] . '</p>';
|
209 |
+
}
|
210 |
+
echo '</div>' ;
|
211 |
+
|
212 |
+
break;
|
213 |
+
|
214 |
+
case 'aux_visual_select':
|
215 |
+
$output = '<div class="aux-element-field aux-visual-selector">';
|
216 |
+
$output .= '<label for="'.$this->get_field_id($id).'" >'.$field["name"].'</label>';
|
217 |
+
$output .= '<select class="meta-select visual-select-wrapper" name="' . $this->get_field_name( $id ) . '" id="' . $this->get_field_id( $id ) . '" value="' . $instance[$id] . '" >';
|
218 |
+
// TODO: I don't know why $instance[$id] is null or empty inside below loop
|
219 |
+
$tmp_instance_id = $instance[$id];
|
220 |
+
foreach ( $field['choices'] as $id => $option_info ) {
|
221 |
+
$active_attr = ( $tmp_instance_id == $id ) ? ' selected ' : "";
|
222 |
+
$data_class = isset( $option_info['css_class'] ) && ! empty( $option_info['css_class'] ) ? 'data-class="'. $option_info['css_class'].'"' : '';
|
223 |
+
$data_symbol = empty( $data_class ) && isset( $option_info['image'] ) && ! empty( $option_info['image'] ) ? 'data-symbol="'. $option_info['image'].'"' : '';
|
224 |
+
$output .= sprintf( '<option value="%s" %s %s %s>%s</option>', $id, $active_attr, $data_symbol, $data_class, $option_info['label'] );
|
225 |
+
}
|
226 |
+
$output .= '</select>';
|
227 |
+
if ( $field["description"] ) {
|
228 |
+
$output .= '<p class="option-description visual-selector-desc">' . $field["description"] . '</p>';
|
229 |
+
}
|
230 |
+
$output .= '</div>';
|
231 |
+
echo $output;
|
232 |
+
break;
|
233 |
+
|
234 |
+
case 'checkbox':
|
235 |
+
case 'aux_switch':
|
236 |
+
$instance[$id] = isset( $instance[$id] ) ? (bool)$instance[$id] : false;
|
237 |
+
$tick = $instance[$id]? 'checked="checked"': '';
|
238 |
+
echo '<div class="aux-element-field aux_switch">',
|
239 |
+
'<input class="hidden_aux_switch" type="hidden" value="0" id="_'.$this->get_field_id($id) .'-hidden" name="'.$this->get_field_name($id).'" >',
|
240 |
+
'<input class="checkbox widefat aux_switch" type="checkbox" ' . $tick . ' id="'.$this->get_field_id($id).'" name="'.$this->get_field_name($id).'" >',
|
241 |
+
'<label for="'.$this->get_field_id($id).'" >'.$field["name"].'</label>';
|
242 |
+
|
243 |
+
if ( $field["description"] ) {
|
244 |
+
echo '<p class="option-description">' . $field["description"] . '</p>';
|
245 |
+
}
|
246 |
+
echo '</div>';
|
247 |
+
|
248 |
+
break;
|
249 |
+
|
250 |
+
case 'color':
|
251 |
+
case 'colorpicker':
|
252 |
+
echo '<div class="aux-element-field aux-colorpicker">',
|
253 |
+
'<label for="'.$this->get_field_id($id).'" >'.$field["name"].'</label>',
|
254 |
+
'<div class="mini-color-wrapper"><input id="'.$this->get_field_id($id).'" name="'.$this->get_field_name($id).'" type="text"type="text" value="'.$instance[$id].'" ></div>';
|
255 |
+
if ( $field["description"] ) {
|
256 |
+
echo '<p class="option-description">' . $field["description"] . '</p>';
|
257 |
+
}
|
258 |
+
echo '</div>';
|
259 |
+
break;
|
260 |
+
|
261 |
+
case 'aux_select_image':
|
262 |
+
case 'attach_image':
|
263 |
+
// Store attachment src for avertaAttachMedia field
|
264 |
+
if( !empty($instance[$id]) ) {
|
265 |
+
$att_ids = explode( ',', $instance[$id] );
|
266 |
+
$attach_ids_list = auxin_get_the_resized_attachment_src( $att_ids, 80, 80, true );
|
267 |
+
if(!empty($att_ids)) {
|
268 |
+
printf( "<script>auxin.attachmedia = jQuery.extend( auxin.attachmedia, %s );</script>", json_encode( array_unique( $attach_ids_list ) ) );
|
269 |
+
}
|
270 |
+
}
|
271 |
+
echo '<div class="aux-element-field av3_container aux_select_image axi-attachmedia-wrapper">',
|
272 |
+
'<label for="'.$this->get_field_id($id).'" >'.$field["name"].'</label>',
|
273 |
+
'<input type="text" class="white" name="'.$this->get_field_name($id).'" ' . 'id="'.$this->get_field_id($id).'" ' . 'value="' . $instance[$id] .
|
274 |
+
'" data-media-type="image" data-limit="1" data-multiple="0"
|
275 |
+
data-add-to-list="'.__('Add Image', 'auxin-elements').'"
|
276 |
+
data-uploader-submit="'.__('Add Image', 'auxin-elements').'"
|
277 |
+
data-uploader-title="'.__('Select Image', 'auxin-elements').'"> ';
|
278 |
+
if ( $field["description"] ) {
|
279 |
+
echo '<p class="option-description">' . $field["description"] . '</p>';
|
280 |
+
}
|
281 |
+
echo '</div>';
|
282 |
+
break;
|
283 |
+
|
284 |
+
case 'aux_select_images':
|
285 |
+
case 'attach_images':
|
286 |
+
// Store attachment src for avertaAttachMedia field
|
287 |
+
if( !empty($instance[$id]) ) {
|
288 |
+
$att_ids = explode( ',', $instance[$id] );
|
289 |
+
$attach_ids_list = auxin_get_the_resized_attachment_src( $att_ids, 80, 80, true );
|
290 |
+
if(!empty($att_ids)) {
|
291 |
+
printf( "<script>auxin.attachmedia = jQuery.extend( auxin.attachmedia, %s );</script>", json_encode( array_unique( $attach_ids_list ) ) );
|
292 |
+
}
|
293 |
+
}
|
294 |
+
echo '<div class="aux-element-field av3_container aux_select_image axi-attachmedia-wrapper">',
|
295 |
+
'<label for="'.$this->get_field_id($id).'" >'.$field["name"].'</label>',
|
296 |
+
'<input type="text" class="white" name="'.$this->get_field_name($id).'" ' . 'id="'.$this->get_field_id($id).'" ' . 'value="' . $instance[$id] .
|
297 |
+
'" data-media-type="image" data-limit="9999" data-multiple="1"
|
298 |
+
data-add-to-list="'.__('Add Image', 'auxin-elements').'"
|
299 |
+
data-uploader-submit="'.__('Add Image', 'auxin-elements').'"
|
300 |
+
data-uploader-title="'.__('Select Image', 'auxin-elements').'"> ';
|
301 |
+
if ( $field["description"] ) {
|
302 |
+
echo '<p class="option-description">' . $field["description"] . '</p>';
|
303 |
+
}
|
304 |
+
echo '</div>';
|
305 |
+
break;
|
306 |
+
|
307 |
+
case 'aux_select_video':
|
308 |
+
case 'attach_video':
|
309 |
+
|
310 |
+
// Store attachment src for avertaAttachMedia field
|
311 |
+
if( !empty($instance[$id]) ) {
|
312 |
+
$att_ids = explode( ',', $instance[$id] );
|
313 |
+
$attach_ids_list = auxin_get_the_resized_attachment_src( $att_ids, 80, 80, true );
|
314 |
+
if(!empty($att_ids)) {
|
315 |
+
printf( "<script>auxin.attachmedia = jQuery.extend( auxin.attachmedia, %s );</script>", json_encode( array_unique( $attach_ids_list ) ) );
|
316 |
+
}
|
317 |
+
}
|
318 |
+
echo '<div class="aux-element-field av3_container aux_select_image axi-attachmedia-wrapper">',
|
319 |
+
'<label for="'.$this->get_field_id($id).'" >'.$field["name"].'</label>',
|
320 |
+
'<input type="text" class="white" name="'.$this->get_field_name($id).'" ' . 'id="'.$this->get_field_id($id).'" ' . 'value="' . $instance[$id] .
|
321 |
+
'" data-media-type="video" data-limit="1" data-multiple="0"
|
322 |
+
data-add-to-list="'.__('Add Video', 'auxin-elements').'"
|
323 |
+
data-uploader-submit="'.__('Add Video', 'auxin-elements').'"
|
324 |
+
data-uploader-title="'.__('Select Video', 'auxin-elements').'"> ';
|
325 |
+
if ( $field["description"] ) {
|
326 |
+
echo '<p class="option-description">' . $field["description"] . '</p>';
|
327 |
+
}
|
328 |
+
echo '</div>';
|
329 |
+
break;
|
330 |
+
|
331 |
+
case 'aux_select_audio':
|
332 |
+
case 'attach_audio':
|
333 |
+
|
334 |
+
// Store attachment src for avertaAttachMedia field
|
335 |
+
if( !empty($instance[$id]) ) {
|
336 |
+
$att_ids = explode( ',', $instance[$id] );
|
337 |
+
$attach_ids_list = auxin_get_the_resized_attachment_src( $att_ids, 80, 80, true );
|
338 |
+
if(!empty($att_ids)) {
|
339 |
+
printf( "<script>auxin.attachmedia = jQuery.extend( auxin.attachmedia, %s );</script>", json_encode( array_unique( $attach_ids_list ) ) );
|
340 |
+
}
|
341 |
+
}
|
342 |
+
echo '<div class="aux-element-field av3_container aux_select_image axi-attachmedia-wrapper">',
|
343 |
+
'<label for="'.$this->get_field_id($id).'" >'.$field["name"].'</label>',
|
344 |
+
'<input type="text" class="white" name="'.$this->get_field_name($id).'" ' . 'id="'.$this->get_field_id($id).'" ' . 'value="' . $instance[$id] .
|
345 |
+
'" data-media-type="audio" data-limit="1" data-multiple="0"
|
346 |
+
data-add-to-list="'.__('Add Audio', 'auxin-elements').'"
|
347 |
+
data-uploader-submit="'.__('Add Audio', 'auxin-elements').'"
|
348 |
+
data-uploader-title="'.__('Select Audio', 'auxin-elements').'"> ';
|
349 |
+
if ( $field["description"] ) {
|
350 |
+
echo '<p class="option-description">' . $field["description"] . '</p>';
|
351 |
+
}
|
352 |
+
echo '</div>';
|
353 |
+
|
354 |
+
default:
|
355 |
+
|
356 |
+
break;
|
357 |
+
}
|
358 |
+
|
359 |
+
}
|
360 |
+
|
361 |
+
echo '</div>';
|
362 |
+
|
363 |
+
|
364 |
+
// axpp( $this->dependency_list );
|
365 |
+
$this->print_dependencies();
|
366 |
+
}
|
367 |
+
|
368 |
+
|
369 |
+
/**
|
370 |
+
* Loop to collect dependency map of metafields
|
371 |
+
*
|
372 |
+
* @param array $field field options
|
373 |
+
* @return void
|
374 |
+
*/
|
375 |
+
public function watch_for_field_dependencies( $field = array() ){
|
376 |
+
if( empty( $field ) ){
|
377 |
+
return;
|
378 |
+
}
|
379 |
+
|
380 |
+
$field_dependencies = array();
|
381 |
+
|
382 |
+
if( isset( $field['dependency'] ) && ! empty( $field['dependency'] ) ){
|
383 |
+
|
384 |
+
$depend = $field['dependency'];
|
385 |
+
|
386 |
+
if( isset( $depend['element'] ) && ( isset( $depend['value'] ) && ! empty( $depend['value'] ) ) ){
|
387 |
+
|
388 |
+
unset( $depend['relation'] );
|
389 |
+
unset( $depend['callback'] );
|
390 |
+
|
391 |
+
$field_dependencies[ $depend['element'] ] = array( 'value' => (array)$depend['value'] );
|
392 |
+
|
393 |
+
// if( isset( $depend['callback'] ) ) {
|
394 |
+
// $field_dependencies[ $depend['element'] ]['callback'] = $depend['callback'];
|
395 |
+
// }
|
396 |
+
}
|
397 |
+
|
398 |
+
|
399 |
+
/* if there was a list of dependencies
|
400 |
+
|
401 |
+
$dependencies = (array) $field['dependency'];
|
402 |
+
|
403 |
+
foreach ( $dependencies as $depend_id => $depend ) {
|
404 |
+
|
405 |
+
if( 'relation' === $depend_id ) {
|
406 |
+
$field_dependencies[ $depend_id ] = $depend;
|
407 |
+
continue;
|
408 |
+
}
|
409 |
+
|
410 |
+
if( ! isset( $depend['element'] ) || ! ( isset( $depend['value'] ) && ! empty( $depend['value'] ) ) ){ continue; }
|
411 |
+
|
412 |
+
$field_dependencies[ $depend['element'] ] = array( 'value' => (array)$depend['value'] );
|
413 |
+
|
414 |
+
if( isset( $depend['callback'] ) ) {
|
415 |
+
$field_dependencies[ $depend['element'] ]['callback'] = $depend['callback'];
|
416 |
+
}
|
417 |
+
}
|
418 |
+
*/
|
419 |
+
}
|
420 |
+
|
421 |
+
if( $field_dependencies ){
|
422 |
+
$this->dependency_list[ $field['id'] ] = $field_dependencies;
|
423 |
+
}
|
424 |
+
}
|
425 |
+
|
426 |
+
/**
|
427 |
+
* Print metafield dependencies
|
428 |
+
*
|
429 |
+
* @return string JSON string containing metafield dependencies
|
430 |
+
*/
|
431 |
+
public function print_dependencies(){
|
432 |
+
// echo js dependencies
|
433 |
+
printf( '<script>auxinCreateNamespace("auxin.elements.%3$s");
|
434 |
+
auxin.elements.%3$s.dependencies = %2$s;
|
435 |
+
auxin.elements.%3$s.baseid = "%1$s";</script>',
|
436 |
+
$this->widget_info['base_ID'],
|
437 |
+
json_encode( $this->dependency_list ),
|
438 |
+
$this->defaults[ '__uid' ]
|
439 |
+
);
|
440 |
+
?>
|
441 |
+
|
442 |
+
<?php
|
443 |
+
}
|
444 |
+
|
445 |
+
|
446 |
+
/**
|
447 |
+
* Processing widget options on save
|
448 |
+
*
|
449 |
+
* @param array $new_instance The new options
|
450 |
+
* @param array $old_instance The previous options
|
451 |
+
*/
|
452 |
+
function update( $new_instance, $old_instance ) {
|
453 |
+
$instance = $old_instance;
|
454 |
+
// TODO: we exclode the defaults because on checkbox there is no this value on unchecked and it replaces with defaults
|
455 |
+
// $new_instance = wp_parse_args( (array) $new_instance, $this->defaults );
|
456 |
+
$new_instance = wp_parse_args( (array) $new_instance );
|
457 |
+
foreach ( $this->fields as $field ) {
|
458 |
+
$id = $field["id"];
|
459 |
+
if( $field["type"] == "aux_switch" ) {
|
460 |
+
$instance[ $id ] = !empty($new_instance[$id ] ) ? 1 : 0;
|
461 |
+
}
|
462 |
+
if( $field["type"] == "aux_select2_multiple" ) {
|
463 |
+
$instance[ $id ] = esc_sql( $new_instance[ $id ] );
|
464 |
+
|
465 |
+
} else {
|
466 |
+
$instance[ $id ] = strip_tags( $new_instance[ $id ] );
|
467 |
+
}
|
468 |
+
|
469 |
+
}
|
470 |
+
return $instance;
|
471 |
+
}
|
472 |
+
|
473 |
+
|
474 |
+
} // end widget class
|
475 |
+
|
476 |
+
endif;
|
includes/define.php
CHANGED
@@ -12,7 +12,7 @@ if( ! defined( 'THEME_NAME' ) ){
|
|
12 |
}
|
13 |
|
14 |
|
15 |
-
define( 'AUXELS_VERSION' , '1.3.
|
16 |
|
17 |
define( 'AUXELS_SLUG' , 'auxin-elements' );
|
18 |
|
12 |
}
|
13 |
|
14 |
|
15 |
+
define( 'AUXELS_VERSION' , '1.3.6' );
|
16 |
|
17 |
define( 'AUXELS_SLUG' , 'auxin-elements' );
|
18 |
|
includes/elements/accordion.php
CHANGED
@@ -20,6 +20,10 @@ function auxin_get_new_accordion_master_array( $master_array ) {
|
|
20 |
'class' => 'aux-widget-accordion widget-toggle',
|
21 |
'show_settings_on_create' => true,
|
22 |
'weight' => 1,
|
|
|
|
|
|
|
|
|
23 |
'category' => THEME_NAME,
|
24 |
'group' => '',
|
25 |
'so_api' => true,
|
20 |
'class' => 'aux-widget-accordion widget-toggle',
|
21 |
'show_settings_on_create' => true,
|
22 |
'weight' => 1,
|
23 |
+
'is_widget' => true,
|
24 |
+
'is_shortcode' => true,
|
25 |
+
'is_so' => true,
|
26 |
+
'is_vc' => false,
|
27 |
'category' => THEME_NAME,
|
28 |
'group' => '',
|
29 |
'so_api' => true,
|
includes/elements/audio.php
CHANGED
@@ -47,7 +47,7 @@ function auxin_get_audio_master_array( $master_array ) {
|
|
47 |
'value' => '',
|
48 |
'holder' => 'textfield',
|
49 |
'class' => 'title',
|
50 |
-
'admin_label' =>
|
51 |
'dependency' => '',
|
52 |
'weight' => '',
|
53 |
'group' => '' ,
|
@@ -59,9 +59,9 @@ function auxin_get_audio_master_array( $master_array ) {
|
|
59 |
'param_name' => 'src',
|
60 |
'type' => 'aux_select_audio',
|
61 |
'value' => '',
|
62 |
-
'holder' => '
|
63 |
'class' => 'audio_src',
|
64 |
-
'admin_label' =>
|
65 |
'dependency' => '',
|
66 |
'weight' => '',
|
67 |
'group' => '' ,
|
@@ -72,13 +72,12 @@ function auxin_get_audio_master_array( $master_array ) {
|
|
72 |
'description' => '',
|
73 |
'param_name' => 'loop',
|
74 |
'type' => 'aux_switch',
|
75 |
-
'
|
76 |
-
'value' => '0',
|
77 |
'class' => '',
|
78 |
-
'admin_label' =>
|
79 |
'dependency' => '',
|
80 |
'weight' => '',
|
81 |
-
'group' => '
|
82 |
'edit_field_class' => ''
|
83 |
),
|
84 |
array(
|
@@ -86,13 +85,12 @@ function auxin_get_audio_master_array( $master_array ) {
|
|
86 |
'description' => __('Play the audio file automatically.','auxin-elements' ),
|
87 |
'param_name' => 'autoplay',
|
88 |
'type' => 'aux_switch',
|
89 |
-
'def_value' => '0',
|
90 |
'value' => '0',
|
91 |
'class' => '',
|
92 |
-
'admin_label' =>
|
93 |
'dependency' => '',
|
94 |
'weight' => '',
|
95 |
-
'group' => '
|
96 |
'edit_field_class' => ''
|
97 |
),
|
98 |
array(
|
@@ -102,21 +100,21 @@ function auxin_get_audio_master_array( $master_array ) {
|
|
102 |
'type' => 'aux_visual_select',
|
103 |
'def_value' => 'dark',
|
104 |
'choices' => array(
|
105 |
-
'dark'
|
106 |
'label' => __('Dark', 'auxin-elements'),
|
107 |
'image' => AUX_URL . 'images/visual-select/audio-player-dark.svg'
|
108 |
),
|
109 |
-
'light'
|
110 |
'label' => __('Light', 'auxin-elements'),
|
111 |
'image' => AUX_URL . 'images/visual-select/audio-player-light.svg'
|
112 |
)
|
113 |
),
|
114 |
-
'holder' => '
|
115 |
'class' => 'skin',
|
116 |
'admin_label' => true,
|
117 |
'dependency' => '',
|
118 |
'weight' => '',
|
119 |
-
'group' => '' ,
|
120 |
'edit_field_class' => ''
|
121 |
),
|
122 |
array(
|
@@ -126,15 +124,14 @@ function auxin_get_audio_master_array( $master_array ) {
|
|
126 |
'type' => 'textfield',
|
127 |
'value' => '',
|
128 |
'def_value' => '',
|
129 |
-
'holder' => '
|
130 |
'class' => 'extra_classes',
|
131 |
-
'admin_label' =>
|
132 |
'dependency' => '',
|
133 |
'weight' => '',
|
134 |
-
'group' => '
|
135 |
'edit_field_class' => ''
|
136 |
)
|
137 |
-
|
138 |
)
|
139 |
);
|
140 |
|
@@ -152,10 +149,9 @@ function auxin_widget_audio_callback( $atts, $shortcode_content = null ){
|
|
152 |
// Defining default attributes
|
153 |
$default_atts = array(
|
154 |
'title' => '', // section title
|
155 |
-
|
156 |
'src' => '',
|
157 |
-
'loop' => '',
|
158 |
-
'autoplay' => '',
|
159 |
'preload' => '',
|
160 |
'skin' => '', // dark or light
|
161 |
|
@@ -188,6 +184,8 @@ function auxin_widget_audio_callback( $atts, $shortcode_content = null ){
|
|
188 |
$class .= ' aux-provider-'. $provider;
|
189 |
}
|
190 |
|
|
|
|
|
191 |
echo do_shortcode( sprintf( '[audio src="%s" loop="%s" autoplay="%s" preload="%s" class="%s"]', $src, $loop, $autoplay, $preload, $class ) );
|
192 |
|
193 |
// widget footer ------------------------------
|
47 |
'value' => '',
|
48 |
'holder' => 'textfield',
|
49 |
'class' => 'title',
|
50 |
+
'admin_label' => false,
|
51 |
'dependency' => '',
|
52 |
'weight' => '',
|
53 |
'group' => '' ,
|
59 |
'param_name' => 'src',
|
60 |
'type' => 'aux_select_audio',
|
61 |
'value' => '',
|
62 |
+
'holder' => '',
|
63 |
'class' => 'audio_src',
|
64 |
+
'admin_label' => false,
|
65 |
'dependency' => '',
|
66 |
'weight' => '',
|
67 |
'group' => '' ,
|
72 |
'description' => '',
|
73 |
'param_name' => 'loop',
|
74 |
'type' => 'aux_switch',
|
75 |
+
'value' => '1',
|
|
|
76 |
'class' => '',
|
77 |
+
'admin_label' => false,
|
78 |
'dependency' => '',
|
79 |
'weight' => '',
|
80 |
+
'group' => '',
|
81 |
'edit_field_class' => ''
|
82 |
),
|
83 |
array(
|
85 |
'description' => __('Play the audio file automatically.','auxin-elements' ),
|
86 |
'param_name' => 'autoplay',
|
87 |
'type' => 'aux_switch',
|
|
|
88 |
'value' => '0',
|
89 |
'class' => '',
|
90 |
+
'admin_label' => false,
|
91 |
'dependency' => '',
|
92 |
'weight' => '',
|
93 |
+
'group' => '',
|
94 |
'edit_field_class' => ''
|
95 |
),
|
96 |
array(
|
100 |
'type' => 'aux_visual_select',
|
101 |
'def_value' => 'dark',
|
102 |
'choices' => array(
|
103 |
+
'dark' => array(
|
104 |
'label' => __('Dark', 'auxin-elements'),
|
105 |
'image' => AUX_URL . 'images/visual-select/audio-player-dark.svg'
|
106 |
),
|
107 |
+
'light' => array(
|
108 |
'label' => __('Light', 'auxin-elements'),
|
109 |
'image' => AUX_URL . 'images/visual-select/audio-player-light.svg'
|
110 |
)
|
111 |
),
|
112 |
+
'holder' => '',
|
113 |
'class' => 'skin',
|
114 |
'admin_label' => true,
|
115 |
'dependency' => '',
|
116 |
'weight' => '',
|
117 |
+
'group' => __('Appearance', 'auxin-elements'),
|
118 |
'edit_field_class' => ''
|
119 |
),
|
120 |
array(
|
124 |
'type' => 'textfield',
|
125 |
'value' => '',
|
126 |
'def_value' => '',
|
127 |
+
'holder' => '',
|
128 |
'class' => 'extra_classes',
|
129 |
+
'admin_label' => false,
|
130 |
'dependency' => '',
|
131 |
'weight' => '',
|
132 |
+
'group' => __('Appearance', 'auxin-elements'),
|
133 |
'edit_field_class' => ''
|
134 |
)
|
|
|
135 |
)
|
136 |
);
|
137 |
|
149 |
// Defining default attributes
|
150 |
$default_atts = array(
|
151 |
'title' => '', // section title
|
|
|
152 |
'src' => '',
|
153 |
+
'loop' => '1',
|
154 |
+
'autoplay' => '0',
|
155 |
'preload' => '',
|
156 |
'skin' => '', // dark or light
|
157 |
|
184 |
$class .= ' aux-provider-'. $provider;
|
185 |
}
|
186 |
|
187 |
+
$autoplay = auxin_is_true( $autoplay ) ? "1": "0";
|
188 |
+
$loop = auxin_is_true( $loop ) ? "1": "0";
|
189 |
echo do_shortcode( sprintf( '[audio src="%s" loop="%s" autoplay="%s" preload="%s" class="%s"]', $src, $loop, $autoplay, $preload, $class ) );
|
190 |
|
191 |
// widget footer ------------------------------
|
includes/elements/before-after.php
CHANGED
@@ -44,10 +44,9 @@ function auxin_get_before_after_master_array( $master_array ) {
|
|
44 |
'param_name' => 'title',
|
45 |
'type' => 'textfield',
|
46 |
'value' => '',
|
47 |
-
'def_value' => '',
|
48 |
'holder' => 'textfield',
|
49 |
'class' => 'id',
|
50 |
-
'admin_label' =>
|
51 |
'dependency' => '',
|
52 |
'weight' => '',
|
53 |
'group' => '' ,
|
@@ -59,8 +58,6 @@ function auxin_get_before_after_master_array( $master_array ) {
|
|
59 |
'param_name' => 'before_attach_id',
|
60 |
'type' => 'attach_image',
|
61 |
'value' => '',
|
62 |
-
'def_value' => '',
|
63 |
-
'holder' => 'textfield',
|
64 |
'class' => 'before_attach_id',
|
65 |
'admin_label' => false,
|
66 |
'dependency' => '',
|
@@ -75,7 +72,6 @@ function auxin_get_before_after_master_array( $master_array ) {
|
|
75 |
'type' => 'attach_image',
|
76 |
'value' => '',
|
77 |
'def_value' => '',
|
78 |
-
'holder' => 'textfield',
|
79 |
'class' => 'after_attach_id',
|
80 |
'admin_label' => false,
|
81 |
'dependency' => '',
|
@@ -83,7 +79,6 @@ function auxin_get_before_after_master_array( $master_array ) {
|
|
83 |
'group' => '' ,
|
84 |
'edit_field_class' => ''
|
85 |
),
|
86 |
-
|
87 |
array(
|
88 |
'heading' => __( 'Start offset','auxin-elements' ),
|
89 |
'description' => __( 'How much of the before image is visible when the page loads, between 0 to 1.', 'auxin-elements' ),
|
@@ -91,7 +86,6 @@ function auxin_get_before_after_master_array( $master_array ) {
|
|
91 |
'type' => 'textfield',
|
92 |
'value' => '0.5',
|
93 |
'def_value' => '',
|
94 |
-
'holder' => 'textfield',
|
95 |
'class' => 'default_offset',
|
96 |
'admin_label' => false,
|
97 |
'dependency' => '',
|
@@ -99,7 +93,6 @@ function auxin_get_before_after_master_array( $master_array ) {
|
|
99 |
'group' => '' ,
|
100 |
'edit_field_class' => ''
|
101 |
),
|
102 |
-
|
103 |
array(
|
104 |
'heading' => __('Image size','auxin-elements' ),
|
105 |
'description' => '',
|
@@ -112,46 +105,38 @@ function auxin_get_before_after_master_array( $master_array ) {
|
|
112 |
'large' => __('Large' , 'auxin-elements' ),
|
113 |
'full' => __('Full' , 'auxin-elements' )
|
114 |
),
|
115 |
-
'
|
116 |
-
'admin_label' => false,
|
117 |
'dependency' => '',
|
118 |
'weight' => '',
|
119 |
'group' => '' ,
|
120 |
'edit_field_class' => ''
|
121 |
),
|
122 |
-
|
123 |
array(
|
124 |
'heading' => __('Width','auxin-elements' ),
|
125 |
'description' => '',
|
126 |
'param_name' => 'width',
|
127 |
'type' => 'textfield',
|
128 |
'value' => '',
|
129 |
-
'def_value' => '',
|
130 |
-
'holder' => 'textfield',
|
131 |
'class' => 'width',
|
132 |
-
'admin_label' =>
|
133 |
'dependency' => '',
|
134 |
'weight' => '',
|
135 |
'group' => '' ,
|
136 |
'edit_field_class' => ''
|
137 |
),
|
138 |
-
|
139 |
array(
|
140 |
'heading' => __('Height','auxin-elements' ),
|
141 |
'description' => '',
|
142 |
'param_name' => 'height',
|
143 |
'type' => 'textfield',
|
144 |
'value' => '',
|
145 |
-
'def_value' => '',
|
146 |
-
'holder' => 'textfield',
|
147 |
'class' => 'height',
|
148 |
-
'admin_label' =>
|
149 |
'dependency' => '',
|
150 |
'weight' => '',
|
151 |
'group' => '' ,
|
152 |
'edit_field_class' => ''
|
153 |
),
|
154 |
-
|
155 |
array(
|
156 |
'heading' => __('Extra class name','auxin-elements' ),
|
157 |
'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' ),
|
@@ -159,7 +144,6 @@ function auxin_get_before_after_master_array( $master_array ) {
|
|
159 |
'type' => 'textfield',
|
160 |
'value' => '',
|
161 |
'def_value' => '',
|
162 |
-
'holder' => 'textfield',
|
163 |
'class' => 'extra_classes',
|
164 |
'admin_label' => false,
|
165 |
'dependency' => '',
|
@@ -167,7 +151,6 @@ function auxin_get_before_after_master_array( $master_array ) {
|
|
167 |
'group' => '' ,
|
168 |
'edit_field_class' => ''
|
169 |
)
|
170 |
-
|
171 |
)
|
172 |
);
|
173 |
|
@@ -189,6 +172,7 @@ function auxin_widget_before_after_callback( $atts, $shortcode_content = null ){
|
|
189 |
'size' => 'large',
|
190 |
'crop' => true,
|
191 |
'default_offset' => '0.5',
|
|
|
192 |
'extra_classes' => '', // custom css class names for this element
|
193 |
'custom_el_id' => '', // custom id attribute for this element
|
194 |
'base_class' => 'aux-widget-before-after' // base class name for container
|
@@ -223,6 +207,7 @@ function auxin_widget_before_after_callback( $atts, $shortcode_content = null ){
|
|
223 |
echo $result['widget_header'];
|
224 |
echo $result['widget_title'];
|
225 |
|
|
|
226 |
// widget output -----------------------
|
227 |
if ( !empty( $after_image ) ) {
|
228 |
?>
|
44 |
'param_name' => 'title',
|
45 |
'type' => 'textfield',
|
46 |
'value' => '',
|
|
|
47 |
'holder' => 'textfield',
|
48 |
'class' => 'id',
|
49 |
+
'admin_label' => false,
|
50 |
'dependency' => '',
|
51 |
'weight' => '',
|
52 |
'group' => '' ,
|
58 |
'param_name' => 'before_attach_id',
|
59 |
'type' => 'attach_image',
|
60 |
'value' => '',
|
|
|
|
|
61 |
'class' => 'before_attach_id',
|
62 |
'admin_label' => false,
|
63 |
'dependency' => '',
|
72 |
'type' => 'attach_image',
|
73 |
'value' => '',
|
74 |
'def_value' => '',
|
|
|
75 |
'class' => 'after_attach_id',
|
76 |
'admin_label' => false,
|
77 |
'dependency' => '',
|
79 |
'group' => '' ,
|
80 |
'edit_field_class' => ''
|
81 |
),
|
|
|
82 |
array(
|
83 |
'heading' => __( 'Start offset','auxin-elements' ),
|
84 |
'description' => __( 'How much of the before image is visible when the page loads, between 0 to 1.', 'auxin-elements' ),
|
86 |
'type' => 'textfield',
|
87 |
'value' => '0.5',
|
88 |
'def_value' => '',
|
|
|
89 |
'class' => 'default_offset',
|
90 |
'admin_label' => false,
|
91 |
'dependency' => '',
|
93 |
'group' => '' ,
|
94 |
'edit_field_class' => ''
|
95 |
),
|
|
|
96 |
array(
|
97 |
'heading' => __('Image size','auxin-elements' ),
|
98 |
'description' => '',
|
105 |
'large' => __('Large' , 'auxin-elements' ),
|
106 |
'full' => __('Full' , 'auxin-elements' )
|
107 |
),
|
108 |
+
'admin_label' => true,
|
|
|
109 |
'dependency' => '',
|
110 |
'weight' => '',
|
111 |
'group' => '' ,
|
112 |
'edit_field_class' => ''
|
113 |
),
|
|
|
114 |
array(
|
115 |
'heading' => __('Width','auxin-elements' ),
|
116 |
'description' => '',
|
117 |
'param_name' => 'width',
|
118 |
'type' => 'textfield',
|
119 |
'value' => '',
|
|
|
|
|
120 |
'class' => 'width',
|
121 |
+
'admin_label' => true,
|
122 |
'dependency' => '',
|
123 |
'weight' => '',
|
124 |
'group' => '' ,
|
125 |
'edit_field_class' => ''
|
126 |
),
|
|
|
127 |
array(
|
128 |
'heading' => __('Height','auxin-elements' ),
|
129 |
'description' => '',
|
130 |
'param_name' => 'height',
|
131 |
'type' => 'textfield',
|
132 |
'value' => '',
|
|
|
|
|
133 |
'class' => 'height',
|
134 |
+
'admin_label' => true,
|
135 |
'dependency' => '',
|
136 |
'weight' => '',
|
137 |
'group' => '' ,
|
138 |
'edit_field_class' => ''
|
139 |
),
|
|
|
140 |
array(
|
141 |
'heading' => __('Extra class name','auxin-elements' ),
|
142 |
'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' ),
|
144 |
'type' => 'textfield',
|
145 |
'value' => '',
|
146 |
'def_value' => '',
|
|
|
147 |
'class' => 'extra_classes',
|
148 |
'admin_label' => false,
|
149 |
'dependency' => '',
|
151 |
'group' => '' ,
|
152 |
'edit_field_class' => ''
|
153 |
)
|
|
|
154 |
)
|
155 |
);
|
156 |
|
172 |
'size' => 'large',
|
173 |
'crop' => true,
|
174 |
'default_offset' => '0.5',
|
175 |
+
|
176 |
'extra_classes' => '', // custom css class names for this element
|
177 |
'custom_el_id' => '', // custom id attribute for this element
|
178 |
'base_class' => 'aux-widget-before-after' // base class name for container
|
207 |
echo $result['widget_header'];
|
208 |
echo $result['widget_title'];
|
209 |
|
210 |
+
|
211 |
// widget output -----------------------
|
212 |
if ( !empty( $after_image ) ) {
|
213 |
?>
|
includes/elements/button.php
CHANGED
@@ -47,7 +47,7 @@ function auxin_get_button_master_array( $master_array ) {
|
|
47 |
'value' => 'Button',
|
48 |
'holder' => 'textfield',
|
49 |
'class' => 'label',
|
50 |
-
'admin_label' =>
|
51 |
'dependency' => '',
|
52 |
'weight' => '',
|
53 |
'group' => '' ,
|
@@ -66,7 +66,7 @@ function auxin_get_button_master_array( $master_array ) {
|
|
66 |
'small' => __('Small' , 'auxin-elements' ),
|
67 |
'tiny' => __('Tiny' , 'auxin-elements' )
|
68 |
),
|
69 |
-
'holder' => '
|
70 |
'class' => 'round',
|
71 |
'admin_label' => true,
|
72 |
'dependency' => '',
|
@@ -74,75 +74,68 @@ function auxin_get_button_master_array( $master_array ) {
|
|
74 |
'group' => '' ,
|
75 |
'edit_field_class' => ''
|
76 |
),
|
77 |
-
|
78 |
array(
|
79 |
'heading' => __('Button shape style','auxin-elements' ),
|
80 |
'description' => '',
|
81 |
'param_name' => 'border',
|
82 |
'type' => 'aux_visual_select',
|
83 |
'value' => '',
|
84 |
-
'holder' => 'dropdown',
|
85 |
'class' => 'border',
|
86 |
-
'admin_label' =>
|
87 |
'dependency' => '',
|
88 |
'weight' => '',
|
89 |
-
'group' => '
|
90 |
'edit_field_class' => '',
|
91 |
'choices' => array(
|
92 |
-
''
|
93 |
'label' => __('Box', 'auxin-elements' ),
|
94 |
'image' => AUX_URL . 'images/visual-select/button-normal.svg'
|
95 |
),
|
96 |
-
'round'
|
97 |
'label' => __('Round', 'auxin-elements' ),
|
98 |
'image' => AUX_URL . 'images/visual-select/button-curved.svg'
|
99 |
),
|
100 |
-
'curve'
|
101 |
'label' => __('Curve', 'auxin-elements' ),
|
102 |
'image' => AUX_URL . 'images/visual-select/button-rounded.svg'
|
103 |
)
|
104 |
)
|
105 |
),
|
106 |
-
|
107 |
array(
|
108 |
'heading' => __('Button style','auxin-elements' ),
|
109 |
'description' => '',
|
110 |
'param_name' => 'style',
|
111 |
'type' => 'aux_visual_select',
|
112 |
'value' => '',
|
113 |
-
'holder' => 'dropdown',
|
114 |
'class' => 'style',
|
115 |
-
'admin_label' =>
|
116 |
'dependency' => '',
|
117 |
'weight' => '',
|
118 |
-
'group' => '
|
119 |
'edit_field_class' => '',
|
120 |
'choices' => array(
|
121 |
-
''
|
122 |
'label' => __('Normal', 'auxin-elements' ),
|
123 |
'image' => AUX_URL . 'images/visual-select/button-normal.svg'
|
124 |
),
|
125 |
-
'3d'
|
126 |
'label' => __('3D', 'auxin-elements' ),
|
127 |
'image' => AUX_URL . 'images/visual-select/button-3d.svg'
|
128 |
),
|
129 |
-
'outline'
|
130 |
'label' => __('Outline', 'auxin-elements' ),
|
131 |
'image' => AUX_URL . 'images/visual-select/button-outline.svg'
|
132 |
)
|
133 |
)
|
134 |
),
|
135 |
-
|
136 |
array(
|
137 |
'heading' => __('Uppercase label','auxin-elements' ),
|
138 |
'description' => '',
|
139 |
'param_name' => 'uppercase',
|
140 |
'type' => 'aux_switch',
|
141 |
-
'def_value' => '',
|
142 |
'value' => '1',
|
143 |
-
'
|
144 |
-
'
|
145 |
-
'admin_label' => true,
|
146 |
'dependency' => '',
|
147 |
'weight' => '',
|
148 |
'group' => '' ,
|
@@ -153,27 +146,22 @@ function auxin_get_button_master_array( $master_array ) {
|
|
153 |
'description' => __('Darken label of button while mouse over it.','auxin-elements' ),
|
154 |
'param_name' => 'dark',
|
155 |
'type' => 'aux_switch',
|
156 |
-
'def_value' => '',
|
157 |
'value' => '0',
|
158 |
-
'
|
159 |
-
'
|
160 |
-
'admin_label' => true,
|
161 |
'dependency' => '',
|
162 |
'weight' => '',
|
163 |
'group' => '' ,
|
164 |
'edit_field_class' => ''
|
165 |
),
|
166 |
-
|
167 |
array(
|
168 |
'heading' => __('Icon for button','auxin-elements' ),
|
169 |
'description' => '',
|
170 |
'param_name' => 'icon',
|
171 |
-
'type' => '
|
172 |
-
'def_value' => '',
|
173 |
'value' => '',
|
174 |
-
'holder' => 'icon',
|
175 |
'class' => 'icon-name',
|
176 |
-
'admin_label' =>
|
177 |
'dependency' => '',
|
178 |
'weight' => '',
|
179 |
'group' => '' ,
|
@@ -184,18 +172,18 @@ function auxin_get_button_master_array( $master_array ) {
|
|
184 |
'description' => '',
|
185 |
'param_name' => 'icon_align',
|
186 |
'type' => 'dropdown',
|
187 |
-
'def_value' => '',
|
188 |
'value' => array(
|
189 |
-
''
|
190 |
'left' => __('Left' , 'auxin-elements' ),
|
191 |
'right' => __('Right' , 'auxin-elements' ),
|
192 |
'over' => __('Over' , 'auxin-elements' ),
|
193 |
'left-animate' => __('Animate from Left' , 'auxin-elements' ),
|
194 |
'right-animate' => __('Animate from Right' , 'auxin-elements' )
|
195 |
),
|
196 |
-
'holder' => '
|
197 |
'class' => 'icon-align',
|
198 |
-
'admin_label' =>
|
199 |
'dependency' => '',
|
200 |
'weight' => '',
|
201 |
'group' => '' ,
|
@@ -206,14 +194,14 @@ function auxin_get_button_master_array( $master_array ) {
|
|
206 |
'description' => '',
|
207 |
'param_name' => 'color_name',
|
208 |
'type' => 'aux_visual_select',
|
209 |
-
'
|
210 |
-
'choices'
|
211 |
'holder' => '',
|
212 |
'class' => 'color',
|
213 |
-
'admin_label' =>
|
214 |
'dependency' => '',
|
215 |
'weight' => '',
|
216 |
-
'group' => '' ,
|
217 |
'edit_field_class' => ''
|
218 |
),
|
219 |
array(
|
@@ -222,10 +210,9 @@ function auxin_get_button_master_array( $master_array ) {
|
|
222 |
'param_name' => 'link',
|
223 |
'type' => 'textfield',
|
224 |
'value' => '',
|
225 |
-
'
|
226 |
-
'holder' => 'textfield',
|
227 |
'class' => 'link',
|
228 |
-
'admin_label' =>
|
229 |
'dependency' => '',
|
230 |
'weight' => '',
|
231 |
'group' => '' ,
|
@@ -241,9 +228,23 @@ function auxin_get_button_master_array( $master_array ) {
|
|
241 |
'_self' => __('Current page' , 'auxin-elements' ),
|
242 |
'_blank' => __('New page', 'auxin-elements' )
|
243 |
),
|
244 |
-
'holder' => '
|
245 |
'class' => 'target',
|
246 |
-
'admin_label' =>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
'dependency' => '',
|
248 |
'weight' => '',
|
249 |
'group' => '' ,
|
@@ -269,12 +270,12 @@ function auxin_widget_button_callback( $atts, $shortcode_content = null ){
|
|
269 |
'uppercase' => '1',
|
270 |
'dark' => '0',
|
271 |
'icon' => '',
|
272 |
-
'icon_align' => '',
|
273 |
'color_name' => 'carmine-pink',
|
274 |
'link' => '',
|
275 |
'target' => '_self',
|
276 |
|
277 |
-
'extra_classes' => '',
|
278 |
'custom_el_id' => '',
|
279 |
'base_class' => 'aux-widget-button'
|
280 |
);
|
@@ -282,6 +283,9 @@ function auxin_widget_button_callback( $atts, $shortcode_content = null ){
|
|
282 |
$result = auxin_get_widget_scafold( $atts, $default_atts, $shortcode_content );
|
283 |
extract( $result['parsed_atts'] );
|
284 |
|
|
|
|
|
|
|
285 |
// --------------------------------------------
|
286 |
$btn_css_classes = array( 'aux-button' );
|
287 |
$btn_css_classes[] = 'aux-' . $size; // size
|
@@ -296,12 +300,17 @@ function auxin_widget_button_callback( $atts, $shortcode_content = null ){
|
|
296 |
if( auxin_is_true( $dark ) ){
|
297 |
$btn_css_classes[] = 'aux-dark-text'; // text color
|
298 |
}
|
299 |
-
if( $icon_align ){
|
300 |
$btn_css_classes[] = 'aux-icon-' . $icon_align; // icon align
|
301 |
}
|
302 |
|
|
|
|
|
|
|
|
|
303 |
$button_class_attr = auxin_make_html_class_attribute( $btn_css_classes );
|
304 |
|
|
|
305 |
$label = empty( $label ) ? $shortcode_content : $label;
|
306 |
|
307 |
$btn_content = '<span class="aux-overlay"></span>';
|
47 |
'value' => 'Button',
|
48 |
'holder' => 'textfield',
|
49 |
'class' => 'label',
|
50 |
+
'admin_label' => false,
|
51 |
'dependency' => '',
|
52 |
'weight' => '',
|
53 |
'group' => '' ,
|
66 |
'small' => __('Small' , 'auxin-elements' ),
|
67 |
'tiny' => __('Tiny' , 'auxin-elements' )
|
68 |
),
|
69 |
+
'holder' => '',
|
70 |
'class' => 'round',
|
71 |
'admin_label' => true,
|
72 |
'dependency' => '',
|
74 |
'group' => '' ,
|
75 |
'edit_field_class' => ''
|
76 |
),
|
|
|
77 |
array(
|
78 |
'heading' => __('Button shape style','auxin-elements' ),
|
79 |
'description' => '',
|
80 |
'param_name' => 'border',
|
81 |
'type' => 'aux_visual_select',
|
82 |
'value' => '',
|
|
|
83 |
'class' => 'border',
|
84 |
+
'admin_label' => false,
|
85 |
'dependency' => '',
|
86 |
'weight' => '',
|
87 |
+
'group' => 'Appearance' ,
|
88 |
'edit_field_class' => '',
|
89 |
'choices' => array(
|
90 |
+
'' => array(
|
91 |
'label' => __('Box', 'auxin-elements' ),
|
92 |
'image' => AUX_URL . 'images/visual-select/button-normal.svg'
|
93 |
),
|
94 |
+
'round' => array(
|
95 |
'label' => __('Round', 'auxin-elements' ),
|
96 |
'image' => AUX_URL . 'images/visual-select/button-curved.svg'
|
97 |
),
|
98 |
+
'curve' => array(
|
99 |
'label' => __('Curve', 'auxin-elements' ),
|
100 |
'image' => AUX_URL . 'images/visual-select/button-rounded.svg'
|
101 |
)
|
102 |
)
|
103 |
),
|
|
|
104 |
array(
|
105 |
'heading' => __('Button style','auxin-elements' ),
|
106 |
'description' => '',
|
107 |
'param_name' => 'style',
|
108 |
'type' => 'aux_visual_select',
|
109 |
'value' => '',
|
|
|
110 |
'class' => 'style',
|
111 |
+
'admin_label' => false,
|
112 |
'dependency' => '',
|
113 |
'weight' => '',
|
114 |
+
'group' => 'Appearance' ,
|
115 |
'edit_field_class' => '',
|
116 |
'choices' => array(
|
117 |
+
'' => array(
|
118 |
'label' => __('Normal', 'auxin-elements' ),
|
119 |
'image' => AUX_URL . 'images/visual-select/button-normal.svg'
|
120 |
),
|
121 |
+
'3d' => array(
|
122 |
'label' => __('3D', 'auxin-elements' ),
|
123 |
'image' => AUX_URL . 'images/visual-select/button-3d.svg'
|
124 |
),
|
125 |
+
'outline' => array(
|
126 |
'label' => __('Outline', 'auxin-elements' ),
|
127 |
'image' => AUX_URL . 'images/visual-select/button-outline.svg'
|
128 |
)
|
129 |
)
|
130 |
),
|
|
|
131 |
array(
|
132 |
'heading' => __('Uppercase label','auxin-elements' ),
|
133 |
'description' => '',
|
134 |
'param_name' => 'uppercase',
|
135 |
'type' => 'aux_switch',
|
|
|
136 |
'value' => '1',
|
137 |
+
'class' => 'uppercase',
|
138 |
+
'admin_label' => false,
|
|
|
139 |
'dependency' => '',
|
140 |
'weight' => '',
|
141 |
'group' => '' ,
|
146 |
'description' => __('Darken label of button while mouse over it.','auxin-elements' ),
|
147 |
'param_name' => 'dark',
|
148 |
'type' => 'aux_switch',
|
|
|
149 |
'value' => '0',
|
150 |
+
'class' => 'dark',
|
151 |
+
'admin_label' => false,
|
|
|
152 |
'dependency' => '',
|
153 |
'weight' => '',
|
154 |
'group' => '' ,
|
155 |
'edit_field_class' => ''
|
156 |
),
|
|
|
157 |
array(
|
158 |
'heading' => __('Icon for button','auxin-elements' ),
|
159 |
'description' => '',
|
160 |
'param_name' => 'icon',
|
161 |
+
'type' => 'aux_iconpicker',
|
|
|
162 |
'value' => '',
|
|
|
163 |
'class' => 'icon-name',
|
164 |
+
'admin_label' => false,
|
165 |
'dependency' => '',
|
166 |
'weight' => '',
|
167 |
'group' => '' ,
|
172 |
'description' => '',
|
173 |
'param_name' => 'icon_align',
|
174 |
'type' => 'dropdown',
|
175 |
+
'def_value' => 'default',
|
176 |
'value' => array(
|
177 |
+
'default' => __('Default' , 'auxin-elements' ),
|
178 |
'left' => __('Left' , 'auxin-elements' ),
|
179 |
'right' => __('Right' , 'auxin-elements' ),
|
180 |
'over' => __('Over' , 'auxin-elements' ),
|
181 |
'left-animate' => __('Animate from Left' , 'auxin-elements' ),
|
182 |
'right-animate' => __('Animate from Right' , 'auxin-elements' )
|
183 |
),
|
184 |
+
'holder' => '',
|
185 |
'class' => 'icon-align',
|
186 |
+
'admin_label' => false,
|
187 |
'dependency' => '',
|
188 |
'weight' => '',
|
189 |
'group' => '' ,
|
194 |
'description' => '',
|
195 |
'param_name' => 'color_name',
|
196 |
'type' => 'aux_visual_select',
|
197 |
+
'value' => 'carmine-pink',
|
198 |
+
'choices' => auxin_get_famous_colors_list(),
|
199 |
'holder' => '',
|
200 |
'class' => 'color',
|
201 |
+
'admin_label' => false,
|
202 |
'dependency' => '',
|
203 |
'weight' => '',
|
204 |
+
'group' => 'Appearance' ,
|
205 |
'edit_field_class' => ''
|
206 |
),
|
207 |
array(
|
210 |
'param_name' => 'link',
|
211 |
'type' => 'textfield',
|
212 |
'value' => '',
|
213 |
+
'holder' => '',
|
|
|
214 |
'class' => 'link',
|
215 |
+
'admin_label' => false,
|
216 |
'dependency' => '',
|
217 |
'weight' => '',
|
218 |
'group' => '' ,
|
228 |
'_self' => __('Current page' , 'auxin-elements' ),
|
229 |
'_blank' => __('New page', 'auxin-elements' )
|
230 |
),
|
231 |
+
'holder' => '',
|
232 |
'class' => 'target',
|
233 |
+
'admin_label' => false,
|
234 |
+
'dependency' => '',
|
235 |
+
'weight' => '',
|
236 |
+
'group' => '' ,
|
237 |
+
'edit_field_class' => ''
|
238 |
+
),
|
239 |
+
array(
|
240 |
+
'heading' => __('Extra class name','auxin-elements'),
|
241 |
+
'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'),
|
242 |
+
'param_name' => 'extra_classes',
|
243 |
+
'type' => 'textfield',
|
244 |
+
'value' => '',
|
245 |
+
'holder' => '',
|
246 |
+
'class' => 'extra_classes',
|
247 |
+
'admin_label' => false,
|
248 |
'dependency' => '',
|
249 |
'weight' => '',
|
250 |
'group' => '' ,
|
270 |
'uppercase' => '1',
|
271 |
'dark' => '0',
|
272 |
'icon' => '',
|
273 |
+
'icon_align' => 'default',
|
274 |
'color_name' => 'carmine-pink',
|
275 |
'link' => '',
|
276 |
'target' => '_self',
|
277 |
|
278 |
+
'extra_classes' => '', // custom css class names for this element
|
279 |
'custom_el_id' => '',
|
280 |
'base_class' => 'aux-widget-button'
|
281 |
);
|
283 |
$result = auxin_get_widget_scafold( $atts, $default_atts, $shortcode_content );
|
284 |
extract( $result['parsed_atts'] );
|
285 |
|
286 |
+
|
287 |
+
|
288 |
+
|
289 |
// --------------------------------------------
|
290 |
$btn_css_classes = array( 'aux-button' );
|
291 |
$btn_css_classes[] = 'aux-' . $size; // size
|
300 |
if( auxin_is_true( $dark ) ){
|
301 |
$btn_css_classes[] = 'aux-dark-text'; // text color
|
302 |
}
|
303 |
+
if( $icon_align !== "default" ){
|
304 |
$btn_css_classes[] = 'aux-icon-' . $icon_align; // icon align
|
305 |
}
|
306 |
|
307 |
+
if( ! empty( $extra_classes ) ) {
|
308 |
+
$btn_css_classes[] = $extra_classes;
|
309 |
+
}
|
310 |
+
|
311 |
$button_class_attr = auxin_make_html_class_attribute( $btn_css_classes );
|
312 |
|
313 |
+
|
314 |
$label = empty( $label ) ? $shortcode_content : $label;
|
315 |
|
316 |
$btn_content = '<span class="aux-overlay"></span>';
|
includes/elements/code.php
CHANGED
@@ -48,7 +48,7 @@ function auxin_get_code_master_array( $master_array ) {
|
|
48 |
'value' => '',
|
49 |
'holder' => 'textfield',
|
50 |
'class' => 'title',
|
51 |
-
'admin_label' =>
|
52 |
'dependency' => '',
|
53 |
'weight' => '',
|
54 |
'group' => '' ,
|
@@ -58,12 +58,12 @@ function auxin_get_code_master_array( $master_array ) {
|
|
58 |
'heading' => __('Code','auxin-elements' ),
|
59 |
'description' => '',
|
60 |
'param_name' => 'content',
|
61 |
-
'type' => '
|
62 |
'value' => '',
|
63 |
'def_value' => '',
|
64 |
-
'holder' => '
|
65 |
'class' => 'content',
|
66 |
-
'admin_label' =>
|
67 |
'dependency' => '',
|
68 |
'weight' => '',
|
69 |
'group' => '' ,
|
@@ -81,9 +81,9 @@ function auxin_get_code_master_array( $master_array ) {
|
|
81 |
'xml' => __('XML' , 'auxin-elements' ),
|
82 |
'php' => __('PHP' , 'auxin-elements' )
|
83 |
),
|
84 |
-
'holder' => '
|
85 |
'class' => 'language',
|
86 |
-
'admin_label' =>
|
87 |
'dependency' => '',
|
88 |
'weight' => '',
|
89 |
'group' => '' ,
|
@@ -96,20 +96,20 @@ function auxin_get_code_master_array( $master_array ) {
|
|
96 |
'type' => 'dropdown',
|
97 |
'def_value' => 'tomorrow',
|
98 |
'value' => array(
|
99 |
-
'default'
|
100 |
-
'androidstudio'
|
101 |
-
'atom-one-dark'
|
102 |
-
'atom-one-light'=> __('Atom Light' , 'auxin-elements' ),
|
103 |
-
'github'
|
104 |
-
'googlecode'
|
105 |
-
'railscasts'
|
106 |
-
'solarized-light'
|
107 |
-
'tomorrow-night'
|
108 |
-
'tomorrow'
|
109 |
-
'vs'
|
110 |
-
'zenburn'
|
111 |
),
|
112 |
-
'holder' => '
|
113 |
'class' => 'theme',
|
114 |
'admin_label' => true,
|
115 |
'dependency' => '',
|
@@ -117,21 +117,21 @@ function auxin_get_code_master_array( $master_array ) {
|
|
117 |
'group' => '' ,
|
118 |
'edit_field_class' => ''
|
119 |
),
|
120 |
-
|
121 |
'heading' => __('Extra class name','auxin-elements' ),
|
122 |
'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' ),
|
123 |
'param_name' => 'extra_classes',
|
124 |
'type' => 'textfield',
|
125 |
'value' => '',
|
126 |
'def_value' => '',
|
127 |
-
'holder' => '
|
128 |
'class' => 'extra_classes',
|
129 |
-
'admin_label' =>
|
130 |
'dependency' => '',
|
131 |
'weight' => '',
|
132 |
'group' => '' ,
|
133 |
'edit_field_class' => ''
|
134 |
-
|
135 |
)
|
136 |
);
|
137 |
|
@@ -193,6 +193,14 @@ function auxin_widget_code_callback( $atts, $shortcode_content = null ){
|
|
193 |
$theme = 'default';
|
194 |
}
|
195 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
echo '<div class="hljs-'. $theme .'">' .
|
197 |
'<pre class="aux-widget-code ' . $extra_classes . '">' .
|
198 |
'<code class="' . $language . '">' . do_shortcode( $content ) .
|
48 |
'value' => '',
|
49 |
'holder' => 'textfield',
|
50 |
'class' => 'title',
|
51 |
+
'admin_label' => false,
|
52 |
'dependency' => '',
|
53 |
'weight' => '',
|
54 |
'group' => '' ,
|
58 |
'heading' => __('Code','auxin-elements' ),
|
59 |
'description' => '',
|
60 |
'param_name' => 'content',
|
61 |
+
'type' => 'textarea_raw_html',
|
62 |
'value' => '',
|
63 |
'def_value' => '',
|
64 |
+
'holder' => '',
|
65 |
'class' => 'content',
|
66 |
+
'admin_label' => false,
|
67 |
'dependency' => '',
|
68 |
'weight' => '',
|
69 |
'group' => '' ,
|
81 |
'xml' => __('XML' , 'auxin-elements' ),
|
82 |
'php' => __('PHP' , 'auxin-elements' )
|
83 |
),
|
84 |
+
'holder' => 'textfield',
|
85 |
'class' => 'language',
|
86 |
+
'admin_label' => false,
|
87 |
'dependency' => '',
|
88 |
'weight' => '',
|
89 |
'group' => '' ,
|
96 |
'type' => 'dropdown',
|
97 |
'def_value' => 'tomorrow',
|
98 |
'value' => array(
|
99 |
+
'default' => __('Default' , 'auxin-elements' ),
|
100 |
+
'androidstudio' => __('AndroidStudio' , 'auxin-elements' ),
|
101 |
+
'atom-one-dark' => __('Atom Dark' , 'auxin-elements' ),
|
102 |
+
'atom-one-light' => __('Atom Light' , 'auxin-elements' ),
|
103 |
+
'github' => __('Github' , 'auxin-elements' ),
|
104 |
+
'googlecode' => __('Google Code' , 'auxin-elements' ),
|
105 |
+
'railscasts' => __('RailsCasts' , 'auxin-elements' ),
|
106 |
+
'solarized-light' => __('Solarized Light' , 'auxin-elements' ),
|
107 |
+
'tomorrow-night' => __('Tomorrow Night' , 'auxin-elements' ),
|
108 |
+
'tomorrow' => __('Tomorrow' , 'auxin-elements' ),
|
109 |
+
'vs' => __('VisualStudio' , 'auxin-elements' ),
|
110 |
+
'zenburn' => __('ZenBurn' , 'auxin-elements' )
|
111 |
),
|
112 |
+
'holder' => '',
|
113 |
'class' => 'theme',
|
114 |
'admin_label' => true,
|
115 |
'dependency' => '',
|
117 |
'group' => '' ,
|
118 |
'edit_field_class' => ''
|
119 |
),
|
120 |
+
array(
|
121 |
'heading' => __('Extra class name','auxin-elements' ),
|
122 |
'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' ),
|
123 |
'param_name' => 'extra_classes',
|
124 |
'type' => 'textfield',
|
125 |
'value' => '',
|
126 |
'def_value' => '',
|
127 |
+
'holder' => '',
|
128 |
'class' => 'extra_classes',
|
129 |
+
'admin_label' => false,
|
130 |
'dependency' => '',
|
131 |
'weight' => '',
|
132 |
'group' => '' ,
|
133 |
'edit_field_class' => ''
|
134 |
+
)
|
135 |
)
|
136 |
);
|
137 |
|
193 |
$theme = 'default';
|
194 |
}
|
195 |
|
196 |
+
if ( empty( $content ) ) {
|
197 |
+
$content = auxin_get_gmap_style();
|
198 |
+
} elseif ( base64_decode( $content, true ) === false ) {
|
199 |
+
|
200 |
+
} else {
|
201 |
+
$content = rawurldecode( base64_decode( strip_tags( $content ) ) );
|
202 |
+
}
|
203 |
+
|
204 |
echo '<div class="hljs-'. $theme .'">' .
|
205 |
'<pre class="aux-widget-code ' . $extra_classes . '">' .
|
206 |
'<code class="' . $language . '">' . do_shortcode( $content ) .
|
includes/elements/contact-box.php
CHANGED
@@ -41,10 +41,9 @@ function get_auxin_contact_box( $master_array ) {
|
|
41 |
'param_name' => 'title',
|
42 |
'type' => 'textfield',
|
43 |
'value' => '',
|
44 |
-
'def_value' => '',
|
45 |
'holder' => 'textfield',
|
46 |
'class' => 'id',
|
47 |
-
'admin_label' =>
|
48 |
'dependency' => '',
|
49 |
'weight' => '',
|
50 |
'group' => '' ,
|
@@ -56,9 +55,9 @@ function get_auxin_contact_box( $master_array ) {
|
|
56 |
'param_name' => 'email',
|
57 |
'type' => 'textfield',
|
58 |
'value' => '',
|
59 |
-
'holder' => '
|
60 |
'class' => 'title',
|
61 |
-
'admin_label' =>
|
62 |
'dependency' => '',
|
63 |
'weight' => '',
|
64 |
'group' => '' ,
|
@@ -70,9 +69,9 @@ function get_auxin_contact_box( $master_array ) {
|
|
70 |
'param_name' => 'telephone',
|
71 |
'type' => 'textfield',
|
72 |
'value' => '',
|
73 |
-
'holder' => '
|
74 |
'class' => 'telephone',
|
75 |
-
'admin_label' =>
|
76 |
'weight' => '',
|
77 |
'group' => '',
|
78 |
'edit_field_class' => ''
|
@@ -83,9 +82,9 @@ function get_auxin_contact_box( $master_array ) {
|
|
83 |
'param_name' => 'address',
|
84 |
'type' => 'textfield',
|
85 |
'value' => '',
|
86 |
-
'holder' => '
|
87 |
'class' => '',
|
88 |
-
'admin_label' =>
|
89 |
'weight' => '',
|
90 |
'group' => '',
|
91 |
'edit_field_class' => ''
|
@@ -97,9 +96,9 @@ function get_auxin_contact_box( $master_array ) {
|
|
97 |
'type' => 'aux_switch',
|
98 |
'def_value' => '',
|
99 |
'value' => '1',
|
100 |
-
'holder' => '
|
101 |
'class' => 'show_socials',
|
102 |
-
'admin_label' =>
|
103 |
'dependency' => '',
|
104 |
'weight' => '',
|
105 |
'group' => '' ,
|
@@ -111,10 +110,10 @@ function get_auxin_contact_box( $master_array ) {
|
|
111 |
'param_name' => 'show_map',
|
112 |
'type' => 'aux_switch',
|
113 |
'def_value' => '',
|
114 |
-
'value' => '
|
115 |
-
'holder' => '
|
116 |
'class' => 'show_map',
|
117 |
-
'admin_label' =>
|
118 |
'dependency' => '',
|
119 |
'weight' => '',
|
120 |
'group' => '' ,
|
@@ -127,15 +126,15 @@ function get_auxin_contact_box( $master_array ) {
|
|
127 |
'type' => 'textfield',
|
128 |
'value' => '160',
|
129 |
'def_value' => '160',
|
130 |
-
'holder' => '
|
131 |
'class' => 'height',
|
132 |
-
'admin_label' =>
|
133 |
'dependency' => array(
|
134 |
'element' => 'show_map',
|
135 |
'value' => '1'
|
136 |
),
|
137 |
'weight' => '',
|
138 |
-
'group' => ''
|
139 |
'edit_field_class' => ''
|
140 |
),
|
141 |
array(
|
@@ -144,15 +143,15 @@ function get_auxin_contact_box( $master_array ) {
|
|
144 |
'param_name' => 'latitude',
|
145 |
'type' => 'textfield',
|
146 |
'value' => '40.7',
|
147 |
-
'holder' => '
|
148 |
'class' => '',
|
149 |
-
'admin_label' =>
|
150 |
'dependency' => array(
|
151 |
'element' => 'show_map',
|
152 |
'value' => '1'
|
153 |
),
|
154 |
'weight' => '',
|
155 |
-
'group' => ''
|
156 |
'edit_field_class' => ''
|
157 |
),
|
158 |
array(
|
@@ -161,15 +160,15 @@ function get_auxin_contact_box( $master_array ) {
|
|
161 |
'param_name' => 'longitude',
|
162 |
'type' => 'textfield',
|
163 |
'value' => '-74',
|
164 |
-
'holder' => '
|
165 |
'class' => '',
|
166 |
-
'admin_label' =>
|
167 |
'dependency' => array(
|
168 |
'element' => 'show_map',
|
169 |
'value' => '1'
|
170 |
),
|
171 |
'weight' => '',
|
172 |
-
'group' => ''
|
173 |
'edit_field_class' => ''
|
174 |
),
|
175 |
array(
|
@@ -178,15 +177,15 @@ function get_auxin_contact_box( $master_array ) {
|
|
178 |
'type' => 'dropdown',
|
179 |
'def_value' => 'ROADMAP',
|
180 |
'value' => array( 'ROADMAP' => __('ROADMAP', 'auxin-elements'), 'SATELLITE' => __('SATELLITE', 'auxin-elements') ),
|
181 |
-
'holder' => '
|
182 |
'class' => 'type',
|
183 |
'dependency' => array(
|
184 |
'element' => 'show_map',
|
185 |
'value' => '1'
|
186 |
),
|
187 |
-
'admin_label' =>
|
188 |
'weight' => '',
|
189 |
-
'group' => ''
|
190 |
'edit_field_class' => ''
|
191 |
),
|
192 |
array(
|
@@ -194,10 +193,10 @@ function get_auxin_contact_box( $master_array ) {
|
|
194 |
'description' => __('This feild allows you to customize the presentation of the standard Google base maps. You can find many preset styles in ', 'auxin-elements') .
|
195 |
'<a href="https://snazzymaps.com/" target="_blank">' . __('this website.', 'auxin-elements') . '</a>' ,
|
196 |
'param_name' => 'style',
|
197 |
-
'type' => '
|
198 |
'def_value' => '',
|
199 |
'value' => '',
|
200 |
-
'holder' => '
|
201 |
'class' => 'style',
|
202 |
'admin_label' => false,
|
203 |
'dependency' => array(
|
@@ -213,7 +212,7 @@ function get_auxin_contact_box( $master_array ) {
|
|
213 |
// 'relation'=> 'and'
|
214 |
),
|
215 |
'weight' => '',
|
216 |
-
'group' => ''
|
217 |
'edit_field_class' => ''
|
218 |
),
|
219 |
array(
|
@@ -223,15 +222,15 @@ function get_auxin_contact_box( $master_array ) {
|
|
223 |
'type' => 'textfield',
|
224 |
'value' => '',
|
225 |
'def_value' => '',
|
226 |
-
'holder' => '
|
227 |
'class' => 'marker_info',
|
228 |
-
'admin_label' =>
|
229 |
'dependency' => array(
|
230 |
'element' => 'show_map',
|
231 |
'value' => '1'
|
232 |
),
|
233 |
'weight' => '',
|
234 |
-
'group' => ''
|
235 |
'edit_field_class' => ''
|
236 |
),
|
237 |
array(
|
@@ -241,15 +240,15 @@ function get_auxin_contact_box( $master_array ) {
|
|
241 |
'type' => 'aux_switch',
|
242 |
'def_value' => '',
|
243 |
'value' => '0',
|
244 |
-
'holder' => '
|
245 |
'class' => 'show_mapcontrols',
|
246 |
-
'admin_label' =>
|
247 |
'dependency' => array(
|
248 |
'element' => 'show_map',
|
249 |
'value' => '1'
|
250 |
),
|
251 |
'weight' => '',
|
252 |
-
'group' => ''
|
253 |
'edit_field_class' => ''
|
254 |
),
|
255 |
array(
|
@@ -258,15 +257,15 @@ function get_auxin_contact_box( $master_array ) {
|
|
258 |
'param_name' => 'zoom',
|
259 |
'type' => 'textfield',
|
260 |
'value' => '10',
|
261 |
-
'holder' => '
|
262 |
'class' => '',
|
263 |
-
'admin_label' =>
|
264 |
'dependency' => array(
|
265 |
'element' => 'show_map',
|
266 |
'value' => '1'
|
267 |
),
|
268 |
'weight' => '',
|
269 |
-
'group' => ''
|
270 |
'edit_field_class' => ''
|
271 |
),
|
272 |
array(
|
@@ -276,15 +275,15 @@ function get_auxin_contact_box( $master_array ) {
|
|
276 |
'type' => 'aux_switch',
|
277 |
'def_value' => '',
|
278 |
'value' => '0',
|
279 |
-
'holder' => '
|
280 |
'class' => 'zoom_wheel',
|
281 |
-
'admin_label' =>
|
282 |
'dependency' => array(
|
283 |
'element' => 'show_map',
|
284 |
'value' => '1'
|
285 |
),
|
286 |
'weight' => '',
|
287 |
-
'group' => ''
|
288 |
'edit_field_class' => ''
|
289 |
),
|
290 |
array(
|
@@ -294,15 +293,14 @@ function get_auxin_contact_box( $master_array ) {
|
|
294 |
'type' => 'textfield',
|
295 |
'value' => '',
|
296 |
'def_value' => '',
|
297 |
-
'holder' => '
|
298 |
'class' => 'extra_classes',
|
299 |
-
'admin_label' =>
|
300 |
'dependency' => '',
|
301 |
'weight' => '',
|
302 |
'group' => '' ,
|
303 |
'edit_field_class' => ''
|
304 |
)
|
305 |
-
|
306 |
)
|
307 |
);
|
308 |
|
@@ -324,7 +322,7 @@ function auxin_widget_contact_box( $atts, $shortcode_content = null ){
|
|
324 |
$default_atts = array(
|
325 |
'title' => '', // header title
|
326 |
'style' => '',
|
327 |
-
'show_map' => '
|
328 |
'show_socials' => '1',
|
329 |
'email' => '',
|
330 |
'telephone' => '',
|
@@ -337,7 +335,9 @@ function auxin_widget_contact_box( $atts, $shortcode_content = null ){
|
|
337 |
'latitude' => 40.7,
|
338 |
'longitude' => -74,
|
339 |
'height' => 160,
|
|
|
340 |
'extra_classes' => '', // custom css class names for this element
|
|
|
341 |
'base_class' => 'aux-widget-contact-box' // base class name for container
|
342 |
);
|
343 |
|
@@ -353,22 +353,26 @@ function auxin_widget_contact_box( $atts, $shortcode_content = null ){
|
|
353 |
<!--- The output for element here -->
|
354 |
<?php
|
355 |
|
356 |
-
if( $show_map ){
|
357 |
-
|
358 |
$mapid = uniqid("axi_map");
|
359 |
$marker_title = '';
|
360 |
|
361 |
if ( empty( $style ) ) {
|
362 |
$style = auxin_get_gmap_style();
|
|
|
|
|
|
|
|
|
363 |
}
|
|
|
364 |
?>
|
365 |
|
366 |
<div id="<?php echo $mapid; ?>" class="aux_map_wrapper <?php echo $extra_classes; ?>" style="height:<?php echo $height; ?>px" ></div>
|
367 |
|
368 |
<script>
|
369 |
jQuery( function($) {
|
370 |
-
if(typeof GMaps !=
|
371 |
-
console.
|
372 |
return;
|
373 |
}
|
374 |
var map = new GMaps({
|
41 |
'param_name' => 'title',
|
42 |
'type' => 'textfield',
|
43 |
'value' => '',
|
|
|
44 |
'holder' => 'textfield',
|
45 |
'class' => 'id',
|
46 |
+
'admin_label' => false,
|
47 |
'dependency' => '',
|
48 |
'weight' => '',
|
49 |
'group' => '' ,
|
55 |
'param_name' => 'email',
|
56 |
'type' => 'textfield',
|
57 |
'value' => '',
|
58 |
+
'holder' => '',
|
59 |
'class' => 'title',
|
60 |
+
'admin_label' => false,
|
61 |
'dependency' => '',
|
62 |
'weight' => '',
|
63 |
'group' => '' ,
|
69 |
'param_name' => 'telephone',
|
70 |
'type' => 'textfield',
|
71 |
'value' => '',
|
72 |
+
'holder' => '',
|
73 |
'class' => 'telephone',
|
74 |
+
'admin_label' => false,
|
75 |
'weight' => '',
|
76 |
'group' => '',
|
77 |
'edit_field_class' => ''
|
82 |
'param_name' => 'address',
|
83 |
'type' => 'textfield',
|
84 |
'value' => '',
|
85 |
+
'holder' => '',
|
86 |
'class' => '',
|
87 |
+
'admin_label' => false,
|
88 |
'weight' => '',
|
89 |
'group' => '',
|
90 |
'edit_field_class' => ''
|
96 |
'type' => 'aux_switch',
|
97 |
'def_value' => '',
|
98 |
'value' => '1',
|
99 |
+
'holder' => '',
|
100 |
'class' => 'show_socials',
|
101 |
+
'admin_label' => false,
|
102 |
'dependency' => '',
|
103 |
'weight' => '',
|
104 |
'group' => '' ,
|
110 |
'param_name' => 'show_map',
|
111 |
'type' => 'aux_switch',
|
112 |
'def_value' => '',
|
113 |
+
'value' => '1',
|
114 |
+
'holder' => '',
|
115 |
'class' => 'show_map',
|
116 |
+
'admin_label' => false,
|
117 |
'dependency' => '',
|
118 |
'weight' => '',
|
119 |
'group' => '' ,
|
126 |
'type' => 'textfield',
|
127 |
'value' => '160',
|
128 |
'def_value' => '160',
|
129 |
+
'holder' => '',
|
130 |
'class' => 'height',
|
131 |
+
'admin_label' => false,
|
132 |
'dependency' => array(
|
133 |
'element' => 'show_map',
|
134 |
'value' => '1'
|
135 |
),
|
136 |
'weight' => '',
|
137 |
+
'group' => 'Map Options',
|
138 |
'edit_field_class' => ''
|
139 |
),
|
140 |
array(
|
143 |
'param_name' => 'latitude',
|
144 |
'type' => 'textfield',
|
145 |
'value' => '40.7',
|
146 |
+
'holder' => '',
|
147 |
'class' => '',
|
148 |
+
'admin_label' => false,
|
149 |
'dependency' => array(
|
150 |
'element' => 'show_map',
|
151 |
'value' => '1'
|
152 |
),
|
153 |
'weight' => '',
|
154 |
+
'group' => 'Map Options',
|
155 |
'edit_field_class' => ''
|
156 |
),
|
157 |
array(
|
160 |
'param_name' => 'longitude',
|
161 |
'type' => 'textfield',
|
162 |
'value' => '-74',
|
163 |
+
'holder' => '',
|
164 |
'class' => '',
|
165 |
+
'admin_label' => false,
|
166 |
'dependency' => array(
|
167 |
'element' => 'show_map',
|
168 |
'value' => '1'
|
169 |
),
|
170 |
'weight' => '',
|
171 |
+
'group' => 'Map Options',
|
172 |
'edit_field_class' => ''
|
173 |
),
|
174 |
array(
|
177 |
'type' => 'dropdown',
|
178 |
'def_value' => 'ROADMAP',
|
179 |
'value' => array( 'ROADMAP' => __('ROADMAP', 'auxin-elements'), 'SATELLITE' => __('SATELLITE', 'auxin-elements') ),
|
180 |
+
'holder' => '',
|
181 |
'class' => 'type',
|
182 |
'dependency' => array(
|
183 |
'element' => 'show_map',
|
184 |
'value' => '1'
|
185 |
),
|
186 |
+
'admin_label' => false,
|
187 |
'weight' => '',
|
188 |
+
'group' => 'Map Options',
|
189 |
'edit_field_class' => ''
|
190 |
),
|
191 |
array(
|
193 |
'description' => __('This feild allows you to customize the presentation of the standard Google base maps. You can find many preset styles in ', 'auxin-elements') .
|
194 |
'<a href="https://snazzymaps.com/" target="_blank">' . __('this website.', 'auxin-elements') . '</a>' ,
|
195 |
'param_name' => 'style',
|
196 |
+
'type' => 'textarea_raw_html',
|
197 |
'def_value' => '',
|
198 |
'value' => '',
|
199 |
+
'holder' => '',
|
200 |
'class' => 'style',
|
201 |
'admin_label' => false,
|
202 |
'dependency' => array(
|
212 |
// 'relation'=> 'and'
|
213 |
),
|
214 |
'weight' => '',
|
215 |
+
'group' => 'Map Options',
|
216 |
'edit_field_class' => ''
|
217 |
),
|
218 |
array(
|
222 |
'type' => 'textfield',
|
223 |
'value' => '',
|
224 |
'def_value' => '',
|
225 |
+
'holder' => '',
|
226 |
'class' => 'marker_info',
|
227 |
+
'admin_label' => false,
|
228 |
'dependency' => array(
|
229 |
'element' => 'show_map',
|
230 |
'value' => '1'
|
231 |
),
|
232 |
'weight' => '',
|
233 |
+
'group' => 'Map Options',
|
234 |
'edit_field_class' => ''
|
235 |
),
|
236 |
array(
|
240 |
'type' => 'aux_switch',
|
241 |
'def_value' => '',
|
242 |
'value' => '0',
|
243 |
+
'holder' => '',
|
244 |
'class' => 'show_mapcontrols',
|
245 |
+
'admin_label' => false,
|
246 |
'dependency' => array(
|
247 |
'element' => 'show_map',
|
248 |
'value' => '1'
|
249 |
),
|
250 |
'weight' => '',
|
251 |
+
'group' => 'Map Options',
|
252 |
'edit_field_class' => ''
|
253 |
),
|
254 |
array(
|
257 |
'param_name' => 'zoom',
|
258 |
'type' => 'textfield',
|
259 |
'value' => '10',
|
260 |
+
'holder' => '',
|
261 |
'class' => '',
|
262 |
+
'admin_label' => false,
|
263 |
'dependency' => array(
|
264 |
'element' => 'show_map',
|
265 |
'value' => '1'
|
266 |
),
|
267 |
'weight' => '',
|
268 |
+
'group' => 'Map Options',
|
269 |
'edit_field_class' => ''
|
270 |
),
|
271 |
array(
|
275 |
'type' => 'aux_switch',
|
276 |
'def_value' => '',
|
277 |
'value' => '0',
|
278 |
+
'holder' => '',
|
279 |
'class' => 'zoom_wheel',
|
280 |
+
'admin_label' => false,
|
281 |
'dependency' => array(
|
282 |
'element' => 'show_map',
|
283 |
'value' => '1'
|
284 |
),
|
285 |
'weight' => '',
|
286 |
+
'group' => 'Map Options',
|
287 |
'edit_field_class' => ''
|
288 |
),
|
289 |
array(
|
293 |
'type' => 'textfield',
|
294 |
'value' => '',
|
295 |
'def_value' => '',
|
296 |
+
'holder' => '',
|
297 |
'class' => 'extra_classes',
|
298 |
+
'admin_label' => false,
|
299 |
'dependency' => '',
|
300 |
'weight' => '',
|
301 |
'group' => '' ,
|
302 |
'edit_field_class' => ''
|
303 |
)
|
|
|
304 |
)
|
305 |
);
|
306 |
|
322 |
$default_atts = array(
|
323 |
'title' => '', // header title
|
324 |
'style' => '',
|
325 |
+
'show_map' => '1',
|
326 |
'show_socials' => '1',
|
327 |
'email' => '',
|
328 |
'telephone' => '',
|
335 |
'latitude' => 40.7,
|
336 |
'longitude' => -74,
|
337 |
'height' => 160,
|
338 |
+
|
339 |
'extra_classes' => '', // custom css class names for this element
|
340 |
+
'custom_el_id' => '',
|
341 |
'base_class' => 'aux-widget-contact-box' // base class name for container
|
342 |
);
|
343 |
|
353 |
<!--- The output for element here -->
|
354 |
<?php
|
355 |
|
356 |
+
if( auxin_is_true( $show_map ) ) {
|
|
|
357 |
$mapid = uniqid("axi_map");
|
358 |
$marker_title = '';
|
359 |
|
360 |
if ( empty( $style ) ) {
|
361 |
$style = auxin_get_gmap_style();
|
362 |
+
} elseif ( base64_decode( $style, true ) === false) {
|
363 |
+
|
364 |
+
} else {
|
365 |
+
$style = rawurldecode( base64_decode( strip_tags( $style ) ) );
|
366 |
}
|
367 |
+
|
368 |
?>
|
369 |
|
370 |
<div id="<?php echo $mapid; ?>" class="aux_map_wrapper <?php echo $extra_classes; ?>" style="height:<?php echo $height; ?>px" ></div>
|
371 |
|
372 |
<script>
|
373 |
jQuery( function($) {
|
374 |
+
if(typeof GMaps != "function" || typeof google === "undefined"){
|
375 |
+
console.info( "Please add google map API key in theme options. https://developers.google.com/maps/documentation/javascript/" );
|
376 |
return;
|
377 |
}
|
378 |
var map = new GMaps({
|
includes/elements/contact-form.php
CHANGED
@@ -45,10 +45,9 @@ function auxin_get_contact_form_master_array( $master_array ) {
|
|
45 |
'param_name' => 'title',
|
46 |
'type' => 'textfield',
|
47 |
'value' => '',
|
48 |
-
'def_value' => '',
|
49 |
'holder' => 'textfield',
|
50 |
'class' => 'title',
|
51 |
-
'admin_label' =>
|
52 |
'dependency' => '',
|
53 |
'weight' => '',
|
54 |
'group' => '' ,
|
@@ -60,10 +59,9 @@ function auxin_get_contact_form_master_array( $master_array ) {
|
|
60 |
'param_name' => 'email',
|
61 |
'type' => 'textfield',
|
62 |
'value' => '',
|
63 |
-
'
|
64 |
-
'holder' => 'textfield',
|
65 |
'class' => 'email',
|
66 |
-
'admin_label' =>
|
67 |
'dependency' => '',
|
68 |
'weight' => '',
|
69 |
'group' => '' ,
|
@@ -78,9 +76,8 @@ function auxin_get_contact_form_master_array( $master_array ) {
|
|
78 |
'phlox' => __('Phlox Contact Form', 'auxin-elements' ),
|
79 |
'cf7' => __('Contact Form 7 plugin', 'auxin-elements' ),
|
80 |
),
|
81 |
-
'
|
82 |
-
'
|
83 |
-
'holder' => 'textfield',
|
84 |
'class' => 'width',
|
85 |
'admin_label' => true,
|
86 |
'weight' => '',
|
@@ -93,10 +90,9 @@ function auxin_get_contact_form_master_array( $master_array ) {
|
|
93 |
'param_name' => 'cf7_shortcode',
|
94 |
'type' => 'textfield',
|
95 |
'value' => '',
|
96 |
-
'
|
97 |
-
'holder' => 'textfield',
|
98 |
'class' => 'cf7_shortcode',
|
99 |
-
'admin_label' =>
|
100 |
'dependency' => array(
|
101 |
'element' => 'type',
|
102 |
'value' => 'cf7'
|
@@ -111,16 +107,15 @@ function auxin_get_contact_form_master_array( $master_array ) {
|
|
111 |
'param_name' => 'extra_classes',
|
112 |
'type' => 'textfield',
|
113 |
'value' => '',
|
114 |
-
'
|
115 |
-
'holder' => 'textfield',
|
116 |
'class' => 'extra_classes',
|
117 |
-
'admin_label' =>
|
118 |
-
'admin_label' => true,
|
119 |
'weight' => '',
|
120 |
'group' => '' ,
|
121 |
'edit_field_class' => ''
|
122 |
)
|
123 |
-
)
|
|
|
124 |
);
|
125 |
|
126 |
return $master_array;
|
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' => '' ,
|
59 |
'param_name' => 'email',
|
60 |
'type' => 'textfield',
|
61 |
'value' => '',
|
62 |
+
'holder' => '',
|
|
|
63 |
'class' => 'email',
|
64 |
+
'admin_label' => false,
|
65 |
'dependency' => '',
|
66 |
'weight' => '',
|
67 |
'group' => '' ,
|
76 |
'phlox' => __('Phlox Contact Form', 'auxin-elements' ),
|
77 |
'cf7' => __('Contact Form 7 plugin', 'auxin-elements' ),
|
78 |
),
|
79 |
+
'def_value' => 'phlox',
|
80 |
+
'holder' => '',
|
|
|
81 |
'class' => 'width',
|
82 |
'admin_label' => true,
|
83 |
'weight' => '',
|
90 |
'param_name' => 'cf7_shortcode',
|
91 |
'type' => 'textfield',
|
92 |
'value' => '',
|
93 |
+
'holder' => '',
|
|
|
94 |
'class' => 'cf7_shortcode',
|
95 |
+
'admin_label' => false,
|
96 |
'dependency' => array(
|
97 |
'element' => 'type',
|
98 |
'value' => 'cf7'
|
107 |
'param_name' => 'extra_classes',
|
108 |
'type' => 'textfield',
|
109 |
'value' => '',
|
110 |
+
'holder' => '',
|
|
|
111 |
'class' => 'extra_classes',
|
112 |
+
'admin_label' => false,
|
|
|
113 |
'weight' => '',
|
114 |
'group' => '' ,
|
115 |
'edit_field_class' => ''
|
116 |
)
|
117 |
+
),
|
118 |
+
|
119 |
);
|
120 |
|
121 |
return $master_array;
|
includes/elements/divider.php
CHANGED
@@ -44,8 +44,8 @@ function auxin_get_divider_master_array( $master_array ) {
|
|
44 |
'description' => '',
|
45 |
'param_name' => 'style',
|
46 |
'type' => 'aux_visual_select',
|
47 |
-
'
|
48 |
-
'holder' => '
|
49 |
'class' => 'style',
|
50 |
'admin_label' => true,
|
51 |
'dependency' => '',
|
@@ -85,9 +85,8 @@ function auxin_get_divider_master_array( $master_array ) {
|
|
85 |
'medium' => __('Medium', 'auxin-elements'),
|
86 |
'small' => __('Small', 'auxin-elements')
|
87 |
),
|
88 |
-
'std' => 'medium',
|
89 |
'def_value' => 'medium',
|
90 |
-
'holder' => '
|
91 |
'class' => 'width',
|
92 |
'admin_label' => true,
|
93 |
'dependency' => array(
|
@@ -104,8 +103,7 @@ function auxin_get_divider_master_array( $master_array ) {
|
|
104 |
'param_name' => 'margin_top',
|
105 |
'type' => 'textfield',
|
106 |
'value' => '',
|
107 |
-
'
|
108 |
-
'holder' => 'textfield',
|
109 |
'class' => 'margin_top',
|
110 |
'admin_label' => false,
|
111 |
'dependency' => '',
|
@@ -119,10 +117,9 @@ function auxin_get_divider_master_array( $master_array ) {
|
|
119 |
'param_name' => 'margin_bottom',
|
120 |
'type' => 'textfield',
|
121 |
'value' => '',
|
122 |
-
'
|
123 |
-
'holder' => 'textfield',
|
124 |
'class' => 'margin_bottom',
|
125 |
-
'admin_label' =>
|
126 |
'dependency' => '',
|
127 |
'weight' => '',
|
128 |
'group' => '' ,
|
@@ -135,9 +132,9 @@ function auxin_get_divider_master_array( $master_array ) {
|
|
135 |
'type' => 'textfield',
|
136 |
'value' => '',
|
137 |
'def_value' => '',
|
138 |
-
'holder' => '
|
139 |
'class' => 'extra_classes',
|
140 |
-
'admin_label' =>
|
141 |
'dependency' => '',
|
142 |
'weight' => '',
|
143 |
'group' => '' ,
|
@@ -160,8 +157,7 @@ function auxin_widget_divider_callback( $atts, $shortcode_content = null ){
|
|
160 |
'title' => '',
|
161 |
'size' => '',
|
162 |
'style' => 'solid',
|
163 |
-
'width' => '
|
164 |
-
'extra_classes' => '',
|
165 |
'base_class' => '',
|
166 |
'margin_bottom' => '',
|
167 |
'margin_top' => '',
|
@@ -208,6 +204,7 @@ function auxin_widget_divider_callback( $atts, $shortcode_content = null ){
|
|
208 |
break;
|
209 |
}
|
210 |
|
|
|
211 |
if( ! empty( $extra_classes ) ) {
|
212 |
$class_names .= " $extra_classes";
|
213 |
}
|
44 |
'description' => '',
|
45 |
'param_name' => 'style',
|
46 |
'type' => 'aux_visual_select',
|
47 |
+
'def_value' => "solid",
|
48 |
+
'holder' => '',
|
49 |
'class' => 'style',
|
50 |
'admin_label' => true,
|
51 |
'dependency' => '',
|
85 |
'medium' => __('Medium', 'auxin-elements'),
|
86 |
'small' => __('Small', 'auxin-elements')
|
87 |
),
|
|
|
88 |
'def_value' => 'medium',
|
89 |
+
'holder' => '',
|
90 |
'class' => 'width',
|
91 |
'admin_label' => true,
|
92 |
'dependency' => array(
|
103 |
'param_name' => 'margin_top',
|
104 |
'type' => 'textfield',
|
105 |
'value' => '',
|
106 |
+
'holder' => '',
|
|
|
107 |
'class' => 'margin_top',
|
108 |
'admin_label' => false,
|
109 |
'dependency' => '',
|
117 |
'param_name' => 'margin_bottom',
|
118 |
'type' => 'textfield',
|
119 |
'value' => '',
|
120 |
+
'holder' => '',
|
|
|
121 |
'class' => 'margin_bottom',
|
122 |
+
'admin_label' => false,
|
123 |
'dependency' => '',
|
124 |
'weight' => '',
|
125 |
'group' => '' ,
|
132 |
'type' => 'textfield',
|
133 |
'value' => '',
|
134 |
'def_value' => '',
|
135 |
+
'holder' => '',
|
136 |
'class' => 'extra_classes',
|
137 |
+
'admin_label' => false,
|
138 |
'dependency' => '',
|
139 |
'weight' => '',
|
140 |
'group' => '' ,
|
157 |
'title' => '',
|
158 |
'size' => '',
|
159 |
'style' => 'solid',
|
160 |
+
'width' => 'medium',
|
|
|
161 |
'base_class' => '',
|
162 |
'margin_bottom' => '',
|
163 |
'margin_top' => '',
|
204 |
break;
|
205 |
}
|
206 |
|
207 |
+
|
208 |
if( ! empty( $extra_classes ) ) {
|
209 |
$class_names .= " $extra_classes";
|
210 |
}
|
includes/elements/dropcap.php
CHANGED
@@ -43,8 +43,8 @@ function auxin_get_dropcap_master_array( $master_array ) {
|
|
43 |
'description' => '',
|
44 |
'param_name' => 'style',
|
45 |
'type' => 'aux_visual_select',
|
46 |
-
'
|
47 |
-
'holder' => '
|
48 |
'class' => 'style',
|
49 |
'admin_label' => true,
|
50 |
'dependency' => '',
|
@@ -52,29 +52,29 @@ function auxin_get_dropcap_master_array( $master_array ) {
|
|
52 |
'group' => '' ,
|
53 |
'edit_field_class' => '',
|
54 |
'choices' => array(
|
55 |
-
'classic'
|
56 |
-
'label'
|
57 |
-
'image'
|
58 |
),
|
59 |
-
'square'
|
60 |
-
'label'
|
61 |
-
'image'
|
62 |
),
|
63 |
-
'square-outline'
|
64 |
-
'label'
|
65 |
-
'image'
|
66 |
),
|
67 |
-
'square-round'
|
68 |
-
'label'
|
69 |
-
'image'
|
70 |
),
|
71 |
-
'circle'
|
72 |
-
'label'
|
73 |
-
'image'
|
74 |
),
|
75 |
-
'circle-outline'
|
76 |
-
'label'
|
77 |
-
'image'
|
78 |
)
|
79 |
)
|
80 |
),
|
@@ -84,10 +84,9 @@ function auxin_get_dropcap_master_array( $master_array ) {
|
|
84 |
'param_name' => 'content',
|
85 |
'type' => 'textarea_html',
|
86 |
'value' => '',
|
87 |
-
'
|
88 |
-
'holder' => 'div',
|
89 |
'class' => 'content',
|
90 |
-
'admin_label' =>
|
91 |
'dependency' => '',
|
92 |
'weight' => '',
|
93 |
'group' => '' ,
|
@@ -98,17 +97,15 @@ function auxin_get_dropcap_master_array( $master_array ) {
|
|
98 |
'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' ),
|
99 |
'param_name' => 'extra_classes',
|
100 |
'type' => 'textfield',
|
101 |
-
'def_value' => '',
|
102 |
'value' => '',
|
103 |
-
'holder' => '
|
104 |
'class' => 'extra_classes',
|
105 |
-
'admin_label' =>
|
106 |
'dependency' => '',
|
107 |
'weight' => '',
|
108 |
'group' => '' ,
|
109 |
'edit_field_class' => ''
|
110 |
)
|
111 |
-
|
112 |
)
|
113 |
);
|
114 |
|
@@ -187,12 +184,11 @@ function auxin_widget_dropcap_callback( $atts, $shortcode_content = null ) {
|
|
187 |
$content = auxin_str_replace_first( "</".$tag. ">" ,"" , $content );
|
188 |
}
|
189 |
|
190 |
-
$first_letter =
|
191 |
-
$rest_of_text =
|
192 |
|
193 |
-
echo '<p class="'
|
194 |
-
'<span class="'
|
195 |
-
$first_letter . '</span>' . $rest_of_text .
|
196 |
'</p>';
|
197 |
|
198 |
// widget footer ------------------------------
|
43 |
'description' => '',
|
44 |
'param_name' => 'style',
|
45 |
'type' => 'aux_visual_select',
|
46 |
+
'def_value' => 'classic',
|
47 |
+
'holder' => '',
|
48 |
'class' => 'style',
|
49 |
'admin_label' => true,
|
50 |
'dependency' => '',
|
52 |
'group' => '' ,
|
53 |
'edit_field_class' => '',
|
54 |
'choices' => array(
|
55 |
+
'classic' => array(
|
56 |
+
'label' => __('Classic', 'auxin-elements' ),
|
57 |
+
'image' => AUX_URL . 'images/visual-select/dropcap-classic.svg'
|
58 |
),
|
59 |
+
'square' => array(
|
60 |
+
'label' => __('Square', 'auxin-elements' ),
|
61 |
+
'image' => AUX_URL . 'images/visual-select/dropcap-square.svg'
|
62 |
),
|
63 |
+
'square-outline' => array(
|
64 |
+
'label' => __('Outline Square', 'auxin-elements' ),
|
65 |
+
'image' => AUX_URL . 'images/visual-select/dropcap-square-outline.svg'
|
66 |
),
|
67 |
+
'square-round' => array(
|
68 |
+
'label' => __('Round Square', 'auxin-elements' ),
|
69 |
+
'image' => AUX_URL . 'images/visual-select/dropcap-square-round.svg'
|
70 |
),
|
71 |
+
'circle' => array(
|
72 |
+
'label' => __('Circle', 'auxin-elements' ),
|
73 |
+
'image' => AUX_URL . 'images/visual-select/dropcap-circle.svg'
|
74 |
),
|
75 |
+
'circle-outline' => array(
|
76 |
+
'label' => __('Outline Circle', 'auxin-elements' ),
|
77 |
+
'image' => AUX_URL . 'images/visual-select/dropcap-circle-outline.svg'
|
78 |
)
|
79 |
)
|
80 |
),
|
84 |
'param_name' => 'content',
|
85 |
'type' => 'textarea_html',
|
86 |
'value' => '',
|
87 |
+
'holder' => '',
|
|
|
88 |
'class' => 'content',
|
89 |
+
'admin_label' => false,
|
90 |
'dependency' => '',
|
91 |
'weight' => '',
|
92 |
'group' => '' ,
|
97 |
'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' ),
|
98 |
'param_name' => 'extra_classes',
|
99 |
'type' => 'textfield',
|
|
|
100 |
'value' => '',
|
101 |
+
'holder' => '',
|
102 |
'class' => 'extra_classes',
|
103 |
+
'admin_label' => false,
|
104 |
'dependency' => '',
|
105 |
'weight' => '',
|
106 |
'group' => '' ,
|
107 |
'edit_field_class' => ''
|
108 |
)
|
|
|
109 |
)
|
110 |
);
|
111 |
|
184 |
$content = auxin_str_replace_first( "</".$tag. ">" ,"" , $content );
|
185 |
}
|
186 |
|
187 |
+
$first_letter = mb_substr( $content, 0, 1,'utf-8' ); // get the first letter
|
188 |
+
$rest_of_text = mb_substr( $content, 1, null, 'utf-8' ); // get the rest of text
|
189 |
|
190 |
+
echo '<p class="'. $extra_classes .'">' .
|
191 |
+
'<span class="'. $class_names .'">'. $first_letter .'</span>'. $rest_of_text .
|
|
|
192 |
'</p>';
|
193 |
|
194 |
// widget footer ------------------------------
|
includes/elements/flickr.php
CHANGED
@@ -41,7 +41,7 @@ function auxin_get_flickr_master_array( $master_array ) {
|
|
41 |
'params' => array(
|
42 |
array(
|
43 |
'heading' => __('User ID', 'auxin-elements'),
|
44 |
-
'description' => sprintf(__('Displays the photostream of the specified user, no matter what is the default user ID in the settings. Remember that you can use %sidgettr%s to retrieve the user_id.', 'auxin-elements'), '<a href="http://idgettr.com/">','</a>'),
|
45 |
'param_name' => 'user_id',
|
46 |
'type' => 'textfield',
|
47 |
'value' => '',
|
41 |
'params' => array(
|
42 |
array(
|
43 |
'heading' => __('User ID', 'auxin-elements'),
|
44 |
+
'description' => sprintf(__('Displays the photostream of the specified user, no matter what is the default user ID in the settings. Remember that you can use %sidgettr%s to retrieve the user_id.', 'auxin-elements'), '<a target="_blank" href="http://idgettr.com/">','</a>'),
|
45 |
'param_name' => 'user_id',
|
46 |
'type' => 'textfield',
|
47 |
'value' => '',
|
includes/elements/gallery.php
CHANGED
@@ -39,19 +39,18 @@ function auxin_get_gallery_master_array( $master_array ) {
|
|
39 |
'as_child' => '',
|
40 |
'params' => array(
|
41 |
array(
|
42 |
-
'heading'
|
43 |
-
'description'
|
44 |
-
'param_name'
|
45 |
-
'type'
|
46 |
-
'value'
|
47 |
-
'
|
48 |
-
'
|
49 |
-
'
|
50 |
-
'
|
51 |
-
'
|
52 |
-
'
|
53 |
-
'
|
54 |
-
'edit_field_class' => ''
|
55 |
),
|
56 |
array(
|
57 |
'heading' => __('Images','auxin-elements'),
|
@@ -60,9 +59,9 @@ function auxin_get_gallery_master_array( $master_array ) {
|
|
60 |
'type' => 'attach_images',
|
61 |
'value' => '',
|
62 |
'def_value' => '',
|
63 |
-
'holder' => '
|
64 |
'class' => 'include',
|
65 |
-
'admin_label' =>
|
66 |
'dependency' => '',
|
67 |
'weight' => '',
|
68 |
'group' => '' ,
|
@@ -72,18 +71,18 @@ function auxin_get_gallery_master_array( $master_array ) {
|
|
72 |
'heading' => __('Gallery layout','auxin-elements'),
|
73 |
'description' => '',
|
74 |
'param_name' => 'layout',
|
75 |
-
'type'
|
76 |
'def_value' => 'grid',
|
77 |
'choices' => array(
|
78 |
-
'grid'
|
79 |
'label' => __('Grid', 'auxin-elements'),
|
80 |
'image' => AUX_URL . 'images/visual-select/gallery-grid.svg'
|
81 |
),
|
82 |
-
'masonry'
|
83 |
'label' => __('Masonry', 'auxin-elements'),
|
84 |
'image' => AUX_URL . 'images/visual-select/gallery-masonry.svg'
|
85 |
),
|
86 |
-
'tiles'
|
87 |
'label' => __('Tiles', 'auxin-elements'),
|
88 |
'image' => AUX_URL . 'images/visual-select/gallery-tile.svg'
|
89 |
),
|
@@ -92,7 +91,7 @@ function auxin_get_gallery_master_array( $master_array ) {
|
|
92 |
// 'image' => AUX_URL . 'images/visual-select/divider-diamond.svg'
|
93 |
// )
|
94 |
),
|
95 |
-
'holder' => '
|
96 |
'class' => 'layout',
|
97 |
'admin_label' => true,
|
98 |
'dependency' => '',
|
@@ -107,7 +106,7 @@ function auxin_get_gallery_master_array( $master_array ) {
|
|
107 |
'type' => 'aux_switch',
|
108 |
'value' => '0',
|
109 |
'class' => '',
|
110 |
-
'admin_label' =>
|
111 |
'dependency' => '',
|
112 |
'weight' => '',
|
113 |
'group' => '' ,
|
@@ -123,9 +122,9 @@ function auxin_get_gallery_master_array( $master_array ) {
|
|
123 |
'ASC' => __('ASC' , 'auxin-elements'),
|
124 |
'DESC' => __('DESC', 'auxin-elements')
|
125 |
),
|
126 |
-
'holder' => '
|
127 |
'class' => 'order',
|
128 |
-
'admin_label' =>
|
129 |
'dependency' => array(
|
130 |
'element' => 'wp_order',
|
131 |
'value' => '1'
|
@@ -140,19 +139,19 @@ function auxin_get_gallery_master_array( $master_array ) {
|
|
140 |
'param_name' => 'orderby',
|
141 |
'type' => 'dropdown',
|
142 |
'def_value' => 'menu_order ID',
|
143 |
-
'value'
|
144 |
'menu_order ID' => __('Menu Order' , 'auxin-elements'),
|
145 |
'date' => __('Date' , 'auxin-elements'),
|
146 |
'ID' => __('ID' , 'auxin-elements'),
|
147 |
'none' => __('None' , 'auxin-elements')
|
148 |
),
|
149 |
-
'dependency'
|
150 |
'element' => 'wp_order',
|
151 |
'value' => '1'
|
152 |
),
|
153 |
-
'holder' => '
|
154 |
'class' => 'orderby',
|
155 |
-
'admin_label' =>
|
156 |
'weight' => '',
|
157 |
'group' => '' ,
|
158 |
'edit_field_class' => ''
|
@@ -163,7 +162,7 @@ function auxin_get_gallery_master_array( $master_array ) {
|
|
163 |
'param_name' => 'columns',
|
164 |
'type' => 'dropdown',
|
165 |
'def_value' => '4',
|
166 |
-
'holder' => '
|
167 |
'class' => 'columns',
|
168 |
'value' => array(
|
169 |
'1' => '1', '2' => '2', '3' => '3',
|
@@ -184,7 +183,7 @@ function auxin_get_gallery_master_array( $master_array ) {
|
|
184 |
'param_name' => 'tablet_cnum',
|
185 |
'type' => 'dropdown',
|
186 |
'def_value' => 'inherit',
|
187 |
-
'holder' => '
|
188 |
'class' => 'tablet_cnum',
|
189 |
'value' => array(
|
190 |
'inherit' => 'Inherited from larger',
|
@@ -206,7 +205,7 @@ function auxin_get_gallery_master_array( $master_array ) {
|
|
206 |
'param_name' => 'phone_cnum',
|
207 |
'type' => 'dropdown',
|
208 |
'def_value' => '1',
|
209 |
-
'holder' => '
|
210 |
'class' => 'phone_cnum',
|
211 |
'value' => array(
|
212 |
'1' => '1' , '2' => '2', '3' => '3'
|
@@ -227,7 +226,7 @@ function auxin_get_gallery_master_array( $master_array ) {
|
|
227 |
'type' => 'textfield',
|
228 |
'value' => '10',
|
229 |
'def_value' => '',
|
230 |
-
'holder' => '
|
231 |
'class' => 'space',
|
232 |
'admin_label' => false,
|
233 |
'dependency' => array(
|
@@ -244,7 +243,7 @@ function auxin_get_gallery_master_array( $master_array ) {
|
|
244 |
'param_name' => 'image_aspect_ratio',
|
245 |
'type' => 'dropdown',
|
246 |
'def_value' => '0.75',
|
247 |
-
'holder' => '
|
248 |
'class' => 'order',
|
249 |
'value' =>array (
|
250 |
'0.75' => __('Horizontal 4:3' , 'auxin-elements'),
|
@@ -253,7 +252,7 @@ function auxin_get_gallery_master_array( $master_array ) {
|
|
253 |
'1.33' => __('Vertical 3:4' , 'auxin-elements')
|
254 |
),
|
255 |
'admin_label' => false,
|
256 |
-
'dependency'
|
257 |
'element' => 'layout',
|
258 |
'value' => array( 'grid' )
|
259 |
),
|
@@ -273,9 +272,9 @@ function auxin_get_gallery_master_array( $master_array ) {
|
|
273 |
'' => __('Attachment Page' , 'auxin-elements'),
|
274 |
'file' => __('File' , 'auxin-elements')
|
275 |
),
|
276 |
-
'holder' => '
|
277 |
'class' => 'link',
|
278 |
-
'admin_label' =>
|
279 |
'dependency' => '',
|
280 |
'weight' => '',
|
281 |
'group' => '' ,
|
@@ -288,7 +287,7 @@ function auxin_get_gallery_master_array( $master_array ) {
|
|
288 |
'type' => 'aux_switch',
|
289 |
'value' => '0',
|
290 |
'class' => '',
|
291 |
-
'admin_label' =>
|
292 |
'dependency' => '',
|
293 |
'weight' => '',
|
294 |
'group' => '' ,
|
@@ -301,7 +300,7 @@ function auxin_get_gallery_master_array( $master_array ) {
|
|
301 |
'type' => 'aux_switch',
|
302 |
'value' => '0',
|
303 |
'class' => '',
|
304 |
-
'admin_label' =>
|
305 |
'dependency' => array(
|
306 |
'element' => 'pagination',
|
307 |
'value' => '1'
|
@@ -317,7 +316,7 @@ function auxin_get_gallery_master_array( $master_array ) {
|
|
317 |
'type' => 'textfield',
|
318 |
'value' => '24',
|
319 |
'def_value' => '',
|
320 |
-
'holder' => '
|
321 |
'class' => 'id',
|
322 |
'admin_label' => false,
|
323 |
'dependency' => array(
|
@@ -335,7 +334,7 @@ function auxin_get_gallery_master_array( $master_array ) {
|
|
335 |
'type' => 'textfield',
|
336 |
'value' => '',
|
337 |
'def_value' => '',
|
338 |
-
'holder' => '
|
339 |
'class' => 'extra_classes',
|
340 |
'admin_label' => false,
|
341 |
'dependency' => '',
|
@@ -500,7 +499,7 @@ function auxin_widget_gallery_callback( $attr, $shortcode_content = null ){
|
|
500 |
|
501 |
if ( $add_lightbox ) {
|
502 |
$lightbox_attrs = 'data-original-width="' . $attachment_meta['width'] . '" data-original-height="' . $attachment_meta['height'] . '" ' .
|
503 |
-
'data-caption="' . auxin_attachment_caption( $id ) . '"';
|
504 |
}
|
505 |
|
506 |
if ( 'tiles' == $layout ) {
|
@@ -546,7 +545,8 @@ function auxin_widget_gallery_callback( $attr, $shortcode_content = null ){
|
|
546 |
);
|
547 |
}
|
548 |
|
549 |
-
|
|
|
550 |
$item_classes = 'aux-iso-hidden';
|
551 |
} else {
|
552 |
$item_classes = '';
|
39 |
'as_child' => '',
|
40 |
'params' => array(
|
41 |
array(
|
42 |
+
'heading' => __('Title','auxin-elements'),
|
43 |
+
'description' => '',
|
44 |
+
'param_name' => 'title',
|
45 |
+
'type' => 'textfield',
|
46 |
+
'value' => '',
|
47 |
+
'holder' => 'textfield',
|
48 |
+
'class' => 'title',
|
49 |
+
'admin_label' => false,
|
50 |
+
'dependency' => '',
|
51 |
+
'weight' => '',
|
52 |
+
'group' => '' ,
|
53 |
+
'edit_field_class' => ''
|
|
|
54 |
),
|
55 |
array(
|
56 |
'heading' => __('Images','auxin-elements'),
|
59 |
'type' => 'attach_images',
|
60 |
'value' => '',
|
61 |
'def_value' => '',
|
62 |
+
'holder' => '',
|
63 |
'class' => 'include',
|
64 |
+
'admin_label' => false,
|
65 |
'dependency' => '',
|
66 |
'weight' => '',
|
67 |
'group' => '' ,
|
71 |
'heading' => __('Gallery layout','auxin-elements'),
|
72 |
'description' => '',
|
73 |
'param_name' => 'layout',
|
74 |
+
'type' => 'aux_visual_select',
|
75 |
'def_value' => 'grid',
|
76 |
'choices' => array(
|
77 |
+
'grid' => array(
|
78 |
'label' => __('Grid', 'auxin-elements'),
|
79 |
'image' => AUX_URL . 'images/visual-select/gallery-grid.svg'
|
80 |
),
|
81 |
+
'masonry' => array(
|
82 |
'label' => __('Masonry', 'auxin-elements'),
|
83 |
'image' => AUX_URL . 'images/visual-select/gallery-masonry.svg'
|
84 |
),
|
85 |
+
'tiles' => array(
|
86 |
'label' => __('Tiles', 'auxin-elements'),
|
87 |
'image' => AUX_URL . 'images/visual-select/gallery-tile.svg'
|
88 |
),
|
91 |
// 'image' => AUX_URL . 'images/visual-select/divider-diamond.svg'
|
92 |
// )
|
93 |
),
|
94 |
+
'holder' => '',
|
95 |
'class' => 'layout',
|
96 |
'admin_label' => true,
|
97 |
'dependency' => '',
|
106 |
'type' => 'aux_switch',
|
107 |
'value' => '0',
|
108 |
'class' => '',
|
109 |
+
'admin_label' => false,
|
110 |
'dependency' => '',
|
111 |
'weight' => '',
|
112 |
'group' => '' ,
|
122 |
'ASC' => __('ASC' , 'auxin-elements'),
|
123 |
'DESC' => __('DESC', 'auxin-elements')
|
124 |
),
|
125 |
+
'holder' => '',
|
126 |
'class' => 'order',
|
127 |
+
'admin_label' => false,
|
128 |
'dependency' => array(
|
129 |
'element' => 'wp_order',
|
130 |
'value' => '1'
|
139 |
'param_name' => 'orderby',
|
140 |
'type' => 'dropdown',
|
141 |
'def_value' => 'menu_order ID',
|
142 |
+
'value' => array(
|
143 |
'menu_order ID' => __('Menu Order' , 'auxin-elements'),
|
144 |
'date' => __('Date' , 'auxin-elements'),
|
145 |
'ID' => __('ID' , 'auxin-elements'),
|
146 |
'none' => __('None' , 'auxin-elements')
|
147 |
),
|
148 |
+
'dependency' => array(
|
149 |
'element' => 'wp_order',
|
150 |
'value' => '1'
|
151 |
),
|
152 |
+
'holder' => '',
|
153 |
'class' => 'orderby',
|
154 |
+
'admin_label' => false,
|
155 |
'weight' => '',
|
156 |
'group' => '' ,
|
157 |
'edit_field_class' => ''
|
162 |
'param_name' => 'columns',
|
163 |
'type' => 'dropdown',
|
164 |
'def_value' => '4',
|
165 |
+
'holder' => '',
|
166 |
'class' => 'columns',
|
167 |
'value' => array(
|
168 |
'1' => '1', '2' => '2', '3' => '3',
|
183 |
'param_name' => 'tablet_cnum',
|
184 |
'type' => 'dropdown',
|
185 |
'def_value' => 'inherit',
|
186 |
+
'holder' => '',
|
187 |
'class' => 'tablet_cnum',
|
188 |
'value' => array(
|
189 |
'inherit' => 'Inherited from larger',
|
205 |
'param_name' => 'phone_cnum',
|
206 |
'type' => 'dropdown',
|
207 |
'def_value' => '1',
|
208 |
+
'holder' => '',
|
209 |
'class' => 'phone_cnum',
|
210 |
'value' => array(
|
211 |
'1' => '1' , '2' => '2', '3' => '3'
|
226 |
'type' => 'textfield',
|
227 |
'value' => '10',
|
228 |
'def_value' => '',
|
229 |
+
'holder' => '',
|
230 |
'class' => 'space',
|
231 |
'admin_label' => false,
|
232 |
'dependency' => array(
|
243 |
'param_name' => 'image_aspect_ratio',
|
244 |
'type' => 'dropdown',
|
245 |
'def_value' => '0.75',
|
246 |
+
'holder' => '',
|
247 |
'class' => 'order',
|
248 |
'value' =>array (
|
249 |
'0.75' => __('Horizontal 4:3' , 'auxin-elements'),
|
252 |
'1.33' => __('Vertical 3:4' , 'auxin-elements')
|
253 |
),
|
254 |
'admin_label' => false,
|
255 |
+
'dependency' => array(
|
256 |
'element' => 'layout',
|
257 |
'value' => array( 'grid' )
|
258 |
),
|
272 |
'' => __('Attachment Page' , 'auxin-elements'),
|
273 |
'file' => __('File' , 'auxin-elements')
|
274 |
),
|
275 |
+
'holder' => '',
|
276 |
'class' => 'link',
|
277 |
+
'admin_label' => false,
|
278 |
'dependency' => '',
|
279 |
'weight' => '',
|
280 |
'group' => '' ,
|
287 |
'type' => 'aux_switch',
|
288 |
'value' => '0',
|
289 |
'class' => '',
|
290 |
+
'admin_label' => false,
|
291 |
'dependency' => '',
|
292 |
'weight' => '',
|
293 |
'group' => '' ,
|
300 |
'type' => 'aux_switch',
|
301 |
'value' => '0',
|
302 |
'class' => '',
|
303 |
+
'admin_label' => false,
|
304 |
'dependency' => array(
|
305 |
'element' => 'pagination',
|
306 |
'value' => '1'
|
316 |
'type' => 'textfield',
|
317 |
'value' => '24',
|
318 |
'def_value' => '',
|
319 |
+
'holder' => '',
|
320 |
'class' => 'id',
|
321 |
'admin_label' => false,
|
322 |
'dependency' => array(
|
334 |
'type' => 'textfield',
|
335 |
'value' => '',
|
336 |
'def_value' => '',
|
337 |
+
'holder' => '',
|
338 |
'class' => 'extra_classes',
|
339 |
'admin_label' => false,
|
340 |
'dependency' => '',
|
499 |
|
500 |
if ( $add_lightbox ) {
|
501 |
$lightbox_attrs = 'data-original-width="' . $attachment_meta['width'] . '" data-original-height="' . $attachment_meta['height'] . '" ' .
|
502 |
+
'data-caption="' . esc_attr( auxin_attachment_caption( $id ) ) . '"';
|
503 |
}
|
504 |
|
505 |
if ( 'tiles' == $layout ) {
|
545 |
);
|
546 |
}
|
547 |
|
548 |
+
$index ++;
|
549 |
+
if ( $pagination && $index > $perpage ) {
|
550 |
$item_classes = 'aux-iso-hidden';
|
551 |
} else {
|
552 |
$item_classes = '';
|
includes/elements/gmap.php
CHANGED
@@ -42,7 +42,7 @@ function auxin_get_gmap_master_array( $master_array ) {
|
|
42 |
'value' => '',
|
43 |
'holder' => 'textfield',
|
44 |
'class' => 'title',
|
45 |
-
'admin_label' =>
|
46 |
'dependency' => '',
|
47 |
'weight' => '',
|
48 |
'group' => '' ,
|
@@ -54,10 +54,9 @@ function auxin_get_gmap_master_array( $master_array ) {
|
|
54 |
'param_name' => 'height',
|
55 |
'type' => 'textfield',
|
56 |
'value' => '700',
|
57 |
-
'
|
58 |
-
'holder' => 'textfield',
|
59 |
'class' => 'height',
|
60 |
-
'admin_label' =>
|
61 |
'dependency' => '',
|
62 |
'weight' => '',
|
63 |
'group' => '' ,
|
@@ -69,10 +68,9 @@ function auxin_get_gmap_master_array( $master_array ) {
|
|
69 |
'param_name' => 'latitude',
|
70 |
'type' => 'textfield',
|
71 |
'value' => '52',
|
72 |
-
'
|
73 |
-
'holder' => 'textfield',
|
74 |
'class' => 'latitude',
|
75 |
-
'admin_label' =>
|
76 |
'dependency' => '',
|
77 |
'weight' => '',
|
78 |
'group' => '' ,
|
@@ -84,10 +82,9 @@ function auxin_get_gmap_master_array( $master_array ) {
|
|
84 |
'param_name' => 'longitude',
|
85 |
'type' => 'textfield',
|
86 |
'value' => '14',
|
87 |
-
'
|
88 |
-
'holder' => 'textfield',
|
89 |
'class' => 'longitude',
|
90 |
-
'admin_label' =>
|
91 |
'dependency' => '',
|
92 |
'weight' => '',
|
93 |
'group' => '' ,
|
@@ -100,9 +97,9 @@ function auxin_get_gmap_master_array( $master_array ) {
|
|
100 |
'type' => 'dropdown',
|
101 |
'def_value' => 'ROADMAP',
|
102 |
'value' => array( 'ROADMAP' => __('ROADMAP', 'auxin-elements' ), 'SATELLITE' => __('SATELLITE', 'auxin-elements' ) ),
|
103 |
-
'holder' => '
|
104 |
'class' => 'type',
|
105 |
-
'admin_label' =>
|
106 |
'dependency' => '',
|
107 |
'weight' => '',
|
108 |
'group' => '' ,
|
@@ -113,10 +110,10 @@ function auxin_get_gmap_master_array( $master_array ) {
|
|
113 |
'description' => __('This feild allow you to customize the presentation of the standard Google base maps. You can find many preset styles in ', 'auxin-elements' ) .
|
114 |
'<a href="https://snazzymaps.com/" target="_blank">' . __('this website.', 'auxin-elements' ) . '</a>' ,
|
115 |
'param_name' => 'style',
|
116 |
-
'type' => '
|
117 |
'def_value' => '',
|
118 |
'value' => '',
|
119 |
-
'holder' => '
|
120 |
'class' => 'style',
|
121 |
'admin_label' => false,
|
122 |
'dependency' => array(
|
@@ -130,10 +127,9 @@ function auxin_get_gmap_master_array( $master_array ) {
|
|
130 |
'param_name' => 'marker_info',
|
131 |
'type' => 'textfield',
|
132 |
'value' => '',
|
133 |
-
'
|
134 |
-
'holder' => 'textfield',
|
135 |
'class' => 'marker_info',
|
136 |
-
'admin_label' =>
|
137 |
'dependency' => '',
|
138 |
'weight' => '',
|
139 |
'group' => '' ,
|
@@ -146,12 +142,12 @@ function auxin_get_gmap_master_array( $master_array ) {
|
|
146 |
'type' => 'aux_switch',
|
147 |
'def_value' => '',
|
148 |
'value' => '1',
|
149 |
-
'holder' => '
|
150 |
'class' => 'show_mapcontrols',
|
151 |
-
'admin_label' =>
|
152 |
'dependency' => '',
|
153 |
'weight' => '',
|
154 |
-
'group' => '
|
155 |
'edit_field_class' => ''
|
156 |
),
|
157 |
array(
|
@@ -160,13 +156,12 @@ function auxin_get_gmap_master_array( $master_array ) {
|
|
160 |
'param_name' => 'zoom',
|
161 |
'type' => 'textfield',
|
162 |
'value' => '4',
|
163 |
-
'
|
164 |
-
'holder' => 'textfield',
|
165 |
'class' => 'zoom',
|
166 |
-
'admin_label' =>
|
167 |
'dependency' => '',
|
168 |
'weight' => '',
|
169 |
-
'group' => '
|
170 |
'edit_field_class' => ''
|
171 |
),
|
172 |
array(
|
@@ -174,14 +169,13 @@ function auxin_get_gmap_master_array( $master_array ) {
|
|
174 |
'description' => '',
|
175 |
'param_name' => 'zoom_wheel',
|
176 |
'type' => 'aux_switch',
|
177 |
-
'def_value' => '',
|
178 |
'value' => '0',
|
179 |
-
'holder' => '
|
180 |
'class' => 'zoom_wheel',
|
181 |
-
'admin_label' =>
|
182 |
'dependency' => '',
|
183 |
'weight' => '',
|
184 |
-
'group' => '
|
185 |
'edit_field_class' => ''
|
186 |
),
|
187 |
array(
|
@@ -190,16 +184,14 @@ function auxin_get_gmap_master_array( $master_array ) {
|
|
190 |
'param_name' => 'extra_classes',
|
191 |
'type' => 'textfield',
|
192 |
'value' => '',
|
193 |
-
'
|
194 |
-
'holder' => 'textfield',
|
195 |
'class' => 'extra_classes',
|
196 |
-
'admin_label' =>
|
197 |
'dependency' => '',
|
198 |
'weight' => '',
|
199 |
-
'group' => '
|
200 |
'edit_field_class' => ''
|
201 |
)
|
202 |
-
|
203 |
)
|
204 |
);
|
205 |
|
@@ -232,6 +224,7 @@ function auxin_widget_gmaps_callback( $atts, $shortcode_content = null ){
|
|
232 |
'show_mapcontrols' => 1,
|
233 |
'zoom' => 10,
|
234 |
'zoom_wheel' => 0,
|
|
|
235 |
'extra_classes' => '', // custom css class names for this element
|
236 |
'custom_el_id' => '', // custom id attribute for this element
|
237 |
'base_class' => 'aux-widget-gmaps' // base class name for container
|
@@ -248,6 +241,9 @@ function auxin_widget_gmaps_callback( $atts, $shortcode_content = null ){
|
|
248 |
|
249 |
if ( empty( $style ) ) {
|
250 |
$style = auxin_get_gmap_style();
|
|
|
|
|
|
|
251 |
}
|
252 |
|
253 |
ob_start();
|
@@ -262,8 +258,8 @@ function auxin_widget_gmaps_callback( $atts, $shortcode_content = null ){
|
|
262 |
"use strict";
|
263 |
|
264 |
$(function(){
|
265 |
-
if(typeof GMaps !=
|
266 |
-
console.
|
267 |
return;
|
268 |
}
|
269 |
var map = new GMaps({
|
42 |
'value' => '',
|
43 |
'holder' => 'textfield',
|
44 |
'class' => 'title',
|
45 |
+
'admin_label' => false,
|
46 |
'dependency' => '',
|
47 |
'weight' => '',
|
48 |
'group' => '' ,
|
54 |
'param_name' => 'height',
|
55 |
'type' => 'textfield',
|
56 |
'value' => '700',
|
57 |
+
'holder' => '',
|
|
|
58 |
'class' => 'height',
|
59 |
+
'admin_label' => false,
|
60 |
'dependency' => '',
|
61 |
'weight' => '',
|
62 |
'group' => '' ,
|
68 |
'param_name' => 'latitude',
|
69 |
'type' => 'textfield',
|
70 |
'value' => '52',
|
71 |
+
'holder' => '',
|
|
|
72 |
'class' => 'latitude',
|
73 |
+
'admin_label' => false,
|
74 |
'dependency' => '',
|
75 |
'weight' => '',
|
76 |
'group' => '' ,
|
82 |
'param_name' => 'longitude',
|
83 |
'type' => 'textfield',
|
84 |
'value' => '14',
|
85 |
+
'holder' => '',
|
|
|
86 |
'class' => 'longitude',
|
87 |
+
'admin_label' => false,
|
88 |
'dependency' => '',
|
89 |
'weight' => '',
|
90 |
'group' => '' ,
|
97 |
'type' => 'dropdown',
|
98 |
'def_value' => 'ROADMAP',
|
99 |
'value' => array( 'ROADMAP' => __('ROADMAP', 'auxin-elements' ), 'SATELLITE' => __('SATELLITE', 'auxin-elements' ) ),
|
100 |
+
'holder' => '',
|
101 |
'class' => 'type',
|
102 |
+
'admin_label' => false,
|
103 |
'dependency' => '',
|
104 |
'weight' => '',
|
105 |
'group' => '' ,
|
110 |
'description' => __('This feild allow you to customize the presentation of the standard Google base maps. You can find many preset styles in ', 'auxin-elements' ) .
|
111 |
'<a href="https://snazzymaps.com/" target="_blank">' . __('this website.', 'auxin-elements' ) . '</a>' ,
|
112 |
'param_name' => 'style',
|
113 |
+
'type' => 'textarea_raw_html',
|
114 |
'def_value' => '',
|
115 |
'value' => '',
|
116 |
+
'holder' => '',
|
117 |
'class' => 'style',
|
118 |
'admin_label' => false,
|
119 |
'dependency' => array(
|
127 |
'param_name' => 'marker_info',
|
128 |
'type' => 'textfield',
|
129 |
'value' => '',
|
130 |
+
'holder' => '',
|
|
|
131 |
'class' => 'marker_info',
|
132 |
+
'admin_label' => false,
|
133 |
'dependency' => '',
|
134 |
'weight' => '',
|
135 |
'group' => '' ,
|
142 |
'type' => 'aux_switch',
|
143 |
'def_value' => '',
|
144 |
'value' => '1',
|
145 |
+
'holder' => '',
|
146 |
'class' => 'show_mapcontrols',
|
147 |
+
'admin_label' => false,
|
148 |
'dependency' => '',
|
149 |
'weight' => '',
|
150 |
+
'group' => '' ,
|
151 |
'edit_field_class' => ''
|
152 |
),
|
153 |
array(
|
156 |
'param_name' => 'zoom',
|
157 |
'type' => 'textfield',
|
158 |
'value' => '4',
|
159 |
+
'holder' => '',
|
|
|
160 |
'class' => 'zoom',
|
161 |
+
'admin_label' => false,
|
162 |
'dependency' => '',
|
163 |
'weight' => '',
|
164 |
+
'group' => '' ,
|
165 |
'edit_field_class' => ''
|
166 |
),
|
167 |
array(
|
169 |
'description' => '',
|
170 |
'param_name' => 'zoom_wheel',
|
171 |
'type' => 'aux_switch',
|
|
|
172 |
'value' => '0',
|
173 |
+
'holder' => '',
|
174 |
'class' => 'zoom_wheel',
|
175 |
+
'admin_label' => false,
|
176 |
'dependency' => '',
|
177 |
'weight' => '',
|
178 |
+
'group' => '' ,
|
179 |
'edit_field_class' => ''
|
180 |
),
|
181 |
array(
|
184 |
'param_name' => 'extra_classes',
|
185 |
'type' => 'textfield',
|
186 |
'value' => '',
|
187 |
+
'holder' => '',
|
|
|
188 |
'class' => 'extra_classes',
|
189 |
+
'admin_label' => false,
|
190 |
'dependency' => '',
|
191 |
'weight' => '',
|
192 |
+
'group' => '' ,
|
193 |
'edit_field_class' => ''
|
194 |
)
|
|
|
195 |
)
|
196 |
);
|
197 |
|
224 |
'show_mapcontrols' => 1,
|
225 |
'zoom' => 10,
|
226 |
'zoom_wheel' => 0,
|
227 |
+
|
228 |
'extra_classes' => '', // custom css class names for this element
|
229 |
'custom_el_id' => '', // custom id attribute for this element
|
230 |
'base_class' => 'aux-widget-gmaps' // base class name for container
|
241 |
|
242 |
if ( empty( $style ) ) {
|
243 |
$style = auxin_get_gmap_style();
|
244 |
+
} elseif ( base64_decode( $style, true ) === false) {
|
245 |
+
} else {
|
246 |
+
$style = rawurldecode( base64_decode( strip_tags( $style ) ) );
|
247 |
}
|
248 |
|
249 |
ob_start();
|
258 |
"use strict";
|
259 |
|
260 |
$(function(){
|
261 |
+
if(typeof GMaps != "function" || typeof google === "undefined"){
|
262 |
+
console.info( "Please add google map API key in theme options. https://developers.google.com/maps/documentation/javascript/" );
|
263 |
return;
|
264 |
}
|
265 |
var map = new GMaps({
|
includes/elements/latest-posts-slider.php
CHANGED
@@ -44,9 +44,9 @@ function auxin_get_post_slider_master_array( $master_array ) {
|
|
44 |
'param_name' => 'title',
|
45 |
'type' => 'textfield',
|
46 |
'value' => '',
|
47 |
-
'holder' => '
|
48 |
'class' => 'title',
|
49 |
-
'admin_label' =>
|
50 |
'dependency' => '',
|
51 |
'weight' => '',
|
52 |
'group' => '' ,
|
@@ -62,12 +62,12 @@ function auxin_get_post_slider_master_array( $master_array ) {
|
|
62 |
'post' => __('Posts', 'auxin-elements' ),
|
63 |
'page' => __('Pages', 'auxin-elements' ),
|
64 |
),
|
65 |
-
'holder' => '
|
66 |
'class' => 'border',
|
67 |
'admin_label' => true,
|
68 |
'dependency' => '',
|
69 |
'weight' => '',
|
70 |
-
'group' => '' ,
|
71 |
'edit_field_class' => ''
|
72 |
),
|
73 |
array(
|
@@ -76,12 +76,12 @@ function auxin_get_post_slider_master_array( $master_array ) {
|
|
76 |
'param_name' => 'slides_num',
|
77 |
'type' => 'textfield',
|
78 |
'value' => '10',
|
79 |
-
'holder' => '
|
80 |
'class' => '',
|
81 |
-
'admin_label' =>
|
82 |
'dependency' => '',
|
83 |
'weight' => '',
|
84 |
-
'group' => '' ,
|
85 |
'edit_field_class' => ''
|
86 |
),
|
87 |
array(
|
@@ -90,12 +90,12 @@ function auxin_get_post_slider_master_array( $master_array ) {
|
|
90 |
'param_name' => 'exclude',
|
91 |
'type' => 'textfield',
|
92 |
'value' => '',
|
93 |
-
'holder' => '
|
94 |
'class' => '',
|
95 |
-
'admin_label' =>
|
96 |
'dependency' => '',
|
97 |
'weight' => '',
|
98 |
-
'group' => '' ,
|
99 |
'edit_field_class' => ''
|
100 |
),
|
101 |
array(
|
@@ -104,12 +104,12 @@ function auxin_get_post_slider_master_array( $master_array ) {
|
|
104 |
'param_name' => 'include',
|
105 |
'type' => 'textfield',
|
106 |
'value' => '',
|
107 |
-
'holder' => '
|
108 |
'class' => '',
|
109 |
-
'admin_label' =>
|
110 |
'dependency' => '',
|
111 |
'weight' => '',
|
112 |
-
'group' => '' ,
|
113 |
'edit_field_class' => ''
|
114 |
),
|
115 |
array(
|
@@ -118,12 +118,12 @@ function auxin_get_post_slider_master_array( $master_array ) {
|
|
118 |
'param_name' => 'offset',
|
119 |
'type' => 'textfield',
|
120 |
'value' => '',
|
121 |
-
'holder' => '
|
122 |
'class' => '',
|
123 |
-
'admin_label' =>
|
124 |
'dependency' => '',
|
125 |
'weight' => '',
|
126 |
-
'group' => '' ,
|
127 |
'edit_field_class' => ''
|
128 |
),
|
129 |
array(
|
@@ -142,12 +142,12 @@ function auxin_get_post_slider_master_array( $master_array ) {
|
|
142 |
'modified' => __('Date Modified', 'auxin-elements' ),
|
143 |
'author' => __('Author', 'auxin-elements' ),
|
144 |
),
|
145 |
-
'holder' => '
|
146 |
'class' => 'border',
|
147 |
-
'admin_label' =>
|
148 |
'dependency' => '',
|
149 |
'weight' => '',
|
150 |
-
'group' => '' ,
|
151 |
'edit_field_class' => ''
|
152 |
),
|
153 |
array(
|
@@ -160,12 +160,12 @@ function auxin_get_post_slider_master_array( $master_array ) {
|
|
160 |
'DESC' => __('Descending', 'auxin-elements' ),
|
161 |
'ASC' => __('Ascending', 'auxin-elements' ),
|
162 |
),
|
163 |
-
'holder' => '
|
164 |
'class' => 'border',
|
165 |
-
'admin_label' =>
|
166 |
'dependency' => '',
|
167 |
'weight' => '',
|
168 |
-
'group' => '' ,
|
169 |
'edit_field_class' => ''
|
170 |
),
|
171 |
array(
|
@@ -180,9 +180,9 @@ function auxin_get_post_slider_master_array( $master_array ) {
|
|
180 |
'aux-full-light-skin' => __('Light overlay', 'auxin-elements' ),
|
181 |
'aux-full-dark-skin' => __('Dark overlay', 'auxin-elements' ),
|
182 |
),
|
183 |
-
'holder' => '
|
184 |
'class' => 'border',
|
185 |
-
'admin_label' =>
|
186 |
'dependency' => '',
|
187 |
'weight' => '',
|
188 |
'group' => '' ,
|
@@ -195,7 +195,7 @@ function auxin_get_post_slider_master_array( $master_array ) {
|
|
195 |
'type' => 'aux_switch',
|
196 |
'value' => '1',
|
197 |
'class' => '',
|
198 |
-
'admin_label' =>
|
199 |
'dependency' => '',
|
200 |
'weight' => '',
|
201 |
'group' => '' ,
|
@@ -212,7 +212,7 @@ function auxin_get_post_slider_master_array( $master_array ) {
|
|
212 |
'element' => 'add_title',
|
213 |
'value' => '1'
|
214 |
),
|
215 |
-
'admin_label' =>
|
216 |
'weight' => '',
|
217 |
'group' => '' ,
|
218 |
'edit_field_class' => ''
|
@@ -230,12 +230,12 @@ function auxin_get_post_slider_master_array( $master_array ) {
|
|
230 |
'first' => __('First image in post', 'auxin-elements' ),
|
231 |
'custom' => __('Custom image', 'auxin-elements' ),
|
232 |
),
|
233 |
-
'holder' => '
|
234 |
'class' => 'border',
|
235 |
-
'admin_label' =>
|
236 |
'dependency' => '',
|
237 |
'weight' => '',
|
238 |
-
'group' => ''
|
239 |
'edit_field_class' => ''
|
240 |
),
|
241 |
array(
|
@@ -245,7 +245,7 @@ function auxin_get_post_slider_master_array( $master_array ) {
|
|
245 |
'type' => 'attach_image',
|
246 |
'value' => '',
|
247 |
'class' => '',
|
248 |
-
'admin_label' =>
|
249 |
'dependency' => array(
|
250 |
'element' => 'image_from',
|
251 |
'value' => 'custom'
|
@@ -261,7 +261,7 @@ function auxin_get_post_slider_master_array( $master_array ) {
|
|
261 |
'type' => 'aux_switch',
|
262 |
'value' => '1',
|
263 |
'class' => '',
|
264 |
-
'admin_label' =>
|
265 |
'dependency' => '',
|
266 |
'weight' => '',
|
267 |
'group' => '' ,
|
@@ -274,9 +274,9 @@ function auxin_get_post_slider_master_array( $master_array ) {
|
|
274 |
'param_name' => 'width',
|
275 |
'type' => 'textfield',
|
276 |
'value' => '960',
|
277 |
-
'holder' => '
|
278 |
'class' => '',
|
279 |
-
'admin_label' =>
|
280 |
'dependency' => '',
|
281 |
'weight' => '',
|
282 |
'group' => '' ,
|
@@ -287,9 +287,9 @@ function auxin_get_post_slider_master_array( $master_array ) {
|
|
287 |
'param_name' => 'height',
|
288 |
'type' => 'textfield',
|
289 |
'value' => '560',
|
290 |
-
'holder' => '
|
291 |
'class' => '',
|
292 |
-
'admin_label' =>
|
293 |
'dependency' => '',
|
294 |
'weight' => '',
|
295 |
'group' => '' ,
|
@@ -302,10 +302,10 @@ function auxin_get_post_slider_master_array( $master_array ) {
|
|
302 |
'type' => 'aux_switch',
|
303 |
'value' => '0',
|
304 |
'class' => '',
|
305 |
-
'admin_label' =>
|
306 |
'dependency' => '',
|
307 |
'weight' => '',
|
308 |
-
'group' => '
|
309 |
'edit_field_class' => ''
|
310 |
),
|
311 |
array(
|
@@ -313,12 +313,12 @@ function auxin_get_post_slider_master_array( $master_array ) {
|
|
313 |
'param_name' => 'space',
|
314 |
'type' => 'textfield',
|
315 |
'value' => '5',
|
316 |
-
'holder' => '
|
317 |
'class' => '',
|
318 |
-
'admin_label' =>
|
319 |
'dependency' => '',
|
320 |
'weight' => '',
|
321 |
-
'group' => '
|
322 |
'edit_field_class' => ''
|
323 |
),
|
324 |
array(
|
@@ -326,12 +326,12 @@ function auxin_get_post_slider_master_array( $master_array ) {
|
|
326 |
'description' => '',
|
327 |
'param_name' => 'loop',
|
328 |
'type' => 'aux_switch',
|
329 |
-
'value' => '
|
330 |
'class' => '',
|
331 |
-
'admin_label' =>
|
332 |
'dependency' => '',
|
333 |
'weight' => '',
|
334 |
-
'group' => '
|
335 |
'edit_field_class' => ''
|
336 |
),
|
337 |
array(
|
@@ -341,10 +341,10 @@ function auxin_get_post_slider_master_array( $master_array ) {
|
|
341 |
'type' => 'aux_switch',
|
342 |
'value' => '0',
|
343 |
'class' => '',
|
344 |
-
'admin_label' =>
|
345 |
'dependency' => '',
|
346 |
'weight' => '',
|
347 |
-
'group' => '
|
348 |
'edit_field_class' => ''
|
349 |
),
|
350 |
array(
|
@@ -352,17 +352,32 @@ function auxin_get_post_slider_master_array( $master_array ) {
|
|
352 |
'param_name' => 'slideshow_delay',
|
353 |
'type' => 'textfield',
|
354 |
'value' => '2',
|
355 |
-
'holder' => '
|
356 |
'class' => '',
|
357 |
-
'admin_label' =>
|
358 |
'dependency' => array(
|
359 |
'element' => 'slideshow',
|
360 |
'value' => '1'
|
361 |
),
|
362 |
'weight' => '',
|
363 |
-
'group' => '
|
364 |
'edit_field_class' => ''
|
365 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
366 |
)
|
367 |
);
|
368 |
|
@@ -406,7 +421,6 @@ function auxin_latest_posts_slider_callback( $atts, $shortcode_content = null ){
|
|
406 |
'slideshow_delay' => '2',
|
407 |
'arrows' => '0',
|
408 |
|
409 |
-
|
410 |
'extra_classes' => '', // custom css class names for this element
|
411 |
'custom_el_id' => '', // custom id attribute for this element
|
412 |
'base_class' => 'aux-widget-post-slider' // base class name for container
|
44 |
'param_name' => 'title',
|
45 |
'type' => 'textfield',
|
46 |
'value' => '',
|
47 |
+
'holder' => '',
|
48 |
'class' => 'title',
|
49 |
+
'admin_label' => false,
|
50 |
'dependency' => '',
|
51 |
'weight' => '',
|
52 |
'group' => '' ,
|
62 |
'post' => __('Posts', 'auxin-elements' ),
|
63 |
'page' => __('Pages', 'auxin-elements' ),
|
64 |
),
|
65 |
+
'holder' => '',
|
66 |
'class' => 'border',
|
67 |
'admin_label' => true,
|
68 |
'dependency' => '',
|
69 |
'weight' => '',
|
70 |
+
'group' => 'Query' ,
|
71 |
'edit_field_class' => ''
|
72 |
),
|
73 |
array(
|
76 |
'param_name' => 'slides_num',
|
77 |
'type' => 'textfield',
|
78 |
'value' => '10',
|
79 |
+
'holder' => '',
|
80 |
'class' => '',
|
81 |
+
'admin_label' => false,
|
82 |
'dependency' => '',
|
83 |
'weight' => '',
|
84 |
+
'group' => 'Query' ,
|
85 |
'edit_field_class' => ''
|
86 |
),
|
87 |
array(
|
90 |
'param_name' => 'exclude',
|
91 |
'type' => 'textfield',
|
92 |
'value' => '',
|
93 |
+
'holder' => '',
|
94 |
'class' => '',
|
95 |
+
'admin_label' => false,
|
96 |
'dependency' => '',
|
97 |
'weight' => '',
|
98 |
+
'group' => 'Query' ,
|
99 |
'edit_field_class' => ''
|
100 |
),
|
101 |
array(
|
104 |
'param_name' => 'include',
|
105 |
'type' => 'textfield',
|
106 |
'value' => '',
|
107 |
+
'holder' => '',
|
108 |
'class' => '',
|
109 |
+
'admin_label' => false,
|
110 |
'dependency' => '',
|
111 |
'weight' => '',
|
112 |
+
'group' => 'Query' ,
|
113 |
'edit_field_class' => ''
|
114 |
),
|
115 |
array(
|
118 |
'param_name' => 'offset',
|
119 |
'type' => 'textfield',
|
120 |
'value' => '',
|
121 |
+
'holder' => '',
|
122 |
'class' => '',
|
123 |
+
'admin_label' => false,
|
124 |
'dependency' => '',
|
125 |
'weight' => '',
|
126 |
+
'group' => 'Query' ,
|
127 |
'edit_field_class' => ''
|
128 |
),
|
129 |
array(
|
142 |
'modified' => __('Date Modified', 'auxin-elements' ),
|
143 |
'author' => __('Author', 'auxin-elements' ),
|
144 |
),
|
145 |
+
'holder' => '',
|
146 |
'class' => 'border',
|
147 |
+
'admin_label' => false,
|
148 |
'dependency' => '',
|
149 |
'weight' => '',
|
150 |
+
'group' => 'Query' ,
|
151 |
'edit_field_class' => ''
|
152 |
),
|
153 |
array(
|
160 |
'DESC' => __('Descending', 'auxin-elements' ),
|
161 |
'ASC' => __('Ascending', 'auxin-elements' ),
|
162 |
),
|
163 |
+
'holder' => '',
|
164 |
'class' => 'border',
|
165 |
+
'admin_label' => false,
|
166 |
'dependency' => '',
|
167 |
'weight' => '',
|
168 |
+
'group' => 'Query' ,
|
169 |
'edit_field_class' => ''
|
170 |
),
|
171 |
array(
|
180 |
'aux-full-light-skin' => __('Light overlay', 'auxin-elements' ),
|
181 |
'aux-full-dark-skin' => __('Dark overlay', 'auxin-elements' ),
|
182 |
),
|
183 |
+
'holder' => '',
|
184 |
'class' => 'border',
|
185 |
+
'admin_label' => false,
|
186 |
'dependency' => '',
|
187 |
'weight' => '',
|
188 |
'group' => '' ,
|
195 |
'type' => 'aux_switch',
|
196 |
'value' => '1',
|
197 |
'class' => '',
|
198 |
+
'admin_label' => false,
|
199 |
'dependency' => '',
|
200 |
'weight' => '',
|
201 |
'group' => '' ,
|
212 |
'element' => 'add_title',
|
213 |
'value' => '1'
|
214 |
),
|
215 |
+
'admin_label' => false,
|
216 |
'weight' => '',
|
217 |
'group' => '' ,
|
218 |
'edit_field_class' => ''
|
230 |
'first' => __('First image in post', 'auxin-elements' ),
|
231 |
'custom' => __('Custom image', 'auxin-elements' ),
|
232 |
),
|
233 |
+
'holder' => '',
|
234 |
'class' => 'border',
|
235 |
+
'admin_label' => false,
|
236 |
'dependency' => '',
|
237 |
'weight' => '',
|
238 |
+
'group' => 'Query',
|
239 |
'edit_field_class' => ''
|
240 |
),
|
241 |
array(
|
245 |
'type' => 'attach_image',
|
246 |
'value' => '',
|
247 |
'class' => '',
|
248 |
+
'admin_label' => false,
|
249 |
'dependency' => array(
|
250 |
'element' => 'image_from',
|
251 |
'value' => 'custom'
|
261 |
'type' => 'aux_switch',
|
262 |
'value' => '1',
|
263 |
'class' => '',
|
264 |
+
'admin_label' => false,
|
265 |
'dependency' => '',
|
266 |
'weight' => '',
|
267 |
'group' => '' ,
|
274 |
'param_name' => 'width',
|
275 |
'type' => 'textfield',
|
276 |
'value' => '960',
|
277 |
+
'holder' => '',
|
278 |
'class' => '',
|
279 |
+
'admin_label' => false,
|
280 |
'dependency' => '',
|
281 |
'weight' => '',
|
282 |
'group' => '' ,
|
287 |
'param_name' => 'height',
|
288 |
'type' => 'textfield',
|
289 |
'value' => '560',
|
290 |
+
'holder' => '',
|
291 |
'class' => '',
|
292 |
+
'admin_label' => false,
|
293 |
'dependency' => '',
|
294 |
'weight' => '',
|
295 |
'group' => '' ,
|
302 |
'type' => 'aux_switch',
|
303 |
'value' => '0',
|
304 |
'class' => '',
|
305 |
+
'admin_label' => false,
|
306 |
'dependency' => '',
|
307 |
'weight' => '',
|
308 |
+
'group' => '' ,
|
309 |
'edit_field_class' => ''
|
310 |
),
|
311 |
array(
|
313 |
'param_name' => 'space',
|
314 |
'type' => 'textfield',
|
315 |
'value' => '5',
|
316 |
+
'holder' => '',
|
317 |
'class' => '',
|
318 |
+
'admin_label' => false,
|
319 |
'dependency' => '',
|
320 |
'weight' => '',
|
321 |
+
'group' => '' ,
|
322 |
'edit_field_class' => ''
|
323 |
),
|
324 |
array(
|
326 |
'description' => '',
|
327 |
'param_name' => 'loop',
|
328 |
'type' => 'aux_switch',
|
329 |
+
'value' => '1',
|
330 |
'class' => '',
|
331 |
+
'admin_label' => false,
|
332 |
'dependency' => '',
|
333 |
'weight' => '',
|
334 |
+
'group' => '' ,
|
335 |
'edit_field_class' => ''
|
336 |
),
|
337 |
array(
|
341 |
'type' => 'aux_switch',
|
342 |
'value' => '0',
|
343 |
'class' => '',
|
344 |
+
'admin_label' => false,
|
345 |
'dependency' => '',
|
346 |
'weight' => '',
|
347 |
+
'group' => '' ,
|
348 |
'edit_field_class' => ''
|
349 |
),
|
350 |
array(
|
352 |
'param_name' => 'slideshow_delay',
|
353 |
'type' => 'textfield',
|
354 |
'value' => '2',
|
355 |
+
'holder' => '',
|
356 |
'class' => '',
|
357 |
+
'admin_label' => false,
|
358 |
'dependency' => array(
|
359 |
'element' => 'slideshow',
|
360 |
'value' => '1'
|
361 |
),
|
362 |
'weight' => '',
|
363 |
+
'group' => '' ,
|
364 |
'edit_field_class' => ''
|
365 |
),
|
366 |
+
array(
|
367 |
+
'heading' => __('Extra class name','auxin-elements'),
|
368 |
+
'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'),
|
369 |
+
'param_name' => 'extra_classes',
|
370 |
+
'type' => 'textfield',
|
371 |
+
'value' => '',
|
372 |
+
'def_value' => '',
|
373 |
+
'holder' => '',
|
374 |
+
'class' => 'extra_classes',
|
375 |
+
'admin_label' => false,
|
376 |
+
'dependency' => '',
|
377 |
+
'weight' => '',
|
378 |
+
'group' => '' ,
|
379 |
+
'edit_field_class' => ''
|
380 |
+
)
|
381 |
)
|
382 |
);
|
383 |
|
421 |
'slideshow_delay' => '2',
|
422 |
'arrows' => '0',
|
423 |
|
|
|
424 |
'extra_classes' => '', // custom css class names for this element
|
425 |
'custom_el_id' => '', // custom id attribute for this element
|
426 |
'base_class' => 'aux-widget-post-slider' // base class name for container
|
includes/elements/quote.php
CHANGED
@@ -37,30 +37,15 @@ function auxin_get_quote_master_array( $master_array ) {
|
|
37 |
'as_parent' => '',
|
38 |
'as_child' => '',
|
39 |
'params' => array(
|
40 |
-
array(
|
41 |
-
'heading' => __('Title','auxin-elements' ),
|
42 |
-
'description' => __('Quote title, leave it empty if you don`t need title.', 'auxin-elements' ),
|
43 |
-
'param_name' => 'title',
|
44 |
-
'type' => 'textfield',
|
45 |
-
'value' => '',
|
46 |
-
'holder' => 'textfield',
|
47 |
-
'class' => 'title',
|
48 |
-
'admin_label' => true,
|
49 |
-
'dependency' => '',
|
50 |
-
'weight' => '',
|
51 |
-
'group' => '' ,
|
52 |
-
'edit_field_class' => ''
|
53 |
-
),
|
54 |
array(
|
55 |
'heading' => __('Quote text','auxin-elements' ),
|
56 |
'description' => __('Enter a text as a quote.','auxin-elements' ),
|
57 |
'param_name' => 'content',
|
58 |
'type' => 'textarea_html',
|
59 |
'value' => '',
|
60 |
-
'
|
61 |
-
'holder' => 'div',
|
62 |
'class' => 'content',
|
63 |
-
'admin_label' =>
|
64 |
'dependency' => '',
|
65 |
'weight' => '',
|
66 |
'group' => '' ,
|
@@ -106,7 +91,7 @@ function auxin_get_quote_master_array( $master_array ) {
|
|
106 |
'image' => AUX_URL . 'images/visual-select/pullquote-colorized.svg'
|
107 |
)
|
108 |
),
|
109 |
-
'holder' => '
|
110 |
'class' => 'type',
|
111 |
'admin_label' => true,
|
112 |
'dependency' => '',
|
@@ -126,9 +111,9 @@ function auxin_get_quote_master_array( $master_array ) {
|
|
126 |
'right' => __('Right' , 'auxin-elements' ),
|
127 |
'center' => __('Center' , 'auxin-elements' )
|
128 |
),
|
129 |
-
'holder' => '
|
130 |
'class' => 'type',
|
131 |
-
'admin_label' =>
|
132 |
'dependency' => '',
|
133 |
'weight' => '',
|
134 |
'group' => '' ,
|
@@ -158,17 +143,15 @@ function auxin_get_quote_master_array( $master_array ) {
|
|
158 |
'description' => '',
|
159 |
'param_name' => 'quote_symbol',
|
160 |
'type' => 'aux_switch',
|
161 |
-
'def_value' => '',
|
162 |
'value' => '1',
|
163 |
-
'holder' => '
|
164 |
'class' => 'showheader',
|
165 |
-
'admin_label' =>
|
166 |
'dependency' => '',
|
167 |
'weight' => '',
|
168 |
'group' => '' ,
|
169 |
'edit_field_class' => ''
|
170 |
),
|
171 |
-
|
172 |
array(
|
173 |
'heading' => __('Extra class name','auxin-elements' ),
|
174 |
'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' ),
|
@@ -176,14 +159,15 @@ function auxin_get_quote_master_array( $master_array ) {
|
|
176 |
'type' => 'textfield',
|
177 |
'value' => '',
|
178 |
'def_value' => '',
|
179 |
-
'holder' => '
|
180 |
'class' => 'extra_classes',
|
181 |
-
'admin_label' =>
|
182 |
'dependency' => '',
|
183 |
'weight' => '',
|
184 |
'group' => '' ,
|
185 |
'edit_field_class' => ''
|
186 |
)
|
|
|
187 |
)
|
188 |
);
|
189 |
|
@@ -222,7 +206,6 @@ function auxin_widget_quote_callback( $atts, $shortcode_content = null ){
|
|
222 |
|
223 |
// Defining default attributes
|
224 |
$default_atts = array(
|
225 |
-
'title' => '', // header title
|
226 |
'content' => '',
|
227 |
|
228 |
'indent' => '', // custom values: yes, no
|
@@ -230,6 +213,7 @@ function auxin_widget_quote_callback( $atts, $shortcode_content = null ){
|
|
230 |
'text_align' => '',
|
231 |
'float' => '',
|
232 |
'quote_symbol' => '1',
|
|
|
233 |
|
234 |
'extra_classes' => '', // custom css class names for this element
|
235 |
'custom_el_id' => '', // custom id attribute for this element
|
@@ -243,7 +227,6 @@ function auxin_widget_quote_callback( $atts, $shortcode_content = null ){
|
|
243 |
|
244 |
// widget header ------------------------------
|
245 |
echo $result['widget_header'];
|
246 |
-
echo $result['widget_title'];
|
247 |
|
248 |
// widget custom output -----------------------
|
249 |
|
@@ -267,7 +250,6 @@ function auxin_widget_quote_callback( $atts, $shortcode_content = null ){
|
|
267 |
$classes_list[] = $extra_classes;
|
268 |
}
|
269 |
|
270 |
-
|
271 |
$classes = implode( ' ', $classes_list );
|
272 |
$shortcode_content = auxin_do_cleanup_shortcode( $shortcode_content );
|
273 |
$shortcode_content = empty( $shortcode_content ) ? auxin_do_cleanup_shortcode( $content ) : $shortcode_content;
|
37 |
'as_parent' => '',
|
38 |
'as_child' => '',
|
39 |
'params' => array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
array(
|
41 |
'heading' => __('Quote text','auxin-elements' ),
|
42 |
'description' => __('Enter a text as a quote.','auxin-elements' ),
|
43 |
'param_name' => 'content',
|
44 |
'type' => 'textarea_html',
|
45 |
'value' => '',
|
46 |
+
'holder' => '',
|
|
|
47 |
'class' => 'content',
|
48 |
+
'admin_label' => false,
|
49 |
'dependency' => '',
|
50 |
'weight' => '',
|
51 |
'group' => '' ,
|
91 |
'image' => AUX_URL . 'images/visual-select/pullquote-colorized.svg'
|
92 |
)
|
93 |
),
|
94 |
+
'holder' => '',
|
95 |
'class' => 'type',
|
96 |
'admin_label' => true,
|
97 |
'dependency' => '',
|
111 |
'right' => __('Right' , 'auxin-elements' ),
|
112 |
'center' => __('Center' , 'auxin-elements' )
|
113 |
),
|
114 |
+
'holder' => '',
|
115 |
'class' => 'type',
|
116 |
+
'admin_label' => false,
|
117 |
'dependency' => '',
|
118 |
'weight' => '',
|
119 |
'group' => '' ,
|
143 |
'description' => '',
|
144 |
'param_name' => 'quote_symbol',
|
145 |
'type' => 'aux_switch',
|
|
|
146 |
'value' => '1',
|
147 |
+
'holder' => '',
|
148 |
'class' => 'showheader',
|
149 |
+
'admin_label' => false,
|
150 |
'dependency' => '',
|
151 |
'weight' => '',
|
152 |
'group' => '' ,
|
153 |
'edit_field_class' => ''
|
154 |
),
|
|
|
155 |
array(
|
156 |
'heading' => __('Extra class name','auxin-elements' ),
|
157 |
'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' ),
|
159 |
'type' => 'textfield',
|
160 |
'value' => '',
|
161 |
'def_value' => '',
|
162 |
+
'holder' => '',
|
163 |
'class' => 'extra_classes',
|
164 |
+
'admin_label' => false,
|
165 |
'dependency' => '',
|
166 |
'weight' => '',
|
167 |
'group' => '' ,
|
168 |
'edit_field_class' => ''
|
169 |
)
|
170 |
+
|
171 |
)
|
172 |
);
|
173 |
|
206 |
|
207 |
// Defining default attributes
|
208 |
$default_atts = array(
|
|
|
209 |
'content' => '',
|
210 |
|
211 |
'indent' => '', // custom values: yes, no
|
213 |
'text_align' => '',
|
214 |
'float' => '',
|
215 |
'quote_symbol' => '1',
|
216 |
+
'css' => '',
|
217 |
|
218 |
'extra_classes' => '', // custom css class names for this element
|
219 |
'custom_el_id' => '', // custom id attribute for this element
|
227 |
|
228 |
// widget header ------------------------------
|
229 |
echo $result['widget_header'];
|
|
|
230 |
|
231 |
// widget custom output -----------------------
|
232 |
|
250 |
$classes_list[] = $extra_classes;
|
251 |
}
|
252 |
|
|
|
253 |
$classes = implode( ' ', $classes_list );
|
254 |
$shortcode_content = auxin_do_cleanup_shortcode( $shortcode_content );
|
255 |
$shortcode_content = empty( $shortcode_content ) ? auxin_do_cleanup_shortcode( $content ) : $shortcode_content;
|
includes/elements/recent-posts-grid-carousel.php
CHANGED
@@ -54,32 +54,31 @@ function auxin_get_recent_posts_master_array( $master_array ) {
|
|
54 |
'params' => array(
|
55 |
array(
|
56 |
'heading' => __('Title','auxin-elements' ),
|
57 |
-
'description'
|
58 |
'param_name' => 'title',
|
59 |
'type' => 'textfield',
|
60 |
-
'std' => '',
|
61 |
'value' => '',
|
62 |
'holder' => 'textfield',
|
63 |
'class' => 'title',
|
64 |
-
'admin_label' =>
|
65 |
'dependency' => '',
|
66 |
'weight' => '',
|
67 |
-
'group' => ''
|
68 |
'edit_field_class' => ''
|
69 |
),
|
70 |
array(
|
71 |
'heading' => __('Categories', 'auxin-elements'),
|
72 |
'description' => __('Specifies a category that you want to show posts from it.', 'auxin-elements' ),
|
73 |
'param_name' => 'cat',
|
74 |
-
'type' => '
|
75 |
'def_value' => ' ',
|
76 |
-
'holder' => '
|
77 |
'class' => 'cat',
|
78 |
'value' => $categories_list,
|
79 |
-
'admin_label' =>
|
80 |
'dependency' => '',
|
81 |
'weight' => '',
|
82 |
-
'group' => ''
|
83 |
'edit_field_class' => ''
|
84 |
),
|
85 |
array(
|
@@ -87,13 +86,33 @@ function auxin_get_recent_posts_master_array( $master_array ) {
|
|
87 |
'description' => '',
|
88 |
'param_name' => 'num',
|
89 |
'type' => 'textfield',
|
90 |
-
'
|
91 |
-
'holder' => '
|
92 |
'class' => 'num',
|
93 |
-
'admin_label' =>
|
94 |
'dependency' => '',
|
95 |
'weight' => '',
|
96 |
-
'group' => ''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
'edit_field_class' => ''
|
98 |
),
|
99 |
array(
|
@@ -103,23 +122,23 @@ function auxin_get_recent_posts_master_array( $master_array ) {
|
|
103 |
'type' => 'aux_switch',
|
104 |
'value' => '0',
|
105 |
'class' => '',
|
106 |
-
'admin_label' =>
|
107 |
'dependency' => '',
|
108 |
'weight' => '',
|
109 |
-
'group' => ''
|
110 |
'edit_field_class' => ''
|
111 |
),
|
112 |
array(
|
113 |
-
'heading' => __('Exclude
|
114 |
'description' => '',
|
115 |
'param_name' => 'exclude_custom_post_formats',
|
116 |
'type' => 'aux_switch',
|
117 |
'value' => '0',
|
118 |
'class' => '',
|
119 |
-
'admin_label' =>
|
120 |
'dependency' => '',
|
121 |
'weight' => '',
|
122 |
-
'group' => ''
|
123 |
'edit_field_class' => ''
|
124 |
),
|
125 |
array(
|
@@ -129,52 +148,24 @@ function auxin_get_recent_posts_master_array( $master_array ) {
|
|
129 |
'type' => 'aux_switch',
|
130 |
'value' => '0',
|
131 |
'class' => '',
|
132 |
-
'admin_label' =>
|
133 |
'dependency' => array(
|
134 |
'element' => 'exclude_custom_post_formats',
|
135 |
'value' => array('0', 'false')
|
136 |
),
|
137 |
'weight' => '',
|
138 |
-
'group' => ''
|
139 |
-
'edit_field_class' => ''
|
140 |
-
),
|
141 |
-
array(
|
142 |
-
'heading' => __('Exclude posts','auxin-elements' ),
|
143 |
-
'description' => __('Post IDs separated by comma (eg. 53,34,87,25)', 'auxin-elements' ),
|
144 |
-
'param_name' => 'exclude',
|
145 |
-
'type' => 'textfield',
|
146 |
-
'value' => '',
|
147 |
-
'holder' => 'textfield',
|
148 |
-
'class' => '',
|
149 |
-
'admin_label' => true,
|
150 |
-
'dependency' => '',
|
151 |
-
'weight' => '',
|
152 |
-
'group' => '' ,
|
153 |
-
'edit_field_class' => ''
|
154 |
-
),
|
155 |
-
array(
|
156 |
-
'heading' => __('Include posts','auxin-elements' ),
|
157 |
-
'description' => __('Post IDs separated by comma (eg. 53,34,87,25)', 'auxin-elements' ),
|
158 |
-
'param_name' => 'include',
|
159 |
-
'type' => 'textfield',
|
160 |
-
'value' => '',
|
161 |
-
'holder' => 'textfield',
|
162 |
-
'class' => '',
|
163 |
-
'admin_label' => true,
|
164 |
-
'dependency' => '',
|
165 |
-
'weight' => '',
|
166 |
-
'group' => '' ,
|
167 |
'edit_field_class' => ''
|
168 |
),
|
169 |
-
|
170 |
-
'heading'
|
171 |
-
'description'
|
172 |
-
'param_name'
|
173 |
-
'type'
|
174 |
-
'def_value'
|
175 |
-
'holder'
|
176 |
-
'class'
|
177 |
-
'value'
|
178 |
'date' => __('Date', 'auxin-elements'),
|
179 |
'menu_order date' => __('Menu Order', 'auxin-elements'),
|
180 |
'title' => __('Title', 'auxin-elements'),
|
@@ -183,11 +174,12 @@ function auxin_get_recent_posts_master_array( $master_array ) {
|
|
183 |
'comment_count' => __('Comments', 'auxin-elements'),
|
184 |
'modified' => __('Date Modified', 'auxin-elements'),
|
185 |
'author' => __('Author', 'auxin-elements'),
|
|
|
186 |
),
|
187 |
-
'admin_label' =>
|
188 |
'dependency' => '',
|
189 |
'weight' => '',
|
190 |
-
'group' => ''
|
191 |
'edit_field_class' => ''
|
192 |
),
|
193 |
array(
|
@@ -196,50 +188,72 @@ function auxin_get_recent_posts_master_array( $master_array ) {
|
|
196 |
'param_name' => 'order',
|
197 |
'type' => 'dropdown',
|
198 |
'def_value' => 'DESC',
|
199 |
-
'holder' => '
|
200 |
'class' => 'order',
|
201 |
'value' =>array (
|
202 |
'DESC' => __('Descending', 'auxin-elements'),
|
203 |
'ASC' => __('Ascending', 'auxin-elements'),
|
204 |
),
|
205 |
-
'admin_label' =>
|
206 |
'dependency' => '',
|
207 |
'weight' => '',
|
208 |
-
'group' => ''
|
209 |
'edit_field_class' => ''
|
210 |
),
|
211 |
array(
|
212 |
-
'heading'
|
213 |
-
'description'
|
214 |
-
'param_name'
|
215 |
-
'type'
|
216 |
-
'value'
|
217 |
-
'holder'
|
218 |
-
'class'
|
219 |
-
'admin_label'
|
220 |
-
'dependency'
|
221 |
-
'weight'
|
222 |
-
'group'
|
223 |
'edit_field_class' => ''
|
224 |
),
|
225 |
array(
|
226 |
-
'heading' => __('
|
227 |
-
'description' => '',
|
228 |
-
'param_name' => '
|
229 |
-
'type' => '
|
230 |
-
'
|
231 |
-
'holder' => '
|
232 |
-
'class' => '
|
233 |
-
'
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
'dependency' => '',
|
241 |
'weight' => '',
|
242 |
-
'group' => ''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
243 |
'edit_field_class' => ''
|
244 |
),
|
245 |
array(
|
@@ -248,12 +262,12 @@ function auxin_get_recent_posts_master_array( $master_array ) {
|
|
248 |
'type' => 'aux_switch',
|
249 |
'def_value' => '',
|
250 |
'value' => '1',
|
251 |
-
'holder' => '
|
252 |
'class' => 'show_media',
|
253 |
-
'admin_label' =>
|
254 |
'dependency' => '',
|
255 |
'weight' => '',
|
256 |
-
'group' => ''
|
257 |
'edit_field_class' => ''
|
258 |
),
|
259 |
array(
|
@@ -263,10 +277,10 @@ function auxin_get_recent_posts_master_array( $master_array ) {
|
|
263 |
'type' => 'aux_switch',
|
264 |
'value' => '1',
|
265 |
'class' => 'display_title',
|
266 |
-
'admin_label' =>
|
267 |
'dependency' => '',
|
268 |
'weight' => '',
|
269 |
-
'group' => ''
|
270 |
'edit_field_class' => ''
|
271 |
),
|
272 |
array(
|
@@ -276,9 +290,9 @@ function auxin_get_recent_posts_master_array( $master_array ) {
|
|
276 |
'type' => 'aux_switch',
|
277 |
'value' => '1',
|
278 |
'class' => '',
|
279 |
-
'admin_label' =>
|
280 |
'weight' => '',
|
281 |
-
'group' => ''
|
282 |
'edit_field_class' => ''
|
283 |
),
|
284 |
array(
|
@@ -287,19 +301,19 @@ function auxin_get_recent_posts_master_array( $master_array ) {
|
|
287 |
'param_name' => 'post_info_position',
|
288 |
'type' => 'dropdown',
|
289 |
'def_value' => 'after-title',
|
290 |
-
'holder' => '
|
291 |
'class' => 'post_info_position',
|
292 |
'value' => array (
|
293 |
-
'after-title'
|
294 |
-
'before-title'
|
295 |
),
|
296 |
-
'admin_label' =>
|
297 |
'dependency' => array(
|
298 |
-
'element'
|
299 |
-
'value'
|
300 |
),
|
301 |
'weight' => '',
|
302 |
-
'group' => ''
|
303 |
'edit_field_class' => ''
|
304 |
),
|
305 |
array(
|
@@ -308,15 +322,15 @@ function auxin_get_recent_posts_master_array( $master_array ) {
|
|
308 |
'param_name' => 'display_categories',
|
309 |
'type' => 'aux_switch',
|
310 |
'value' => '1',
|
311 |
-
'holder' => '
|
312 |
'class' => 'display_categories',
|
313 |
-
'admin_label' =>
|
314 |
'dependency' => array(
|
315 |
-
'element'
|
316 |
-
'value'
|
317 |
),
|
318 |
'weight' => '',
|
319 |
-
'group' => ''
|
320 |
'edit_field_class' => ''
|
321 |
),
|
322 |
array(
|
@@ -325,30 +339,12 @@ function auxin_get_recent_posts_master_array( $master_array ) {
|
|
325 |
'param_name' => 'display_like',
|
326 |
'type' => 'aux_switch',
|
327 |
'value' => '1',
|
328 |
-
'holder' => '
|
329 |
'class' => 'display_like',
|
330 |
-
'admin_label' =>
|
331 |
'dependency' => '',
|
332 |
'weight' => '',
|
333 |
-
'group' => ''
|
334 |
-
'edit_field_class' => ''
|
335 |
-
),
|
336 |
-
array(
|
337 |
-
'heading' => __('Content layout', 'auxin-elements'),
|
338 |
-
'description' => __('Specifies the style of content for each post column.', 'auxin-elements' ),
|
339 |
-
'param_name' => 'content_layout',
|
340 |
-
'type' => 'dropdown',
|
341 |
-
'def_value' => 'default',
|
342 |
-
'holder' => 'dropdown',
|
343 |
-
'class' => 'content_layout',
|
344 |
-
'value' =>array (
|
345 |
-
'default' => __('Full Content', 'auxin-elements'),
|
346 |
-
'entry-boxed' => __('Boxed Content', 'auxin-elements')
|
347 |
-
),
|
348 |
-
'admin_label' => true,
|
349 |
-
'dependency' => '',
|
350 |
-
'weight' => '',
|
351 |
-
'group' => '' ,
|
352 |
'edit_field_class' => ''
|
353 |
),
|
354 |
array(
|
@@ -357,12 +353,12 @@ function auxin_get_recent_posts_master_array( $master_array ) {
|
|
357 |
'param_name' => 'excerpt_len',
|
358 |
'type' => 'textfield',
|
359 |
'value' => '160',
|
360 |
-
'holder' => '
|
361 |
'class' => 'excerpt_len',
|
362 |
-
'admin_label' =>
|
363 |
'dependency' => '',
|
364 |
'weight' => '',
|
365 |
-
'group' => ''
|
366 |
'edit_field_class' => ''
|
367 |
),
|
368 |
array(
|
@@ -371,113 +367,131 @@ function auxin_get_recent_posts_master_array( $master_array ) {
|
|
371 |
'param_name' => 'author_or_readmore',
|
372 |
'type' => 'dropdown',
|
373 |
'def_value' => 'readmore',
|
374 |
-
'holder' => '
|
375 |
'class' => 'author_or_readmore',
|
376 |
'value' =>array (
|
377 |
-
'readmore'
|
378 |
-
'author'
|
379 |
-
'none'
|
380 |
),
|
381 |
-
'admin_label' =>
|
382 |
'dependency' => '',
|
383 |
'weight' => '',
|
384 |
-
'group' => ''
|
385 |
'edit_field_class' => ''
|
386 |
),
|
387 |
array(
|
388 |
-
'heading'
|
389 |
-
'description'
|
390 |
-
'param_name'
|
391 |
-
'type'
|
392 |
-
'def_value'
|
393 |
-
'holder'
|
394 |
-
'class'
|
395 |
-
'value'
|
396 |
'1' => '1', '2' => '2', '3' => '3',
|
397 |
'4' => '4', '5' => '5', '6' => '6'
|
398 |
),
|
399 |
-
'admin_label' =>
|
400 |
'dependency' => '',
|
401 |
'weight' => '',
|
402 |
-
'group' => 'Layout'
|
403 |
'edit_field_class' => ''
|
404 |
),
|
405 |
array(
|
406 |
-
'heading'
|
407 |
-
'description'
|
408 |
-
'param_name'
|
409 |
-
'type'
|
410 |
-
'def_value'
|
411 |
-
'holder'
|
412 |
-
'class'
|
413 |
-
'value'
|
414 |
'inherit' => 'Inherited from larger',
|
415 |
'1' => '1', '2' => '2', '3' => '3',
|
416 |
'4' => '4', '5' => '5', '6' => '6'
|
417 |
),
|
418 |
-
'admin_label' =>
|
419 |
'dependency' => '',
|
420 |
'weight' => '',
|
421 |
-
'group' => 'Layout'
|
422 |
'edit_field_class' => ''
|
423 |
),
|
424 |
array(
|
425 |
-
'heading'
|
426 |
-
'description'
|
427 |
-
'param_name'
|
428 |
-
'type'
|
429 |
-
'def_value'
|
430 |
-
'holder'
|
431 |
-
'class'
|
432 |
-
'value'
|
433 |
'1' => '1', '2' => '2', '3' => '3'
|
434 |
),
|
435 |
-
'admin_label' =>
|
436 |
'dependency' => '',
|
437 |
'weight' => '',
|
438 |
-
'group' => 'Layout'
|
439 |
'edit_field_class' => ''
|
440 |
),
|
441 |
array(
|
442 |
-
'heading'
|
443 |
-
'description'
|
444 |
-
'param_name'
|
445 |
-
'type'
|
446 |
-
'def_value'
|
447 |
-
'holder'
|
448 |
-
'class'
|
449 |
-
'value'
|
450 |
-
'grid'
|
451 |
-
'grid-table'
|
452 |
-
'carousel'
|
453 |
),
|
454 |
-
'admin_label' =>
|
455 |
'dependency' => '',
|
456 |
'weight' => '',
|
457 |
-
'group' => ''
|
458 |
'edit_field_class' => ''
|
459 |
),
|
460 |
array(
|
461 |
-
'heading'
|
462 |
-
'description'
|
463 |
-
'param_name'
|
464 |
-
'type'
|
465 |
-
'def_value'
|
466 |
-
'holder'
|
467 |
-
'class'
|
468 |
-
'value'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
469 |
'bgcolor' => __( 'Background color', 'auxin-elements' ),
|
470 |
'bgimage' => __( 'Cover image', 'auxin-elements' ),
|
471 |
'bgimage-bgcolor' => __( 'Cover image or background color', 'auxin-elements' ),
|
472 |
'none' => __( 'Nothing', 'auxin-elements' )
|
473 |
),
|
474 |
-
'admin_label' =>
|
475 |
'dependency' => array(
|
476 |
-
'element'
|
477 |
-
'value'
|
478 |
),
|
479 |
'weight' => '',
|
480 |
-
'group' => ''
|
481 |
'edit_field_class' => ''
|
482 |
),
|
483 |
// Carousel Options
|
@@ -487,58 +501,59 @@ function auxin_get_recent_posts_master_array( $master_array ) {
|
|
487 |
'param_name' => 'carousel_space',
|
488 |
'type' => 'textfield',
|
489 |
'value' => '30',
|
490 |
-
'holder' => '
|
491 |
'class' => 'excerpt_len',
|
492 |
-
'admin_label' =>
|
493 |
'dependency' => array(
|
494 |
-
'element'
|
495 |
-
'value'
|
496 |
),
|
497 |
'weight' => '',
|
498 |
-
'group' => ''
|
499 |
'edit_field_class' => ''
|
500 |
),
|
501 |
array(
|
502 |
-
'heading'
|
503 |
-
'description'
|
504 |
-
'param_name'
|
505 |
-
'type'
|
506 |
-
'def_value'
|
507 |
-
'holder'
|
508 |
-
'class'
|
509 |
-
'value'
|
510 |
-
'peritem'
|
511 |
-
'perpage'
|
512 |
-
'scroll'
|
513 |
),
|
514 |
-
'admin_label' =>
|
515 |
'dependency' => array(
|
516 |
-
'element'
|
517 |
-
'value'
|
518 |
),
|
519 |
'weight' => '',
|
520 |
-
'group' => ''
|
521 |
'edit_field_class' => ''
|
522 |
),
|
523 |
array(
|
524 |
-
'heading'
|
525 |
-
'description'
|
526 |
-
'param_name'
|
527 |
-
'type'
|
528 |
-
'def_value'
|
529 |
-
'holder'
|
530 |
-
'class'
|
531 |
-
'value'
|
532 |
-
'arrows'
|
533 |
-
'bullets'
|
534 |
-
''
|
535 |
),
|
536 |
'dependency' => array(
|
537 |
-
'element'
|
538 |
-
'value'
|
539 |
),
|
540 |
'weight' => '',
|
541 |
-
'
|
|
|
542 |
'edit_field_class' => ''
|
543 |
),
|
544 |
array(
|
@@ -549,11 +564,11 @@ function auxin_get_recent_posts_master_array( $master_array ) {
|
|
549 |
'value' => '1',
|
550 |
'class' => '',
|
551 |
'dependency' => array(
|
552 |
-
'element'
|
553 |
-
'value'
|
554 |
),
|
555 |
'weight' => '',
|
556 |
-
'group' => ''
|
557 |
'edit_field_class' => ''
|
558 |
),
|
559 |
array(
|
@@ -563,13 +578,13 @@ function auxin_get_recent_posts_master_array( $master_array ) {
|
|
563 |
'type' => 'aux_switch',
|
564 |
'value' => '0',
|
565 |
'class' => '',
|
566 |
-
'admin_label' =>
|
567 |
'dependency' => array(
|
568 |
-
'element'
|
569 |
-
'value'
|
570 |
),
|
571 |
'weight' => '',
|
572 |
-
'group' => ''
|
573 |
'edit_field_class' => ''
|
574 |
),
|
575 |
array(
|
@@ -578,22 +593,15 @@ function auxin_get_recent_posts_master_array( $master_array ) {
|
|
578 |
'param_name' => 'carousel_autoplay_delay',
|
579 |
'type' => 'textfield',
|
580 |
'value' => '2',
|
581 |
-
'holder' => '
|
582 |
'class' => 'excerpt_len',
|
583 |
-
'admin_label' =>
|
584 |
'dependency' => array(
|
585 |
-
|
586 |
-
|
587 |
-
'value' => 'carousel'
|
588 |
-
)
|
589 |
-
/*,
|
590 |
-
array(
|
591 |
-
'element' => 'carousel_autoplay',
|
592 |
-
'value' => '1'
|
593 |
-
)*/
|
594 |
),
|
595 |
'weight' => '',
|
596 |
-
'group' => ''
|
597 |
'edit_field_class' => ''
|
598 |
),
|
599 |
array(
|
@@ -603,9 +611,9 @@ function auxin_get_recent_posts_master_array( $master_array ) {
|
|
603 |
'type' => 'textfield',
|
604 |
'value' => '',
|
605 |
'def_value' => '',
|
606 |
-
'holder' => '
|
607 |
'class' => 'extra_classes',
|
608 |
-
'admin_label' =>
|
609 |
'dependency' => '',
|
610 |
'weight' => '',
|
611 |
'group' => '',
|
@@ -640,24 +648,27 @@ function auxin_widget_recent_posts_callback( $atts, $shortcode_content = null ){
|
|
640 |
'cat' => ' ',
|
641 |
'num' => '8', // max generated entry
|
642 |
'ignore_media' => false, // whether to ignore media for this
|
643 |
-
'
|
644 |
-
'include' => '',
|
|
|
645 |
'offset' => '',
|
646 |
'paged' => '',
|
647 |
'post_type' => 'post',
|
648 |
'taxonomy_name' => 'category', // the taxonomy that we intent to display in post info
|
649 |
-
'order_by' => '
|
650 |
-
'order' => '
|
|
|
651 |
'exclude_without_media' => 0,
|
652 |
'exclude_custom_post_formats' => 0,
|
653 |
'exclude_quote_link' => 0,
|
654 |
'exclude_post_formats_in' => array(), // the list od post formats to exclude
|
|
|
|
|
655 |
'show_media' => true,
|
656 |
'display_like' => true,
|
657 |
'display_categories' => true,
|
658 |
'content_layout' => '', // entry-boxed
|
659 |
'excerpt_len' => '160',
|
660 |
-
'display_title' => true,
|
661 |
'show_excerpt' => true,
|
662 |
'show_info' => true,
|
663 |
'show_date' => true,
|
@@ -670,6 +681,7 @@ function auxin_widget_recent_posts_callback( $atts, $shortcode_content = null ){
|
|
670 |
'preview_mode' => 'grid',
|
671 |
'grid_table_hover' => 'bgimage-bgcolor',
|
672 |
'tag' => '',
|
|
|
673 |
'extra_classes' => '',
|
674 |
'extra_column_classes' => '',
|
675 |
'custom_el_id' => '',
|
@@ -679,6 +691,10 @@ function auxin_widget_recent_posts_callback( $atts, $shortcode_content = null ){
|
|
679 |
'carousel_navigation' => 'peritem',
|
680 |
'carousel_navigation_control' => 'arrows',
|
681 |
'carousel_loop' => 1,
|
|
|
|
|
|
|
|
|
682 |
'reset_query' => true,
|
683 |
'use_wp_query' => false, // true to use the global wp_query, false to use internal custom query
|
684 |
'custom_wp_query' => '',
|
@@ -727,59 +743,35 @@ function auxin_widget_recent_posts_callback( $atts, $shortcode_content = null ){
|
|
727 |
|
728 |
} else if( ! $use_wp_query ){
|
729 |
|
730 |
-
// create wp_query to get latest items
|
731 |
$args = array(
|
732 |
-
'post_type'
|
733 |
-
'orderby'
|
734 |
-
'order'
|
735 |
-
'offset'
|
736 |
-
'paged'
|
737 |
-
'cat'
|
738 |
-
'
|
739 |
-
'
|
740 |
-
'
|
741 |
-
|
742 |
-
'
|
|
|
|
|
|
|
|
|
|
|
743 |
);
|
744 |
|
|
|
|
|
745 |
// add the additional query args if available
|
746 |
if( $wp_query_args ){
|
747 |
-
$args = wp_parse_args( $
|
748 |
-
}
|
749 |
-
|
750 |
-
// exclude post formats if required
|
751 |
-
if( ! empty( $exclude_post_formats_in ) ){
|
752 |
-
|
753 |
-
// generate post-format terms (i.e post-format-aside)
|
754 |
-
$post_format_terms = array();
|
755 |
-
foreach ( $exclude_post_formats_in as $_post_format ) {
|
756 |
-
$post_format_terms[] = 'post-format-' . $_post_format;
|
757 |
-
}
|
758 |
-
|
759 |
-
// exclude the redundant taxonomies (post-format)
|
760 |
-
$args['tax_query'] = array(
|
761 |
-
array(
|
762 |
-
'taxonomy' => 'post_format',
|
763 |
-
'field' => 'slug',
|
764 |
-
'terms' => $post_format_terms,
|
765 |
-
'operator' => 'NOT IN'
|
766 |
-
)
|
767 |
-
);
|
768 |
-
|
769 |
-
}
|
770 |
-
|
771 |
-
// whether to exclude posts without featured-image or not
|
772 |
-
if( $exclude_without_media ){
|
773 |
-
$args['meta_query'] = array(
|
774 |
-
array(
|
775 |
-
'key' => '_thumbnail_id',
|
776 |
-
'value' => '',
|
777 |
-
'compare' => '!='
|
778 |
-
)
|
779 |
-
);
|
780 |
}
|
781 |
|
782 |
-
|
|
|
783 |
}
|
784 |
|
785 |
// widget header ------------------------------
|
@@ -922,7 +914,7 @@ function auxin_widget_recent_posts_callback( $atts, $shortcode_content = null ){
|
|
922 |
|
923 |
}
|
924 |
printf( '<div class="%s post-%s">', $item_class, $post->ID );
|
925 |
-
include
|
926 |
echo "</div>";
|
927 |
}
|
928 |
|
54 |
'params' => array(
|
55 |
array(
|
56 |
'heading' => __('Title','auxin-elements' ),
|
57 |
+
'description' => __('Recent post title, leave it empty if you don`t need title.', 'auxin-elements'),
|
58 |
'param_name' => 'title',
|
59 |
'type' => 'textfield',
|
|
|
60 |
'value' => '',
|
61 |
'holder' => 'textfield',
|
62 |
'class' => 'title',
|
63 |
+
'admin_label' => false,
|
64 |
'dependency' => '',
|
65 |
'weight' => '',
|
66 |
+
'group' => '',
|
67 |
'edit_field_class' => ''
|
68 |
),
|
69 |
array(
|
70 |
'heading' => __('Categories', 'auxin-elements'),
|
71 |
'description' => __('Specifies a category that you want to show posts from it.', 'auxin-elements' ),
|
72 |
'param_name' => 'cat',
|
73 |
+
'type' => 'aux_select2_multiple',
|
74 |
'def_value' => ' ',
|
75 |
+
'holder' => '',
|
76 |
'class' => 'cat',
|
77 |
'value' => $categories_list,
|
78 |
+
'admin_label' => false,
|
79 |
'dependency' => '',
|
80 |
'weight' => '',
|
81 |
+
'group' => 'Query',
|
82 |
'edit_field_class' => ''
|
83 |
),
|
84 |
array(
|
86 |
'description' => '',
|
87 |
'param_name' => 'num',
|
88 |
'type' => 'textfield',
|
89 |
+
'value' => '8',
|
90 |
+
'holder' => '',
|
91 |
'class' => 'num',
|
92 |
+
'admin_label' => false,
|
93 |
'dependency' => '',
|
94 |
'weight' => '',
|
95 |
+
'group' => 'Query',
|
96 |
+
'edit_field_class' => ''
|
97 |
+
),
|
98 |
+
array(
|
99 |
+
'heading' => __('Image aspect ratio', 'auxin-elements'),
|
100 |
+
'description' => '',
|
101 |
+
'param_name' => 'image_aspect_ratio',
|
102 |
+
'type' => 'dropdown',
|
103 |
+
'def_value' => '0.75',
|
104 |
+
'holder' => '',
|
105 |
+
'class' => 'order',
|
106 |
+
'value' =>array (
|
107 |
+
'0.75' => __('Horizontal 4:3' , 'auxin-elements'),
|
108 |
+
'0.56' => __('Horizontal 16:9', 'auxin-elements'),
|
109 |
+
'1.00' => __('Square 1:1' , 'auxin-elements'),
|
110 |
+
'1.33' => __('Vertical 3:4' , 'auxin-elements')
|
111 |
+
),
|
112 |
+
'admin_label' => false,
|
113 |
+
'dependency' => '',
|
114 |
+
'weight' => '',
|
115 |
+
'group' => '',
|
116 |
'edit_field_class' => ''
|
117 |
),
|
118 |
array(
|
122 |
'type' => 'aux_switch',
|
123 |
'value' => '0',
|
124 |
'class' => '',
|
125 |
+
'admin_label' => false,
|
126 |
'dependency' => '',
|
127 |
'weight' => '',
|
128 |
+
'group' => 'Query',
|
129 |
'edit_field_class' => ''
|
130 |
),
|
131 |
array(
|
132 |
+
'heading' => __('Exclude custom post formats','auxin-elements' ),
|
133 |
'description' => '',
|
134 |
'param_name' => 'exclude_custom_post_formats',
|
135 |
'type' => 'aux_switch',
|
136 |
'value' => '0',
|
137 |
'class' => '',
|
138 |
+
'admin_label' => false,
|
139 |
'dependency' => '',
|
140 |
'weight' => '',
|
141 |
+
'group' => 'Query',
|
142 |
'edit_field_class' => ''
|
143 |
),
|
144 |
array(
|
148 |
'type' => 'aux_switch',
|
149 |
'value' => '0',
|
150 |
'class' => '',
|
151 |
+
'admin_label' => false,
|
152 |
'dependency' => array(
|
153 |
'element' => 'exclude_custom_post_formats',
|
154 |
'value' => array('0', 'false')
|
155 |
),
|
156 |
'weight' => '',
|
157 |
+
'group' => '',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
'edit_field_class' => ''
|
159 |
),
|
160 |
+
array(
|
161 |
+
'heading' => __('Order by', 'auxin-elements'),
|
162 |
+
'description' => '',
|
163 |
+
'param_name' => 'order_by',
|
164 |
+
'type' => 'dropdown',
|
165 |
+
'def_value' => 'date',
|
166 |
+
'holder' => '',
|
167 |
+
'class' => 'order_by',
|
168 |
+
'value' => array (
|
169 |
'date' => __('Date', 'auxin-elements'),
|
170 |
'menu_order date' => __('Menu Order', 'auxin-elements'),
|
171 |
'title' => __('Title', 'auxin-elements'),
|
174 |
'comment_count' => __('Comments', 'auxin-elements'),
|
175 |
'modified' => __('Date Modified', 'auxin-elements'),
|
176 |
'author' => __('Author', 'auxin-elements'),
|
177 |
+
'post__in' => __('Inserted Post IDs', 'auxin-elements')
|
178 |
),
|
179 |
+
'admin_label' => false,
|
180 |
'dependency' => '',
|
181 |
'weight' => '',
|
182 |
+
'group' => 'Query',
|
183 |
'edit_field_class' => ''
|
184 |
),
|
185 |
array(
|
188 |
'param_name' => 'order',
|
189 |
'type' => 'dropdown',
|
190 |
'def_value' => 'DESC',
|
191 |
+
'holder' => '',
|
192 |
'class' => 'order',
|
193 |
'value' =>array (
|
194 |
'DESC' => __('Descending', 'auxin-elements'),
|
195 |
'ASC' => __('Ascending', 'auxin-elements'),
|
196 |
),
|
197 |
+
'admin_label' => false,
|
198 |
'dependency' => '',
|
199 |
'weight' => '',
|
200 |
+
'group' => 'Query',
|
201 |
'edit_field_class' => ''
|
202 |
),
|
203 |
array(
|
204 |
+
'heading' => __('Only posts','auxin-elements' ),
|
205 |
+
'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' ),
|
206 |
+
'param_name' => 'only_posts__in',
|
207 |
+
'type' => 'textfield',
|
208 |
+
'value' => '',
|
209 |
+
'holder' => '',
|
210 |
+
'class' => '',
|
211 |
+
'admin_label' => false,
|
212 |
+
'dependency' => '',
|
213 |
+
'weight' => '',
|
214 |
+
'group' => 'Query',
|
215 |
'edit_field_class' => ''
|
216 |
),
|
217 |
array(
|
218 |
+
'heading' => __('Include posts','auxin-elements' ),
|
219 |
+
'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' ),
|
220 |
+
'param_name' => 'include',
|
221 |
+
'type' => 'textfield',
|
222 |
+
'value' => '',
|
223 |
+
'holder' => '',
|
224 |
+
'class' => '',
|
225 |
+
'admin_label' => false,
|
226 |
+
'dependency' => '',
|
227 |
+
'weight' => '',
|
228 |
+
'group' => 'Query',
|
229 |
+
'edit_field_class' => ''
|
230 |
+
),
|
231 |
+
array(
|
232 |
+
'heading' => __('Exclude posts','auxin-elements' ),
|
233 |
+
'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' ),
|
234 |
+
'param_name' => 'exclude',
|
235 |
+
'type' => 'textfield',
|
236 |
+
'value' => '',
|
237 |
+
'holder' => '',
|
238 |
+
'class' => '',
|
239 |
+
'admin_label' => false,
|
240 |
'dependency' => '',
|
241 |
'weight' => '',
|
242 |
+
'group' => 'Query',
|
243 |
+
'edit_field_class' => ''
|
244 |
+
),
|
245 |
+
array(
|
246 |
+
'heading' => __('Start offset','auxin-elements' ),
|
247 |
+
'description' => __('Number of post to displace or pass over.', 'auxin-elements' ),
|
248 |
+
'param_name' => 'offset',
|
249 |
+
'type' => 'textfield',
|
250 |
+
'value' => '',
|
251 |
+
'holder' => '',
|
252 |
+
'class' => '',
|
253 |
+
'admin_label' => false,
|
254 |
+
'dependency' => '',
|
255 |
+
'weight' => '',
|
256 |
+
'group' => 'Query',
|
257 |
'edit_field_class' => ''
|
258 |
),
|
259 |
array(
|
262 |
'type' => 'aux_switch',
|
263 |
'def_value' => '',
|
264 |
'value' => '1',
|
265 |
+
'holder' => '',
|
266 |
'class' => 'show_media',
|
267 |
+
'admin_label' => false,
|
268 |
'dependency' => '',
|
269 |
'weight' => '',
|
270 |
+
'group' => '',
|
271 |
'edit_field_class' => ''
|
272 |
),
|
273 |
array(
|
277 |
'type' => 'aux_switch',
|
278 |
'value' => '1',
|
279 |
'class' => 'display_title',
|
280 |
+
'admin_label' => false,
|
281 |
'dependency' => '',
|
282 |
'weight' => '',
|
283 |
+
'group' => '',
|
284 |
'edit_field_class' => ''
|
285 |
),
|
286 |
array(
|
290 |
'type' => 'aux_switch',
|
291 |
'value' => '1',
|
292 |
'class' => '',
|
293 |
+
'admin_label' => false,
|
294 |
'weight' => '',
|
295 |
+
'group' => '',
|
296 |
'edit_field_class' => ''
|
297 |
),
|
298 |
array(
|
301 |
'param_name' => 'post_info_position',
|
302 |
'type' => 'dropdown',
|
303 |
'def_value' => 'after-title',
|
304 |
+
'holder' => '',
|
305 |
'class' => 'post_info_position',
|
306 |
'value' => array (
|
307 |
+
'after-title' => __('After Title' , 'auxin-elements' ),
|
308 |
+
'before-title' => __('Before Title', 'auxin-elements' )
|
309 |
),
|
310 |
+
'admin_label' => false,
|
311 |
'dependency' => array(
|
312 |
+
'element' => 'show_info',
|
313 |
+
'value' => '1'
|
314 |
),
|
315 |
'weight' => '',
|
316 |
+
'group' => '',
|
317 |
'edit_field_class' => ''
|
318 |
),
|
319 |
array(
|
322 |
'param_name' => 'display_categories',
|
323 |
'type' => 'aux_switch',
|
324 |
'value' => '1',
|
325 |
+
'holder' => '',
|
326 |
'class' => 'display_categories',
|
327 |
+
'admin_label' => false,
|
328 |
'dependency' => array(
|
329 |
+
'element' => 'show_info',
|
330 |
+
'value' => '1'
|
331 |
),
|
332 |
'weight' => '',
|
333 |
+
'group' => '',
|
334 |
'edit_field_class' => ''
|
335 |
),
|
336 |
array(
|
339 |
'param_name' => 'display_like',
|
340 |
'type' => 'aux_switch',
|
341 |
'value' => '1',
|
342 |
+
'holder' => '',
|
343 |
'class' => 'display_like',
|
344 |
+
'admin_label' => false,
|
345 |
'dependency' => '',
|
346 |
'weight' => '',
|
347 |
+
'group' => '',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
348 |
'edit_field_class' => ''
|
349 |
),
|
350 |
array(
|
353 |
'param_name' => 'excerpt_len',
|
354 |
'type' => 'textfield',
|
355 |
'value' => '160',
|
356 |
+
'holder' => '',
|
357 |
'class' => 'excerpt_len',
|
358 |
+
'admin_label' => false,
|
359 |
'dependency' => '',
|
360 |
'weight' => '',
|
361 |
+
'group' => '',
|
362 |
'edit_field_class' => ''
|
363 |
),
|
364 |
array(
|
367 |
'param_name' => 'author_or_readmore',
|
368 |
'type' => 'dropdown',
|
369 |
'def_value' => 'readmore',
|
370 |
+
'holder' => '',
|
371 |
'class' => 'author_or_readmore',
|
372 |
'value' =>array (
|
373 |
+
'readmore' => __( 'Read More' , 'auxin-elements' ),
|
374 |
+
'author' => __( 'Author Name', 'auxin-elements' ),
|
375 |
+
'none' => __( 'None' , 'auxin-elements' )
|
376 |
),
|
377 |
+
'admin_label' => false,
|
378 |
'dependency' => '',
|
379 |
'weight' => '',
|
380 |
+
'group' => '',
|
381 |
'edit_field_class' => ''
|
382 |
),
|
383 |
array(
|
384 |
+
'heading' => __('Number of columns', 'auxin-elements'),
|
385 |
+
'description' => '',
|
386 |
+
'param_name' => 'desktop_cnum',
|
387 |
+
'type' => 'dropdown',
|
388 |
+
'def_value' => '4',
|
389 |
+
'holder' => '',
|
390 |
+
'class' => 'num',
|
391 |
+
'value' => array(
|
392 |
'1' => '1', '2' => '2', '3' => '3',
|
393 |
'4' => '4', '5' => '5', '6' => '6'
|
394 |
),
|
395 |
+
'admin_label' => false,
|
396 |
'dependency' => '',
|
397 |
'weight' => '',
|
398 |
+
'group' => 'Layout',
|
399 |
'edit_field_class' => ''
|
400 |
),
|
401 |
array(
|
402 |
+
'heading' => __('Number of columns in tablet size', 'auxin-elements'),
|
403 |
+
'description' => '',
|
404 |
+
'param_name' => 'tablet_cnum',
|
405 |
+
'type' => 'dropdown',
|
406 |
+
'def_value' => 'inherit',
|
407 |
+
'holder' => '',
|
408 |
+
'class' => 'num',
|
409 |
+
'value' => array(
|
410 |
'inherit' => 'Inherited from larger',
|
411 |
'1' => '1', '2' => '2', '3' => '3',
|
412 |
'4' => '4', '5' => '5', '6' => '6'
|
413 |
),
|
414 |
+
'admin_label' => false,
|
415 |
'dependency' => '',
|
416 |
'weight' => '',
|
417 |
+
'group' => 'Layout',
|
418 |
'edit_field_class' => ''
|
419 |
),
|
420 |
array(
|
421 |
+
'heading' => __('Number of columns in phone size', 'auxin-elements'),
|
422 |
+
'description' => '',
|
423 |
+
'param_name' => 'phone_cnum',
|
424 |
+
'type' => 'dropdown',
|
425 |
+
'def_value' => '1',
|
426 |
+
'holder' => '',
|
427 |
+
'class' => 'num',
|
428 |
+
'value' => array(
|
429 |
'1' => '1', '2' => '2', '3' => '3'
|
430 |
),
|
431 |
+
'admin_label' => false,
|
432 |
'dependency' => '',
|
433 |
'weight' => '',
|
434 |
+
'group' => 'Layout',
|
435 |
'edit_field_class' => ''
|
436 |
),
|
437 |
array(
|
438 |
+
'heading' => __('Display items as', 'auxin-elements'),
|
439 |
+
'description' => '',
|
440 |
+
'param_name' => 'preview_mode',
|
441 |
+
'type' => 'dropdown',
|
442 |
+
'def_value' => 'grid',
|
443 |
+
'holder' => 'textfield',
|
444 |
+
'class' => 'num',
|
445 |
+
'value' => array(
|
446 |
+
'grid' => __( 'Grid', 'auxin-elements' ),
|
447 |
+
'grid-table' => __( 'Grid - Table Style', 'auxin-elements' ),
|
448 |
+
'carousel' => __( 'Carousel', 'auxin-elements' )
|
449 |
),
|
450 |
+
'admin_label' => false,
|
451 |
'dependency' => '',
|
452 |
'weight' => '',
|
453 |
+
'group' => '',
|
454 |
'edit_field_class' => ''
|
455 |
),
|
456 |
array(
|
457 |
+
'heading' => __('Content layout', 'auxin-elements'),
|
458 |
+
'description' => __('Specifies the style of content for each post column.', 'auxin-elements' ),
|
459 |
+
'param_name' => 'content_layout',
|
460 |
+
'type' => 'dropdown',
|
461 |
+
'def_value' => 'default',
|
462 |
+
'holder' => '',
|
463 |
+
'class' => 'content_layout',
|
464 |
+
'value' =>array (
|
465 |
+
'default' => __('Full Content', 'auxin-elements'),
|
466 |
+
'entry-boxed' => __('Boxed Content', 'auxin-elements')
|
467 |
+
),
|
468 |
+
'admin_label' => false,
|
469 |
+
'dependency' => '',
|
470 |
+
'weight' => '',
|
471 |
+
'group' => '',
|
472 |
+
'edit_field_class' => ''
|
473 |
+
),
|
474 |
+
array(
|
475 |
+
'heading' => __('Mouse Over Effect', 'auxin-elements'),
|
476 |
+
'description' => '',
|
477 |
+
'param_name' => 'grid_table_hover',
|
478 |
+
'type' => 'dropdown',
|
479 |
+
'def_value' => 'bgimage-bgcolor',
|
480 |
+
'holder' => '',
|
481 |
+
'class' => 'num',
|
482 |
+
'value' => array(
|
483 |
'bgcolor' => __( 'Background color', 'auxin-elements' ),
|
484 |
'bgimage' => __( 'Cover image', 'auxin-elements' ),
|
485 |
'bgimage-bgcolor' => __( 'Cover image or background color', 'auxin-elements' ),
|
486 |
'none' => __( 'Nothing', 'auxin-elements' )
|
487 |
),
|
488 |
+
'admin_label' => false,
|
489 |
'dependency' => array(
|
490 |
+
'element' => 'preview_mode',
|
491 |
+
'value' => 'grid-table'
|
492 |
),
|
493 |
'weight' => '',
|
494 |
+
'group' => '',
|
495 |
'edit_field_class' => ''
|
496 |
),
|
497 |
// Carousel Options
|
501 |
'param_name' => 'carousel_space',
|
502 |
'type' => 'textfield',
|
503 |
'value' => '30',
|
504 |
+
'holder' => '',
|
505 |
'class' => 'excerpt_len',
|
506 |
+
'admin_label' => false,
|
507 |
'dependency' => array(
|
508 |
+
'element' => 'preview_mode',
|
509 |
+
'value' => 'grid'
|
510 |
),
|
511 |
'weight' => '',
|
512 |
+
'group' => '',
|
513 |
'edit_field_class' => ''
|
514 |
),
|
515 |
array(
|
516 |
+
'heading' => __('Navigation type', 'auxin-elements'),
|
517 |
+
'description' => '',
|
518 |
+
'param_name' => 'carousel_navigation',
|
519 |
+
'type' => 'dropdown',
|
520 |
+
'def_value' => 'peritem',
|
521 |
+
'holder' => '',
|
522 |
+
'class' => 'num',
|
523 |
+
'value' => array(
|
524 |
+
'peritem' => __('Move per column', 'auxin-elements'),
|
525 |
+
'perpage' => __('Move per page', 'auxin-elements'),
|
526 |
+
'scroll' => __('Smooth scroll', 'auxin-elements'),
|
527 |
),
|
528 |
+
'admin_label' => false,
|
529 |
'dependency' => array(
|
530 |
+
'element' => 'preview_mode',
|
531 |
+
'value' => 'carousel'
|
532 |
),
|
533 |
'weight' => '',
|
534 |
+
'group' => 'Carousel',
|
535 |
'edit_field_class' => ''
|
536 |
),
|
537 |
array(
|
538 |
+
'heading' => __('Navigation control', 'auxin-elements'),
|
539 |
+
'description' => '',
|
540 |
+
'param_name' => 'carousel_navigation_control',
|
541 |
+
'type' => 'dropdown',
|
542 |
+
'def_value' => 'arrows',
|
543 |
+
'holder' => '',
|
544 |
+
'class' => 'num',
|
545 |
+
'value' => array(
|
546 |
+
'arrows' => __('Arrows', 'auxin-elements'),
|
547 |
+
'bullets' => __('Bullets', 'auxin-elements'),
|
548 |
+
'' => __('None', 'auxin-elements'),
|
549 |
),
|
550 |
'dependency' => array(
|
551 |
+
'element' => 'preview_mode',
|
552 |
+
'value' => 'carousel'
|
553 |
),
|
554 |
'weight' => '',
|
555 |
+
'admin_label' => false,
|
556 |
+
'group' => 'Carousel',
|
557 |
'edit_field_class' => ''
|
558 |
),
|
559 |
array(
|
564 |
'value' => '1',
|
565 |
'class' => '',
|
566 |
'dependency' => array(
|
567 |
+
'element' => 'preview_mode',
|
568 |
+
'value' => 'carousel'
|
569 |
),
|
570 |
'weight' => '',
|
571 |
+
'group' => 'Carousel',
|
572 |
'edit_field_class' => ''
|
573 |
),
|
574 |
array(
|
578 |
'type' => 'aux_switch',
|
579 |
'value' => '0',
|
580 |
'class' => '',
|
581 |
+
'admin_label' => false,
|
582 |
'dependency' => array(
|
583 |
+
'element' => 'preview_mode',
|
584 |
+
'value' => 'carousel'
|
585 |
),
|
586 |
'weight' => '',
|
587 |
+
'group' => 'Carousel',
|
588 |
'edit_field_class' => ''
|
589 |
),
|
590 |
array(
|
593 |
'param_name' => 'carousel_autoplay_delay',
|
594 |
'type' => 'textfield',
|
595 |
'value' => '2',
|
596 |
+
'holder' => '',
|
597 |
'class' => 'excerpt_len',
|
598 |
+
'admin_label' => false,
|
599 |
'dependency' => array(
|
600 |
+
'element' => 'preview_mode',
|
601 |
+
'value' => 'carousel'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
602 |
),
|
603 |
'weight' => '',
|
604 |
+
'group' => 'Carousel',
|
605 |
'edit_field_class' => ''
|
606 |
),
|
607 |
array(
|
611 |
'type' => 'textfield',
|
612 |
'value' => '',
|
613 |
'def_value' => '',
|
614 |
+
'holder' => '',
|
615 |
'class' => 'extra_classes',
|
616 |
+
'admin_label' => false,
|
617 |
'dependency' => '',
|
618 |
'weight' => '',
|
619 |
'group' => '',
|
648 |
'cat' => ' ',
|
649 |
'num' => '8', // max generated entry
|
650 |
'ignore_media' => false, // whether to ignore media for this
|
651 |
+
'only_posts__in' => '', // display only these post IDs. array or string comma separated
|
652 |
+
'include' => '', // include these post IDs in result too. array or string comma separated
|
653 |
+
'exclude' => '', // exclude these post IDs from result. array or string comma separated
|
654 |
'offset' => '',
|
655 |
'paged' => '',
|
656 |
'post_type' => 'post',
|
657 |
'taxonomy_name' => 'category', // the taxonomy that we intent to display in post info
|
658 |
+
'order_by' => 'date',
|
659 |
+
'order' => 'DESC',
|
660 |
+
|
661 |
'exclude_without_media' => 0,
|
662 |
'exclude_custom_post_formats' => 0,
|
663 |
'exclude_quote_link' => 0,
|
664 |
'exclude_post_formats_in' => array(), // the list od post formats to exclude
|
665 |
+
|
666 |
+
'display_title' => true,
|
667 |
'show_media' => true,
|
668 |
'display_like' => true,
|
669 |
'display_categories' => true,
|
670 |
'content_layout' => '', // entry-boxed
|
671 |
'excerpt_len' => '160',
|
|
|
672 |
'show_excerpt' => true,
|
673 |
'show_info' => true,
|
674 |
'show_date' => true,
|
681 |
'preview_mode' => 'grid',
|
682 |
'grid_table_hover' => 'bgimage-bgcolor',
|
683 |
'tag' => '',
|
684 |
+
|
685 |
'extra_classes' => '',
|
686 |
'extra_column_classes' => '',
|
687 |
'custom_el_id' => '',
|
691 |
'carousel_navigation' => 'peritem',
|
692 |
'carousel_navigation_control' => 'arrows',
|
693 |
'carousel_loop' => 1,
|
694 |
+
|
695 |
+
'template_part_file' => 'theme-parts/entry/post-column',
|
696 |
+
'extra_template_path' => '',
|
697 |
+
|
698 |
'reset_query' => true,
|
699 |
'use_wp_query' => false, // true to use the global wp_query, false to use internal custom query
|
700 |
'custom_wp_query' => '',
|
743 |
|
744 |
} else if( ! $use_wp_query ){
|
745 |
|
746 |
+
// create wp_query to get latest items ---------------------------------
|
747 |
$args = array(
|
748 |
+
'post_type' => $post_type,
|
749 |
+
'orderby' => $order_by,
|
750 |
+
'order' => $order,
|
751 |
+
'offset' => $offset,
|
752 |
+
'paged' => $paged,
|
753 |
+
'cat' => $cat,
|
754 |
+
'post_status' => 'publish',
|
755 |
+
'posts_per_page' => $num,
|
756 |
+
'ignore_sticky_posts' => 1,
|
757 |
+
|
758 |
+
'include_posts__in' => $include, // include posts in this list
|
759 |
+
'posts__not_in' => $exclude, // exclude posts in this list
|
760 |
+
'posts__in' => $only_posts__in, // only posts in this list
|
761 |
+
|
762 |
+
'exclude_without_media' => $exclude_without_media,
|
763 |
+
'exclude_post_formats_in' => $exclude_post_formats_in
|
764 |
);
|
765 |
|
766 |
+
// ---------------------------------------------------------------------
|
767 |
+
|
768 |
// add the additional query args if available
|
769 |
if( $wp_query_args ){
|
770 |
+
$args = wp_parse_args( $wp_query_args, $args );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
771 |
}
|
772 |
|
773 |
+
// pass the args through the auxin query parser
|
774 |
+
$wp_query = new WP_Query( auxin_parse_query_args( $args ) );
|
775 |
}
|
776 |
|
777 |
// widget header ------------------------------
|
914 |
|
915 |
}
|
916 |
printf( '<div class="%s post-%s">', $item_class, $post->ID );
|
917 |
+
include auxin_get_template_file( $template_part_file, '', $extra_template_path );
|
918 |
echo "</div>";
|
919 |
}
|
920 |
|
includes/elements/recent-posts-land-style.php
CHANGED
@@ -61,25 +61,25 @@ function auxin_get_recent_posts_land_master_array( $master_array ) {
|
|
61 |
'value' => '',
|
62 |
'holder' => 'textfield',
|
63 |
'class' => 'title',
|
64 |
-
'admin_label' =>
|
65 |
'dependency' => '',
|
66 |
'weight' => '',
|
67 |
-
'group' => ''
|
68 |
'edit_field_class' => ''
|
69 |
),
|
70 |
array(
|
71 |
'heading' => __('Categories', 'auxin-elements'),
|
72 |
'description' => __('Specifies a category that you want to show posts from it.', 'auxin-elements' ),
|
73 |
'param_name' => 'cat',
|
74 |
-
'type' => '
|
75 |
'def_value' => ' ',
|
76 |
-
'holder' => '
|
77 |
'class' => 'cat',
|
78 |
'value' => $categories_list,
|
79 |
-
'admin_label' =>
|
80 |
'dependency' => '',
|
81 |
'weight' => '',
|
82 |
-
'group' => ''
|
83 |
'edit_field_class' => ''
|
84 |
),
|
85 |
array(
|
@@ -87,13 +87,33 @@ function auxin_get_recent_posts_land_master_array( $master_array ) {
|
|
87 |
'description' => '',
|
88 |
'param_name' => 'num',
|
89 |
'type' => 'textfield',
|
90 |
-
'
|
91 |
-
'holder' => '
|
92 |
'class' => 'num',
|
93 |
-
'admin_label' =>
|
94 |
'dependency' => '',
|
95 |
'weight' => '',
|
96 |
-
'group' => ''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
'edit_field_class' => ''
|
98 |
),
|
99 |
array(
|
@@ -103,10 +123,10 @@ function auxin_get_recent_posts_land_master_array( $master_array ) {
|
|
103 |
'type' => 'aux_switch',
|
104 |
'value' => '0',
|
105 |
'class' => '',
|
106 |
-
'admin_label' =>
|
107 |
'dependency' => '',
|
108 |
'weight' => '',
|
109 |
-
'group' => ''
|
110 |
'edit_field_class' => ''
|
111 |
),
|
112 |
array(
|
@@ -116,10 +136,10 @@ function auxin_get_recent_posts_land_master_array( $master_array ) {
|
|
116 |
'type' => 'aux_switch',
|
117 |
'value' => '0',
|
118 |
'class' => '',
|
119 |
-
'admin_label' =>
|
120 |
'dependency' => '',
|
121 |
'weight' => '',
|
122 |
-
'group' => ''
|
123 |
'edit_field_class' => ''
|
124 |
),
|
125 |
array(
|
@@ -129,41 +149,13 @@ function auxin_get_recent_posts_land_master_array( $master_array ) {
|
|
129 |
'type' => 'aux_switch',
|
130 |
'value' => '0',
|
131 |
'class' => '',
|
132 |
-
'admin_label' =>
|
133 |
'dependency' => array(
|
134 |
'element' => 'exclude_custom_post_formats',
|
135 |
'value' => array('0', 'false')
|
136 |
),
|
137 |
'weight' => '',
|
138 |
-
'group' => ''
|
139 |
-
'edit_field_class' => ''
|
140 |
-
),
|
141 |
-
array(
|
142 |
-
'heading' => __('Exclude posts','auxin-elements' ),
|
143 |
-
'description' => __('Post IDs separated by comma (eg. 53,34,87,25)', 'auxin-elements' ),
|
144 |
-
'param_name' => 'exclude',
|
145 |
-
'type' => 'textfield',
|
146 |
-
'value' => '',
|
147 |
-
'holder' => 'textfield',
|
148 |
-
'class' => '',
|
149 |
-
'admin_label' => true,
|
150 |
-
'dependency' => '',
|
151 |
-
'weight' => '',
|
152 |
-
'group' => '' ,
|
153 |
-
'edit_field_class' => ''
|
154 |
-
),
|
155 |
-
array(
|
156 |
-
'heading' => __('Include posts','auxin-elements' ),
|
157 |
-
'description' => __('Post IDs separated by comma (eg. 53,34,87,25)', 'auxin-elements' ),
|
158 |
-
'param_name' => 'include',
|
159 |
-
'type' => 'textfield',
|
160 |
-
'value' => '',
|
161 |
-
'holder' => 'textfield',
|
162 |
-
'class' => '',
|
163 |
-
'admin_label' => true,
|
164 |
-
'dependency' => '',
|
165 |
-
'weight' => '',
|
166 |
-
'group' => '' ,
|
167 |
'edit_field_class' => ''
|
168 |
),
|
169 |
array(
|
@@ -172,7 +164,7 @@ function auxin_get_recent_posts_land_master_array( $master_array ) {
|
|
172 |
'param_name' => 'order_by',
|
173 |
'type' => 'dropdown',
|
174 |
'def_value' => 'date',
|
175 |
-
'holder' => '
|
176 |
'class' => 'order_by',
|
177 |
'value' => array (
|
178 |
'date' => __('Date', 'auxin-elements'),
|
@@ -183,11 +175,12 @@ function auxin_get_recent_posts_land_master_array( $master_array ) {
|
|
183 |
'comment_count' => __('Comments', 'auxin-elements'),
|
184 |
'modified' => __('Date Modified', 'auxin-elements'),
|
185 |
'author' => __('Author', 'auxin-elements'),
|
|
|
186 |
),
|
187 |
-
'admin_label' =>
|
188 |
'dependency' => '',
|
189 |
'weight' => '',
|
190 |
-
'group' => ''
|
191 |
'edit_field_class' => ''
|
192 |
),
|
193 |
array(
|
@@ -196,50 +189,72 @@ function auxin_get_recent_posts_land_master_array( $master_array ) {
|
|
196 |
'param_name' => 'order',
|
197 |
'type' => 'dropdown',
|
198 |
'def_value' => 'DESC',
|
199 |
-
'holder' => '
|
200 |
'class' => 'order',
|
201 |
'value' =>array (
|
202 |
'DESC' => __('Descending', 'auxin-elements'),
|
203 |
'ASC' => __('Ascending', 'auxin-elements'),
|
204 |
),
|
205 |
-
'admin_label' =>
|
206 |
'dependency' => '',
|
207 |
'weight' => '',
|
208 |
-
'group' => ''
|
209 |
'edit_field_class' => ''
|
210 |
),
|
211 |
array(
|
212 |
-
'heading'
|
213 |
-
'description'
|
214 |
-
'param_name'
|
215 |
-
'type'
|
216 |
-
'value'
|
217 |
-
'holder'
|
218 |
-
'class'
|
219 |
-
'admin_label'
|
220 |
-
'dependency'
|
221 |
-
'weight'
|
222 |
-
'group'
|
223 |
'edit_field_class' => ''
|
224 |
),
|
225 |
array(
|
226 |
-
'heading' => __('
|
227 |
-
'description' => '',
|
228 |
-
'param_name' => '
|
229 |
-
'type' => '
|
230 |
-
'
|
231 |
-
'holder' => '
|
232 |
-
'class' => '
|
233 |
-
'
|
234 |
-
'0.75' => __('Horizontal 4:3' , 'auxin-elements'),
|
235 |
-
'0.56' => __('Horizontal 16:9', 'auxin-elements'),
|
236 |
-
'1.00' => __('Square 1:1' , 'auxin-elements'),
|
237 |
-
'1.33' => __('Vertical 3:4' , 'auxin-elements')
|
238 |
-
),
|
239 |
-
'admin_label' => true,
|
240 |
'dependency' => '',
|
241 |
'weight' => '',
|
242 |
-
'group' => ''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
243 |
'edit_field_class' => ''
|
244 |
),
|
245 |
array(
|
@@ -248,32 +263,12 @@ function auxin_get_recent_posts_land_master_array( $master_array ) {
|
|
248 |
'type' => 'aux_switch',
|
249 |
'def_value' => '',
|
250 |
'value' => '1',
|
251 |
-
'holder' => '
|
252 |
'class' => 'show_media',
|
253 |
-
'admin_label' =>
|
254 |
'dependency' => '',
|
255 |
'weight' => '',
|
256 |
-
'group' => ''
|
257 |
-
'edit_field_class' => ''
|
258 |
-
),
|
259 |
-
array(
|
260 |
-
'heading' => __('Image aspect ratio', 'auxin-elements'),
|
261 |
-
'description' => '',
|
262 |
-
'param_name' => 'image_aspect_ratio',
|
263 |
-
'type' => 'dropdown',
|
264 |
-
'def_value' => '0.75',
|
265 |
-
'holder' => 'dropdown',
|
266 |
-
'class' => 'order',
|
267 |
-
'value' =>array (
|
268 |
-
'0.75' => __('Horizontal 4:3' , 'auxin-elements'),
|
269 |
-
'0.56' => __('Horizontal 16:9', 'auxin-elements'),
|
270 |
-
'1.00' => __('Square 1:1' , 'auxin-elements'),
|
271 |
-
'1.33' => __('Vertical 3:4' , 'auxin-elements')
|
272 |
-
),
|
273 |
-
'admin_label' => true,
|
274 |
-
'dependency' => '',
|
275 |
-
'weight' => '',
|
276 |
-
'group' => '' ,
|
277 |
'edit_field_class' => ''
|
278 |
),
|
279 |
array(
|
@@ -283,10 +278,10 @@ function auxin_get_recent_posts_land_master_array( $master_array ) {
|
|
283 |
'type' => 'aux_switch',
|
284 |
'value' => '1',
|
285 |
'class' => 'display_title',
|
286 |
-
'admin_label' =>
|
287 |
'dependency' => '',
|
288 |
'weight' => '',
|
289 |
-
'group' => ''
|
290 |
'edit_field_class' => ''
|
291 |
),
|
292 |
array(
|
@@ -296,9 +291,9 @@ function auxin_get_recent_posts_land_master_array( $master_array ) {
|
|
296 |
'type' => 'aux_switch',
|
297 |
'value' => '1',
|
298 |
'class' => '',
|
299 |
-
'admin_label' =>
|
300 |
'weight' => '',
|
301 |
-
'group' => ''
|
302 |
'edit_field_class' => ''
|
303 |
),
|
304 |
array(
|
@@ -307,12 +302,12 @@ function auxin_get_recent_posts_land_master_array( $master_array ) {
|
|
307 |
'param_name' => 'display_like',
|
308 |
'type' => 'aux_switch',
|
309 |
'value' => '1',
|
310 |
-
'holder' => '
|
311 |
'class' => 'display_like',
|
312 |
-
'admin_label' =>
|
313 |
'dependency' => '',
|
314 |
'weight' => '',
|
315 |
-
'group' => ''
|
316 |
'edit_field_class' => ''
|
317 |
),
|
318 |
array(
|
@@ -321,15 +316,16 @@ function auxin_get_recent_posts_land_master_array( $master_array ) {
|
|
321 |
'param_name' => 'excerpt_len',
|
322 |
'type' => 'textfield',
|
323 |
'value' => '160',
|
324 |
-
'holder' => '
|
325 |
'class' => 'excerpt_len',
|
326 |
-
'admin_label' =>
|
|
|
327 |
'dependency' => array(
|
328 |
-
'element'
|
329 |
-
'value'
|
330 |
),
|
331 |
'weight' => '',
|
332 |
-
'group' => ''
|
333 |
'edit_field_class' => ''
|
334 |
),
|
335 |
array(
|
@@ -338,16 +334,16 @@ function auxin_get_recent_posts_land_master_array( $master_array ) {
|
|
338 |
'param_name' => 'author_or_readmore',
|
339 |
'type' => 'dropdown',
|
340 |
'def_value' => 'readmore',
|
341 |
-
'holder' => '
|
342 |
'class' => 'author_or_readmore',
|
343 |
'value' =>array (
|
344 |
-
'readmore'
|
345 |
-
'author'
|
346 |
),
|
347 |
-
'admin_label' =>
|
348 |
'dependency' => '',
|
349 |
'weight' => '',
|
350 |
-
'group' => ''
|
351 |
'edit_field_class' => ''
|
352 |
),
|
353 |
array(
|
@@ -357,9 +353,9 @@ function auxin_get_recent_posts_land_master_array( $master_array ) {
|
|
357 |
'type' => 'textfield',
|
358 |
'value' => '',
|
359 |
'def_value' => '',
|
360 |
-
'holder' => '
|
361 |
'class' => 'extra_classes',
|
362 |
-
'admin_label' =>
|
363 |
'dependency' => '',
|
364 |
'weight' => '',
|
365 |
'group' => '',
|
@@ -393,13 +389,14 @@ function auxin_widget_recent_posts_land_style_callback( $atts, $shortcode_conten
|
|
393 |
'title' => '', // header title
|
394 |
'cat' => ' ',
|
395 |
'num' => '8',
|
396 |
-
'
|
397 |
-
'include' => '',
|
|
|
398 |
'posts_per_page' => -1,
|
399 |
'paged' => '',
|
400 |
'offset' => '',
|
401 |
-
'order_by' => '
|
402 |
-
'order' => '
|
403 |
'exclude_without_media' => 0,
|
404 |
'exclude_custom_post_formats' => 0,
|
405 |
'exclude_quote_link' => 0,
|
@@ -418,12 +415,15 @@ function auxin_widget_recent_posts_land_style_callback( $atts, $shortcode_conten
|
|
418 |
'custom_el_id' => '',
|
419 |
'reset_query' => true,
|
420 |
'use_wp_query' => false, // true to use the global wp_query, false to use internal custom query
|
|
|
421 |
'base_class' => 'aux-widget-recent-posts-land'
|
422 |
);
|
423 |
|
|
|
424 |
$result = auxin_get_widget_scafold( $atts, $default_atts, $shortcode_content );
|
425 |
extract( $result['parsed_atts'] );
|
426 |
|
|
|
427 |
// get content width
|
428 |
global $aux_content_width;
|
429 |
|
@@ -459,52 +459,32 @@ function auxin_widget_recent_posts_land_style_callback( $atts, $shortcode_conten
|
|
459 |
|
460 |
// create wp_query to get latest items -----------
|
461 |
$args = array(
|
462 |
-
'post_type'
|
463 |
-
'orderby'
|
464 |
-
'order'
|
465 |
-
'offset'
|
466 |
-
'paged'
|
467 |
-
'cat'
|
468 |
-
'
|
469 |
-
'
|
470 |
-
'
|
471 |
-
'
|
472 |
-
'
|
|
|
|
|
|
|
|
|
473 |
);
|
474 |
|
475 |
-
//
|
476 |
-
if( ! empty( $exclude_post_formats_in ) ){
|
477 |
-
|
478 |
-
// generate post-format terms (i.e post-format-aside)
|
479 |
-
$post_format_terms = array();
|
480 |
-
foreach ( $exclude_post_formats_in as $_post_format ) {
|
481 |
-
$post_format_terms[] = 'post-format-' . $_post_format;
|
482 |
-
}
|
483 |
-
|
484 |
-
// exclude the redundant taxonomies (post-format)
|
485 |
-
$args['tax_query'] = array(
|
486 |
-
array(
|
487 |
-
'taxonomy' => 'post_format',
|
488 |
-
'field' => 'slug',
|
489 |
-
'terms' => $post_format_terms,
|
490 |
-
'operator' => 'NOT IN'
|
491 |
-
)
|
492 |
-
);
|
493 |
-
|
494 |
-
}
|
495 |
|
496 |
-
//
|
497 |
-
if( $
|
498 |
-
$args
|
499 |
-
array(
|
500 |
-
'key' => '_thumbnail_id',
|
501 |
-
'value' => '',
|
502 |
-
'compare' => '!='
|
503 |
-
)
|
504 |
-
);
|
505 |
}
|
506 |
|
507 |
-
|
|
|
508 |
}
|
509 |
|
510 |
// widget header ------------------------------
|
61 |
'value' => '',
|
62 |
'holder' => 'textfield',
|
63 |
'class' => 'title',
|
64 |
+
'admin_label' => false,
|
65 |
'dependency' => '',
|
66 |
'weight' => '',
|
67 |
+
'group' => '',
|
68 |
'edit_field_class' => ''
|
69 |
),
|
70 |
array(
|
71 |
'heading' => __('Categories', 'auxin-elements'),
|
72 |
'description' => __('Specifies a category that you want to show posts from it.', 'auxin-elements' ),
|
73 |
'param_name' => 'cat',
|
74 |
+
'type' => 'aux_select2_multiple',
|
75 |
'def_value' => ' ',
|
76 |
+
'holder' => '',
|
77 |
'class' => 'cat',
|
78 |
'value' => $categories_list,
|
79 |
+
'admin_label' => false,
|
80 |
'dependency' => '',
|
81 |
'weight' => '',
|
82 |
+
'group' => 'Query',
|
83 |
'edit_field_class' => ''
|
84 |
),
|
85 |
array(
|
87 |
'description' => '',
|
88 |
'param_name' => 'num',
|
89 |
'type' => 'textfield',
|
90 |
+
'value' => '8',
|
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' => __('Image aspect ratio', 'auxin-elements'),
|
101 |
+
'description' => '',
|
102 |
+
'param_name' => 'image_aspect_ratio',
|
103 |
+
'type' => 'dropdown',
|
104 |
+
'def_value' => '0.75',
|
105 |
+
'holder' => '',
|
106 |
+
'class' => 'order',
|
107 |
+
'value' =>array (
|
108 |
+
'0.75' => __('Horizontal 4:3' , 'auxin-elements'),
|
109 |
+
'0.56' => __('Horizontal 16:9', 'auxin-elements'),
|
110 |
+
'1.00' => __('Square 1:1' , 'auxin-elements'),
|
111 |
+
'1.33' => __('Vertical 3:4' , 'auxin-elements')
|
112 |
+
),
|
113 |
+
'admin_label' => false,
|
114 |
+
'dependency' => '',
|
115 |
+
'weight' => '',
|
116 |
+
'group' => '',
|
117 |
'edit_field_class' => ''
|
118 |
),
|
119 |
array(
|
123 |
'type' => 'aux_switch',
|
124 |
'value' => '0',
|
125 |
'class' => '',
|
126 |
+
'admin_label' => false,
|
127 |
'dependency' => '',
|
128 |
'weight' => '',
|
129 |
+
'group' => 'Query',
|
130 |
'edit_field_class' => ''
|
131 |
),
|
132 |
array(
|
136 |
'type' => 'aux_switch',
|
137 |
'value' => '0',
|
138 |
'class' => '',
|
139 |
+
'admin_label' => false,
|
140 |
'dependency' => '',
|
141 |
'weight' => '',
|
142 |
+
'group' => 'Query',
|
143 |
'edit_field_class' => ''
|
144 |
),
|
145 |
array(
|
149 |
'type' => 'aux_switch',
|
150 |
'value' => '0',
|
151 |
'class' => '',
|
152 |
+
'admin_label' => false,
|
153 |
'dependency' => array(
|
154 |
'element' => 'exclude_custom_post_formats',
|
155 |
'value' => array('0', 'false')
|
156 |
),
|
157 |
'weight' => '',
|
158 |
+
'group' => 'Query',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
'edit_field_class' => ''
|
160 |
),
|
161 |
array(
|
164 |
'param_name' => 'order_by',
|
165 |
'type' => 'dropdown',
|
166 |
'def_value' => 'date',
|
167 |
+
'holder' => '',
|
168 |
'class' => 'order_by',
|
169 |
'value' => array (
|
170 |
'date' => __('Date', 'auxin-elements'),
|
175 |
'comment_count' => __('Comments', 'auxin-elements'),
|
176 |
'modified' => __('Date Modified', 'auxin-elements'),
|
177 |
'author' => __('Author', 'auxin-elements'),
|
178 |
+
'post__in' => __('Inserted Post IDs', 'auxin-elements')
|
179 |
),
|
180 |
+
'admin_label' => false,
|
181 |
'dependency' => '',
|
182 |
'weight' => '',
|
183 |
+
'group' => 'Query',
|
184 |
'edit_field_class' => ''
|
185 |
),
|
186 |
array(
|
189 |
'param_name' => 'order',
|
190 |
'type' => 'dropdown',
|
191 |
'def_value' => 'DESC',
|
192 |
+
'holder' => '',
|
193 |
'class' => 'order',
|
194 |
'value' =>array (
|
195 |
'DESC' => __('Descending', 'auxin-elements'),
|
196 |
'ASC' => __('Ascending', 'auxin-elements'),
|
197 |
),
|
198 |
+
'admin_label' => false,
|
199 |
'dependency' => '',
|
200 |
'weight' => '',
|
201 |
+
'group' => 'Query',
|
202 |
'edit_field_class' => ''
|
203 |
),
|
204 |
array(
|
205 |
+
'heading' => __('Only posts','auxin-elements' ),
|
206 |
+
'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' ),
|
207 |
+
'param_name' => 'only_posts__in',
|
208 |
+
'type' => 'textfield',
|
209 |
+
'value' => '',
|
210 |
+
'holder' => '',
|
211 |
+
'class' => '',
|
212 |
+
'admin_label' => false,
|
213 |
+
'dependency' => '',
|
214 |
+
'weight' => '',
|
215 |
+
'group' => 'Query',
|
216 |
'edit_field_class' => ''
|
217 |
),
|
218 |
array(
|
219 |
+
'heading' => __('Include posts','auxin-elements' ),
|
220 |
+
'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' ),
|
221 |
+
'param_name' => 'include',
|
222 |
+
'type' => 'textfield',
|
223 |
+
'value' => '',
|
224 |
+
'holder' => '',
|
225 |
+
'class' => '',
|
226 |
+
'admin_label' => false,
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
'dependency' => '',
|
228 |
'weight' => '',
|
229 |
+
'group' => 'Query',
|
230 |
+
'edit_field_class' => ''
|
231 |
+
),
|
232 |
+
array(
|
233 |
+
'heading' => __('Exclude posts','auxin-elements' ),
|
234 |
+
'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' ),
|
235 |
+
'param_name' => 'exclude',
|
236 |
+
'type' => 'textfield',
|
237 |
+
'value' => '',
|
238 |
+
'holder' => '',
|
239 |
+
'class' => '',
|
240 |
+
'admin_label' => false,
|
241 |
+
'dependency' => '',
|
242 |
+
'weight' => '',
|
243 |
+
'group' => 'Query',
|
244 |
+
'edit_field_class' => ''
|
245 |
+
),
|
246 |
+
array(
|
247 |
+
'heading' => __('Start offset','auxin-elements' ),
|
248 |
+
'description' => __('Number of post to displace or pass over.', 'auxin-elements' ),
|
249 |
+
'param_name' => 'offset',
|
250 |
+
'type' => 'textfield',
|
251 |
+
'value' => '',
|
252 |
+
'holder' => '',
|
253 |
+
'class' => '',
|
254 |
+
'admin_label' => false,
|
255 |
+
'dependency' => '',
|
256 |
+
'weight' => '',
|
257 |
+
'group' => 'Query',
|
258 |
'edit_field_class' => ''
|
259 |
),
|
260 |
array(
|
263 |
'type' => 'aux_switch',
|
264 |
'def_value' => '',
|
265 |
'value' => '1',
|
266 |
+
'holder' => '',
|
267 |
'class' => 'show_media',
|
268 |
+
'admin_label' => false,
|
269 |
'dependency' => '',
|
270 |
'weight' => '',
|
271 |
+
'group' => '',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
'edit_field_class' => ''
|
273 |
),
|
274 |
array(
|
278 |
'type' => 'aux_switch',
|
279 |
'value' => '1',
|
280 |
'class' => 'display_title',
|
281 |
+
'admin_label' => false,
|
282 |
'dependency' => '',
|
283 |
'weight' => '',
|
284 |
+
'group' => '',
|
285 |
'edit_field_class' => ''
|
286 |
),
|
287 |
array(
|
291 |
'type' => 'aux_switch',
|
292 |
'value' => '1',
|
293 |
'class' => '',
|
294 |
+
'admin_label' => false,
|
295 |
'weight' => '',
|
296 |
+
'group' => '',
|
297 |
'edit_field_class' => ''
|
298 |
),
|
299 |
array(
|
302 |
'param_name' => 'display_like',
|
303 |
'type' => 'aux_switch',
|
304 |
'value' => '1',
|
305 |
+
'holder' => '',
|
306 |
'class' => 'display_like',
|
307 |
+
'admin_label' => false,
|
308 |
'dependency' => '',
|
309 |
'weight' => '',
|
310 |
+
'group' => '',
|
311 |
'edit_field_class' => ''
|
312 |
),
|
313 |
array(
|
316 |
'param_name' => 'excerpt_len',
|
317 |
'type' => 'textfield',
|
318 |
'value' => '160',
|
319 |
+
'holder' => '',
|
320 |
'class' => 'excerpt_len',
|
321 |
+
'admin_label' => false,
|
322 |
+
// @TODO: bcz of this dependency its value does not save on VC
|
323 |
'dependency' => array(
|
324 |
+
'element' => 'show_excerpt',
|
325 |
+
'value' => '1'
|
326 |
),
|
327 |
'weight' => '',
|
328 |
+
'group' => '',
|
329 |
'edit_field_class' => ''
|
330 |
),
|
331 |
array(
|
334 |
'param_name' => 'author_or_readmore',
|
335 |
'type' => 'dropdown',
|
336 |
'def_value' => 'readmore',
|
337 |
+
'holder' => '',
|
338 |
'class' => 'author_or_readmore',
|
339 |
'value' =>array (
|
340 |
+
'readmore' => __('Read More', 'auxin-elements'),
|
341 |
+
'author' => __('Author Name', 'auxin-elements'),
|
342 |
),
|
343 |
+
'admin_label' => false,
|
344 |
'dependency' => '',
|
345 |
'weight' => '',
|
346 |
+
'group' => '',
|
347 |
'edit_field_class' => ''
|
348 |
),
|
349 |
array(
|
353 |
'type' => 'textfield',
|
354 |
'value' => '',
|
355 |
'def_value' => '',
|
356 |
+
'holder' => '',
|
357 |
'class' => 'extra_classes',
|
358 |
+
'admin_label' => false,
|
359 |
'dependency' => '',
|
360 |
'weight' => '',
|
361 |
'group' => '',
|
389 |
'title' => '', // header title
|
390 |
'cat' => ' ',
|
391 |
'num' => '8',
|
392 |
+
'only_posts__in' => '', // display only these post IDs. array or string comma separated
|
393 |
+
'include' => '', // include these post IDs in result too. array or string comma separated
|
394 |
+
'exclude' => '', // exclude these post IDs from result. array or string comma separated
|
395 |
'posts_per_page' => -1,
|
396 |
'paged' => '',
|
397 |
'offset' => '',
|
398 |
+
'order_by' => 'date',
|
399 |
+
'order' => 'DESC',
|
400 |
'exclude_without_media' => 0,
|
401 |
'exclude_custom_post_formats' => 0,
|
402 |
'exclude_quote_link' => 0,
|
415 |
'custom_el_id' => '',
|
416 |
'reset_query' => true,
|
417 |
'use_wp_query' => false, // true to use the global wp_query, false to use internal custom query
|
418 |
+
'wp_query_args' => array(), // additional wp_query args
|
419 |
'base_class' => 'aux-widget-recent-posts-land'
|
420 |
);
|
421 |
|
422 |
+
|
423 |
$result = auxin_get_widget_scafold( $atts, $default_atts, $shortcode_content );
|
424 |
extract( $result['parsed_atts'] );
|
425 |
|
426 |
+
|
427 |
// get content width
|
428 |
global $aux_content_width;
|
429 |
|
459 |
|
460 |
// create wp_query to get latest items -----------
|
461 |
$args = array(
|
462 |
+
'post_type' => 'post',
|
463 |
+
'orderby' => $order_by,
|
464 |
+
'order' => $order,
|
465 |
+
'offset' => $offset,
|
466 |
+
'paged' => $paged,
|
467 |
+
'cat' => $cat,
|
468 |
+
'post_status' => 'publish',
|
469 |
+
'posts_per_page' => $num,
|
470 |
+
'ignore_sticky_posts' => 1,
|
471 |
+
'include_posts__in' => $include, // include posts in this liat
|
472 |
+
'posts__not_in' => $exclude, // exclude posts in this list
|
473 |
+
'posts__in' => $only_posts__in, // only posts in this list
|
474 |
+
|
475 |
+
'exclude_without_media' => $exclude_without_media,
|
476 |
+
'exclude_post_formats_in' => $exclude_post_formats_in
|
477 |
);
|
478 |
|
479 |
+
// ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
480 |
|
481 |
+
// add the additional query args if available
|
482 |
+
if( $wp_query_args ){
|
483 |
+
$args = wp_parse_args( $args, $wp_query_args );
|
|
|
|
|
|
|
|
|
|
|
|
|
484 |
}
|
485 |
|
486 |
+
// pass the args through the auxin query parser
|
487 |
+
$wp_query = new WP_Query( auxin_parse_query_args( $args ) );
|
488 |
}
|
489 |
|
490 |
// widget header ------------------------------
|
includes/elements/recent-posts-masonry.php
CHANGED
@@ -54,32 +54,32 @@ function auxin_get_recent_posts_masonry_master_array( $master_array ) {
|
|
54 |
'params' => array(
|
55 |
array(
|
56 |
'heading' => __('Title','auxin-elements' ),
|
57 |
-
'description'
|
58 |
'param_name' => 'title',
|
59 |
'type' => 'textfield',
|
60 |
'std' => '',
|
61 |
'value' => '',
|
62 |
'holder' => 'textfield',
|
63 |
'class' => 'title',
|
64 |
-
'admin_label' =>
|
65 |
'dependency' => '',
|
66 |
'weight' => '',
|
67 |
-
'group' => ''
|
68 |
'edit_field_class' => ''
|
69 |
),
|
70 |
array(
|
71 |
'heading' => __('Categories', 'auxin-elements'),
|
72 |
'description' => __('Specifies a category that you want to show posts from it.', 'auxin-elements' ),
|
73 |
'param_name' => 'cat',
|
74 |
-
'type' => '
|
75 |
'def_value' => ' ',
|
76 |
-
'holder' => '
|
77 |
'class' => 'cat',
|
78 |
'value' => $categories_list,
|
79 |
-
'admin_label' =>
|
80 |
'dependency' => '',
|
81 |
'weight' => '',
|
82 |
-
'group' => ''
|
83 |
'edit_field_class' => ''
|
84 |
),
|
85 |
array(
|
@@ -87,13 +87,13 @@ function auxin_get_recent_posts_masonry_master_array( $master_array ) {
|
|
87 |
'description' => '',
|
88 |
'param_name' => 'num',
|
89 |
'type' => 'textfield',
|
90 |
-
'
|
91 |
-
'holder' => '
|
92 |
'class' => 'num',
|
93 |
-
'admin_label' =>
|
94 |
'dependency' => '',
|
95 |
'weight' => '',
|
96 |
-
'group' => ''
|
97 |
'edit_field_class' => ''
|
98 |
),
|
99 |
array(
|
@@ -103,23 +103,23 @@ function auxin_get_recent_posts_masonry_master_array( $master_array ) {
|
|
103 |
'type' => 'aux_switch',
|
104 |
'value' => '0',
|
105 |
'class' => '',
|
106 |
-
'admin_label' =>
|
107 |
'dependency' => '',
|
108 |
'weight' => '',
|
109 |
-
'group' => ''
|
110 |
'edit_field_class' => ''
|
111 |
),
|
112 |
array(
|
113 |
-
'heading' => __('Exclude
|
114 |
'description' => '',
|
115 |
'param_name' => 'exclude_custom_post_formats',
|
116 |
'type' => 'aux_switch',
|
117 |
'value' => '0',
|
118 |
'class' => '',
|
119 |
-
'admin_label' =>
|
120 |
'dependency' => '',
|
121 |
'weight' => '',
|
122 |
-
'group' => ''
|
123 |
'edit_field_class' => ''
|
124 |
),
|
125 |
array(
|
@@ -129,50 +129,22 @@ function auxin_get_recent_posts_masonry_master_array( $master_array ) {
|
|
129 |
'type' => 'aux_switch',
|
130 |
'value' => '0',
|
131 |
'class' => '',
|
132 |
-
'admin_label' =>
|
133 |
'dependency' => array(
|
134 |
'element' => 'exclude_custom_post_formats',
|
135 |
'value' => array('0', 'false')
|
136 |
),
|
137 |
'weight' => '',
|
138 |
-
'group' => ''
|
139 |
-
'edit_field_class' => ''
|
140 |
-
),
|
141 |
-
array(
|
142 |
-
'heading' => __('Exclude posts','auxin-elements' ),
|
143 |
-
'description' => __('Post IDs separated by comma (eg. 53,34,87,25)', 'auxin-elements' ),
|
144 |
-
'param_name' => 'exclude',
|
145 |
-
'type' => 'textfield',
|
146 |
-
'value' => '',
|
147 |
-
'holder' => 'textfield',
|
148 |
-
'class' => '',
|
149 |
-
'admin_label' => true,
|
150 |
-
'dependency' => '',
|
151 |
-
'weight' => '',
|
152 |
-
'group' => '' ,
|
153 |
-
'edit_field_class' => ''
|
154 |
-
),
|
155 |
-
array(
|
156 |
-
'heading' => __('Include posts','auxin-elements' ),
|
157 |
-
'description' => __('Post IDs separated by comma (eg. 53,34,87,25)', 'auxin-elements' ),
|
158 |
-
'param_name' => 'include',
|
159 |
-
'type' => 'textfield',
|
160 |
-
'value' => '',
|
161 |
-
'holder' => 'textfield',
|
162 |
-
'class' => '',
|
163 |
-
'admin_label' => true,
|
164 |
-
'dependency' => '',
|
165 |
-
'weight' => '',
|
166 |
-
'group' => '' ,
|
167 |
'edit_field_class' => ''
|
168 |
),
|
169 |
-
|
170 |
'heading' => __('Order by', 'auxin-elements'),
|
171 |
'description' => '',
|
172 |
'param_name' => 'order_by',
|
173 |
'type' => 'dropdown',
|
174 |
'def_value' => 'date',
|
175 |
-
'holder' => '
|
176 |
'class' => 'order_by',
|
177 |
'value' => array (
|
178 |
'date' => __('Date', 'auxin-elements'),
|
@@ -183,11 +155,12 @@ function auxin_get_recent_posts_masonry_master_array( $master_array ) {
|
|
183 |
'comment_count' => __('Comments', 'auxin-elements'),
|
184 |
'modified' => __('Date Modified', 'auxin-elements'),
|
185 |
'author' => __('Author', 'auxin-elements'),
|
|
|
186 |
),
|
187 |
-
'admin_label' =>
|
188 |
'dependency' => '',
|
189 |
'weight' => '',
|
190 |
-
'group' => ''
|
191 |
'edit_field_class' => ''
|
192 |
),
|
193 |
array(
|
@@ -196,65 +169,86 @@ function auxin_get_recent_posts_masonry_master_array( $master_array ) {
|
|
196 |
'param_name' => 'order',
|
197 |
'type' => 'dropdown',
|
198 |
'def_value' => 'DESC',
|
199 |
-
'holder' => '
|
200 |
'class' => 'order',
|
201 |
'value' =>array (
|
202 |
'DESC' => __('Descending', 'auxin-elements'),
|
203 |
'ASC' => __('Ascending', 'auxin-elements'),
|
204 |
),
|
205 |
-
'admin_label' =>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
'dependency' => '',
|
207 |
'weight' => '',
|
208 |
-
'group' => ''
|
209 |
'edit_field_class' => ''
|
210 |
),
|
211 |
array(
|
212 |
-
'heading'
|
213 |
-
'description'
|
214 |
-
'param_name'
|
215 |
-
'type'
|
216 |
-
'value'
|
217 |
-
'holder'
|
218 |
-
'class'
|
219 |
-
'admin_label'
|
220 |
-
'dependency'
|
221 |
-
'weight'
|
222 |
-
'group'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
'edit_field_class' => ''
|
224 |
),
|
225 |
-
// @TODO: it seems weitout this option is better.
|
226 |
-
// array(
|
227 |
-
// 'heading' => __('Image aspect ratio', 'auxin-elements'),
|
228 |
-
// 'description' => '',
|
229 |
-
// 'param_name' => 'image_aspect_ratio',
|
230 |
-
// 'type' => 'dropdown',
|
231 |
-
// 'def_value' => '0.75',
|
232 |
-
// 'holder' => 'dropdown',
|
233 |
-
// 'class' => 'order',
|
234 |
-
// 'value' =>array (
|
235 |
-
// '0.75' => __('Horizontal 4:3' , 'auxin-elements'),
|
236 |
-
// '0.56' => __('Horizontal 16:9', 'auxin-elements'),
|
237 |
-
// '1.00' => __('Square 1:1' , 'auxin-elements'),
|
238 |
-
// '1.33' => __('Vertical 3:4' , 'auxin-elements')
|
239 |
-
// ),
|
240 |
-
// 'admin_label' => true,
|
241 |
-
// 'dependency' => '',
|
242 |
-
// 'weight' => '',
|
243 |
-
// 'group' => '' ,
|
244 |
-
// 'edit_field_class' => ''
|
245 |
-
// ),
|
246 |
array(
|
247 |
'heading' => __('Display post media (image, video, etc)', 'auxin-elements' ),
|
248 |
'param_name' => 'show_media',
|
249 |
'type' => 'aux_switch',
|
250 |
'def_value' => '',
|
251 |
'value' => '1',
|
252 |
-
'holder' => '
|
253 |
'class' => 'show_media',
|
254 |
-
'admin_label' =>
|
255 |
'dependency' => '',
|
256 |
'weight' => '',
|
257 |
-
'group' => ''
|
258 |
'edit_field_class' => ''
|
259 |
),
|
260 |
array(
|
@@ -264,10 +258,10 @@ function auxin_get_recent_posts_masonry_master_array( $master_array ) {
|
|
264 |
'type' => 'aux_switch',
|
265 |
'value' => '1',
|
266 |
'class' => 'display_title',
|
267 |
-
'admin_label' =>
|
268 |
'dependency' => '',
|
269 |
'weight' => '',
|
270 |
-
'group' => ''
|
271 |
'edit_field_class' => ''
|
272 |
),
|
273 |
array(
|
@@ -277,9 +271,9 @@ function auxin_get_recent_posts_masonry_master_array( $master_array ) {
|
|
277 |
'type' => 'aux_switch',
|
278 |
'value' => '1',
|
279 |
'class' => '',
|
280 |
-
'admin_label' =>
|
281 |
'weight' => '',
|
282 |
-
'group' => ''
|
283 |
'edit_field_class' => ''
|
284 |
),
|
285 |
array(
|
@@ -288,12 +282,12 @@ function auxin_get_recent_posts_masonry_master_array( $master_array ) {
|
|
288 |
'param_name' => 'display_like',
|
289 |
'type' => 'aux_switch',
|
290 |
'value' => '1',
|
291 |
-
'holder' => '
|
292 |
'class' => 'display_like',
|
293 |
-
'admin_label' =>
|
294 |
'dependency' => '',
|
295 |
'weight' => '',
|
296 |
-
'group' => ''
|
297 |
'edit_field_class' => ''
|
298 |
),
|
299 |
array(
|
@@ -302,12 +296,12 @@ function auxin_get_recent_posts_masonry_master_array( $master_array ) {
|
|
302 |
'param_name' => 'excerpt_len',
|
303 |
'type' => 'textfield',
|
304 |
'value' => '160',
|
305 |
-
'holder' => '
|
306 |
'class' => 'excerpt_len',
|
307 |
-
'admin_label' =>
|
308 |
'dependency' => '',
|
309 |
'weight' => '',
|
310 |
-
'group' => ''
|
311 |
'edit_field_class' => ''
|
312 |
),
|
313 |
array(
|
@@ -316,16 +310,16 @@ function auxin_get_recent_posts_masonry_master_array( $master_array ) {
|
|
316 |
'param_name' => 'author_or_readmore',
|
317 |
'type' => 'dropdown',
|
318 |
'def_value' => 'readmore',
|
319 |
-
'holder' => '
|
320 |
'class' => 'author_or_readmore',
|
321 |
-
'value' =>array (
|
322 |
'readmore' => __('Read More', 'auxin-elements'),
|
323 |
'author' => __('Author Name', 'auxin-elements'),
|
324 |
),
|
325 |
-
'admin_label' =>
|
326 |
'dependency' => '',
|
327 |
'weight' => '',
|
328 |
-
'group' => ''
|
329 |
'edit_field_class' => ''
|
330 |
),
|
331 |
array(
|
@@ -334,16 +328,16 @@ function auxin_get_recent_posts_masonry_master_array( $master_array ) {
|
|
334 |
'param_name' => 'desktop_cnum',
|
335 |
'type' => 'dropdown',
|
336 |
'def_value' => '4',
|
337 |
-
'holder' => '
|
338 |
'class' => 'desktop_cnum',
|
339 |
'value' => array(
|
340 |
'1' => '1', '2' => '2', '3' => '3',
|
341 |
'4' => '4', '5' => '5', '6' => '6'
|
342 |
),
|
343 |
-
'admin_label' =>
|
344 |
'dependency' => '',
|
345 |
'weight' => '',
|
346 |
-
'group' => 'Layout'
|
347 |
'edit_field_class' => ''
|
348 |
),
|
349 |
array(
|
@@ -351,18 +345,18 @@ function auxin_get_recent_posts_masonry_master_array( $master_array ) {
|
|
351 |
'description' => '',
|
352 |
'param_name' => 'tablet_cnum',
|
353 |
'type' => 'dropdown',
|
354 |
-
'
|
355 |
-
'holder' => '
|
356 |
'class' => 'tablet_cnum',
|
357 |
'value' => array(
|
358 |
'inherit' => 'Inherited from larger',
|
359 |
'1' => '1', '2' => '2', '3' => '3',
|
360 |
'4' => '4', '5' => '5', '6' => '6'
|
361 |
),
|
362 |
-
'admin_label' =>
|
363 |
'dependency' => '',
|
364 |
'weight' => '',
|
365 |
-
'group' => 'Layout'
|
366 |
'edit_field_class' => ''
|
367 |
),
|
368 |
array(
|
@@ -371,15 +365,15 @@ function auxin_get_recent_posts_masonry_master_array( $master_array ) {
|
|
371 |
'param_name' => 'phone_cnum',
|
372 |
'type' => 'dropdown',
|
373 |
'def_value' => '1',
|
374 |
-
'holder' => '
|
375 |
'class' => 'phone_cnum',
|
376 |
'value' => array(
|
377 |
'1' => '1' , '2' => '2', '3' => '3'
|
378 |
),
|
379 |
-
'admin_label' =>
|
380 |
'dependency' => '',
|
381 |
'weight' => '',
|
382 |
-
'group' => 'Layout'
|
383 |
'edit_field_class' => ''
|
384 |
),
|
385 |
array(
|
@@ -389,9 +383,9 @@ function auxin_get_recent_posts_masonry_master_array( $master_array ) {
|
|
389 |
'type' => 'textfield',
|
390 |
'value' => '',
|
391 |
'def_value' => '',
|
392 |
-
'holder' => '
|
393 |
'class' => 'extra_classes',
|
394 |
-
'admin_label' =>
|
395 |
'dependency' => '',
|
396 |
'weight' => '',
|
397 |
'group' => '',
|
@@ -422,15 +416,16 @@ function auxin_widget_recent_posts_masonry_callback( $atts, $shortcode_content =
|
|
422 |
|
423 |
// Defining default attributes
|
424 |
$default_atts = array(
|
425 |
-
'title' => '',
|
426 |
'cat' => ' ',
|
427 |
'num' => '8', // max generated entry
|
428 |
-
'
|
429 |
-
'include' => '',
|
|
|
430 |
'offset' => '',
|
431 |
'paged' => '',
|
432 |
-
'order_by' => '
|
433 |
-
'order' => '
|
434 |
'exclude_without_media' => 0,
|
435 |
'exclude_custom_post_formats' => 0,
|
436 |
'exclude_quote_link' => 0,
|
@@ -453,6 +448,7 @@ function auxin_widget_recent_posts_masonry_callback( $atts, $shortcode_content =
|
|
453 |
'custom_el_id' => '',
|
454 |
'reset_query' => true,
|
455 |
'use_wp_query' => false, // true to use the global wp_query, false to use internal custom query
|
|
|
456 |
'base_class' => 'aux-widget-recent-posts-masonry aux-column-post-entry'
|
457 |
);
|
458 |
|
@@ -493,52 +489,33 @@ function auxin_widget_recent_posts_masonry_callback( $atts, $shortcode_content =
|
|
493 |
|
494 |
// create wp_query to get latest items -----------
|
495 |
$args = array(
|
496 |
-
'post_type'
|
497 |
-
'orderby'
|
498 |
-
'order'
|
499 |
-
'offset'
|
500 |
-
'paged'
|
501 |
-
'cat'
|
502 |
-
'
|
503 |
-
'
|
504 |
-
'
|
505 |
-
|
506 |
-
'
|
|
|
|
|
|
|
|
|
|
|
507 |
);
|
508 |
|
509 |
-
//
|
510 |
-
if( ! empty( $exclude_post_formats_in ) ){
|
511 |
-
|
512 |
-
// generate post-format terms (i.e post-format-aside)
|
513 |
-
$post_format_terms = array();
|
514 |
-
foreach ( $exclude_post_formats_in as $_post_format ) {
|
515 |
-
$post_format_terms[] = 'post-format-' . $_post_format;
|
516 |
-
}
|
517 |
-
|
518 |
-
// exclude the redundant taxonomies (post-format)
|
519 |
-
$args['tax_query'] = array(
|
520 |
-
array(
|
521 |
-
'taxonomy' => 'post_format',
|
522 |
-
'field' => 'slug',
|
523 |
-
'terms' => $post_format_terms,
|
524 |
-
'operator' => 'NOT IN'
|
525 |
-
)
|
526 |
-
);
|
527 |
|
|
|
|
|
|
|
528 |
}
|
529 |
|
530 |
-
//
|
531 |
-
|
532 |
-
$args['meta_query'] = array(
|
533 |
-
array(
|
534 |
-
'key' => '_thumbnail_id',
|
535 |
-
'value' => '',
|
536 |
-
'compare' => '!='
|
537 |
-
)
|
538 |
-
);
|
539 |
-
}
|
540 |
-
|
541 |
-
$wp_query = new WP_Query( $args );
|
542 |
}
|
543 |
|
544 |
// widget header ------------------------------
|
54 |
'params' => array(
|
55 |
array(
|
56 |
'heading' => __('Title','auxin-elements' ),
|
57 |
+
'description' => __('Recent post title, leave it empty if you don`t need title.', 'auxin-elements'),
|
58 |
'param_name' => 'title',
|
59 |
'type' => 'textfield',
|
60 |
'std' => '',
|
61 |
'value' => '',
|
62 |
'holder' => 'textfield',
|
63 |
'class' => 'title',
|
64 |
+
'admin_label' => false,
|
65 |
'dependency' => '',
|
66 |
'weight' => '',
|
67 |
+
'group' => '',
|
68 |
'edit_field_class' => ''
|
69 |
),
|
70 |
array(
|
71 |
'heading' => __('Categories', 'auxin-elements'),
|
72 |
'description' => __('Specifies a category that you want to show posts from it.', 'auxin-elements' ),
|
73 |
'param_name' => 'cat',
|
74 |
+
'type' => 'aux_select2_multiple',
|
75 |
'def_value' => ' ',
|
76 |
+
'holder' => '',
|
77 |
'class' => 'cat',
|
78 |
'value' => $categories_list,
|
79 |
+
'admin_label' => false,
|
80 |
'dependency' => '',
|
81 |
'weight' => '',
|
82 |
+
'group' => 'Query',
|
83 |
'edit_field_class' => ''
|
84 |
),
|
85 |
array(
|
87 |
'description' => '',
|
88 |
'param_name' => 'num',
|
89 |
'type' => 'textfield',
|
90 |
+
'value' => '8',
|
91 |
+
'holder' => '',
|
92 |
'class' => 'num',
|
93 |
+
'admin_label' => false,
|
94 |
'dependency' => '',
|
95 |
'weight' => '',
|
96 |
+
'group' => 'Query',
|
97 |
'edit_field_class' => ''
|
98 |
),
|
99 |
array(
|
103 |
'type' => 'aux_switch',
|
104 |
'value' => '0',
|
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' => '0',
|
118 |
'class' => '',
|
119 |
+
'admin_label' => false,
|
120 |
'dependency' => '',
|
121 |
'weight' => '',
|
122 |
+
'group' => 'Query',
|
123 |
'edit_field_class' => ''
|
124 |
),
|
125 |
array(
|
129 |
'type' => 'aux_switch',
|
130 |
'value' => '0',
|
131 |
'class' => '',
|
132 |
+
'admin_label' => false,
|
133 |
'dependency' => array(
|
134 |
'element' => 'exclude_custom_post_formats',
|
135 |
'value' => array('0', 'false')
|
136 |
),
|
137 |
'weight' => '',
|
138 |
+
'group' => '',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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'),
|
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(
|
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' => __('Start offset','auxin-elements' ),
|
228 |
+
'description' => __('Number of post to displace or pass over.', 'auxin-elements' ),
|
229 |
+
'param_name' => 'offset',
|
230 |
+
'type' => 'textfield',
|
231 |
+
'value' => '',
|
232 |
+
'holder' => '',
|
233 |
+
'class' => '',
|
234 |
+
'admin_label' => false,
|
235 |
+
'dependency' => '',
|
236 |
+
'weight' => '',
|
237 |
+
'group' => 'Query',
|
238 |
'edit_field_class' => ''
|
239 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
array(
|
241 |
'heading' => __('Display post media (image, video, etc)', 'auxin-elements' ),
|
242 |
'param_name' => 'show_media',
|
243 |
'type' => 'aux_switch',
|
244 |
'def_value' => '',
|
245 |
'value' => '1',
|
246 |
+
'holder' => '',
|
247 |
'class' => 'show_media',
|
248 |
+
'admin_label' => false,
|
249 |
'dependency' => '',
|
250 |
'weight' => '',
|
251 |
+
'group' => '',
|
252 |
'edit_field_class' => ''
|
253 |
),
|
254 |
array(
|
258 |
'type' => 'aux_switch',
|
259 |
'value' => '1',
|
260 |
'class' => 'display_title',
|
261 |
+
'admin_label' => false,
|
262 |
'dependency' => '',
|
263 |
'weight' => '',
|
264 |
+
'group' => '',
|
265 |
'edit_field_class' => ''
|
266 |
),
|
267 |
array(
|
271 |
'type' => 'aux_switch',
|
272 |
'value' => '1',
|
273 |
'class' => '',
|
274 |
+
'admin_label' => false,
|
275 |
'weight' => '',
|
276 |
+
'group' => '',
|
277 |
'edit_field_class' => ''
|
278 |
),
|
279 |
array(
|
282 |
'param_name' => 'display_like',
|
283 |
'type' => 'aux_switch',
|
284 |
'value' => '1',
|
285 |
+
'holder' => '',
|
286 |
'class' => 'display_like',
|
287 |
+
'admin_label' => false,
|
288 |
'dependency' => '',
|
289 |
'weight' => '',
|
290 |
+
'group' => '',
|
291 |
'edit_field_class' => ''
|
292 |
),
|
293 |
array(
|
296 |
'param_name' => 'excerpt_len',
|
297 |
'type' => 'textfield',
|
298 |
'value' => '160',
|
299 |
+
'holder' => '',
|
300 |
'class' => 'excerpt_len',
|
301 |
+
'admin_label' => false,
|
302 |
'dependency' => '',
|
303 |
'weight' => '',
|
304 |
+
'group' => '',
|
305 |
'edit_field_class' => ''
|
306 |
),
|
307 |
array(
|
310 |
'param_name' => 'author_or_readmore',
|
311 |
'type' => 'dropdown',
|
312 |
'def_value' => 'readmore',
|
313 |
+
'holder' => '',
|
314 |
'class' => 'author_or_readmore',
|
315 |
+
'value' => array (
|
316 |
'readmore' => __('Read More', 'auxin-elements'),
|
317 |
'author' => __('Author Name', 'auxin-elements'),
|
318 |
),
|
319 |
+
'admin_label' => false,
|
320 |
'dependency' => '',
|
321 |
'weight' => '',
|
322 |
+
'group' => '',
|
323 |
'edit_field_class' => ''
|
324 |
),
|
325 |
array(
|
328 |
'param_name' => 'desktop_cnum',
|
329 |
'type' => 'dropdown',
|
330 |
'def_value' => '4',
|
331 |
+
'holder' => '',
|
332 |
'class' => 'desktop_cnum',
|
333 |
'value' => array(
|
334 |
'1' => '1', '2' => '2', '3' => '3',
|
335 |
'4' => '4', '5' => '5', '6' => '6'
|
336 |
),
|
337 |
+
'admin_label' => false,
|
338 |
'dependency' => '',
|
339 |
'weight' => '',
|
340 |
+
'group' => 'Layout',
|
341 |
'edit_field_class' => ''
|
342 |
),
|
343 |
array(
|
345 |
'description' => '',
|
346 |
'param_name' => 'tablet_cnum',
|
347 |
'type' => 'dropdown',
|
348 |
+
'value' => 'inherit',
|
349 |
+
'holder' => '',
|
350 |
'class' => 'tablet_cnum',
|
351 |
'value' => array(
|
352 |
'inherit' => 'Inherited from larger',
|
353 |
'1' => '1', '2' => '2', '3' => '3',
|
354 |
'4' => '4', '5' => '5', '6' => '6'
|
355 |
),
|
356 |
+
'admin_label' => false,
|
357 |
'dependency' => '',
|
358 |
'weight' => '',
|
359 |
+
'group' => 'Layout',
|
360 |
'edit_field_class' => ''
|
361 |
),
|
362 |
array(
|
365 |
'param_name' => 'phone_cnum',
|
366 |
'type' => 'dropdown',
|
367 |
'def_value' => '1',
|
368 |
+
'holder' => '',
|
369 |
'class' => 'phone_cnum',
|
370 |
'value' => array(
|
371 |
'1' => '1' , '2' => '2', '3' => '3'
|
372 |
),
|
373 |
+
'admin_label' => false,
|
374 |
'dependency' => '',
|
375 |
'weight' => '',
|
376 |
+
'group' => 'Layout',
|
377 |
'edit_field_class' => ''
|
378 |
),
|
379 |
array(
|
383 |
'type' => 'textfield',
|
384 |
'value' => '',
|
385 |
'def_value' => '',
|
386 |
+
'holder' => '',
|
387 |
'class' => 'extra_classes',
|
388 |
+
'admin_label' => false,
|
389 |
'dependency' => '',
|
390 |
'weight' => '',
|
391 |
'group' => '',
|
416 |
|
417 |
// Defining default attributes
|
418 |
$default_atts = array(
|
419 |
+
'title' => '', // header title
|
420 |
'cat' => ' ',
|
421 |
'num' => '8', // max generated entry
|
422 |
+
'only_posts__in' => '', // display only these post IDs. array or string comma separated
|
423 |
+
'include' => '', // include these post IDs in result too. array or string comma separated
|
424 |
+
'exclude' => '', // exclude these post IDs from result. array or string comma separated
|
425 |
'offset' => '',
|
426 |
'paged' => '',
|
427 |
+
'order_by' => 'date',
|
428 |
+
'order' => 'DESC',
|
429 |
'exclude_without_media' => 0,
|
430 |
'exclude_custom_post_formats' => 0,
|
431 |
'exclude_quote_link' => 0,
|
448 |
'custom_el_id' => '',
|
449 |
'reset_query' => true,
|
450 |
'use_wp_query' => false, // true to use the global wp_query, false to use internal custom query
|
451 |
+
'wp_query_args' => array(), // additional wp_query args
|
452 |
'base_class' => 'aux-widget-recent-posts-masonry aux-column-post-entry'
|
453 |
);
|
454 |
|
489 |
|
490 |
// create wp_query to get latest items -----------
|
491 |
$args = array(
|
492 |
+
'post_type' => 'post',
|
493 |
+
'orderby' => $order_by,
|
494 |
+
'order' => $order,
|
495 |
+
'offset' => $offset,
|
496 |
+
'paged' => $paged,
|
497 |
+
'cat' => $cat,
|
498 |
+
'post_status' => 'publish',
|
499 |
+
'posts_per_page' => $num,
|
500 |
+
'ignore_sticky_posts' => 1,
|
501 |
+
|
502 |
+
'include_posts__in' => $include, // include posts in this list
|
503 |
+
'posts__not_in' => $exclude, // exclude posts in this list
|
504 |
+
'posts__in' => $only_posts__in, // only posts in this list
|
505 |
+
|
506 |
+
'exclude_without_media' => $exclude_without_media,
|
507 |
+
'exclude_post_formats_in' => $exclude_post_formats_in
|
508 |
);
|
509 |
|
510 |
+
// ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
511 |
|
512 |
+
// add the additional query args if available
|
513 |
+
if( $wp_query_args ){
|
514 |
+
$args = wp_parse_args( $args, $wp_query_args );
|
515 |
}
|
516 |
|
517 |
+
// pass the args through the auxin query parser
|
518 |
+
$wp_query = new WP_Query( auxin_parse_query_args( $args ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
519 |
}
|
520 |
|
521 |
// widget header ------------------------------
|
includes/elements/recent-posts-tiles.php
CHANGED
@@ -13,7 +13,7 @@
|
|
13 |
function auxin_get_recent_posts_tiles_master_array( $master_array ) {
|
14 |
|
15 |
$categories = get_terms( 'category', 'orderby=count&hide_empty=0' );
|
16 |
-
$categories_list = array( '' => __('All Categories', 'auxin-elements' ) ) ;
|
17 |
foreach ( $categories as $key => $value ) {
|
18 |
$categories_list[$value->term_id] = $value->name;
|
19 |
}
|
@@ -57,47 +57,44 @@ function auxin_get_recent_posts_tiles_master_array( $master_array ) {
|
|
57 |
'description' => __('Recent post title, leave it empty if you don`t need title.', 'auxin-elements'),
|
58 |
'param_name' => 'title',
|
59 |
'type' => 'textfield',
|
60 |
-
'std' => '',
|
61 |
'value' => '',
|
62 |
'holder' => 'textfield',
|
63 |
'class' => 'title',
|
64 |
-
'admin_label' =>
|
65 |
'dependency' => '',
|
66 |
'weight' => '',
|
67 |
-
'group' => ''
|
68 |
'edit_field_class' => ''
|
69 |
),
|
70 |
array(
|
71 |
'heading' => __('Categories', 'auxin-elements'),
|
72 |
'description' => __('Specifies a category that you want to show posts from it.', 'auxin-elements' ),
|
73 |
'param_name' => 'cat',
|
74 |
-
'type' => '
|
75 |
-
'def_value' => '',
|
76 |
-
'holder' => '
|
77 |
'class' => 'cat',
|
78 |
'value' => $categories_list,
|
79 |
-
'admin_label' =>
|
80 |
'dependency' => '',
|
81 |
'weight' => '',
|
82 |
-
'group' => ''
|
83 |
'edit_field_class' => ''
|
84 |
),
|
85 |
-
|
86 |
array(
|
87 |
'heading' => __('Number of posts to show', 'auxin-elements'),
|
88 |
'description' => '',
|
89 |
'param_name' => 'num',
|
90 |
'type' => 'textfield',
|
91 |
-
'
|
92 |
-
'holder' => '
|
93 |
'class' => 'num',
|
94 |
-
'admin_label' =>
|
95 |
'dependency' => '',
|
96 |
'weight' => '',
|
97 |
-
'group' => ''
|
98 |
'edit_field_class' => ''
|
99 |
),
|
100 |
-
|
101 |
array(
|
102 |
'heading' => __('Exclude posts without media','auxin-elements' ),
|
103 |
'description' => '',
|
@@ -105,13 +102,12 @@ function auxin_get_recent_posts_tiles_master_array( $master_array ) {
|
|
105 |
'type' => 'aux_switch',
|
106 |
'value' => '1',
|
107 |
'class' => '',
|
108 |
-
'admin_label' =>
|
109 |
'dependency' => '',
|
110 |
'weight' => '',
|
111 |
-
'group' => ''
|
112 |
'edit_field_class' => ''
|
113 |
),
|
114 |
-
|
115 |
array(
|
116 |
'heading' => __('Exclude custom post formats','auxin-elements' ),
|
117 |
'description' => '',
|
@@ -119,13 +115,12 @@ function auxin_get_recent_posts_tiles_master_array( $master_array ) {
|
|
119 |
'type' => 'aux_switch',
|
120 |
'value' => '1',
|
121 |
'class' => '',
|
122 |
-
'admin_label' =>
|
123 |
'dependency' => '',
|
124 |
'weight' => '',
|
125 |
-
'group' => ''
|
126 |
'edit_field_class' => ''
|
127 |
),
|
128 |
-
|
129 |
array(
|
130 |
'heading' => __('Exclude quote and link post formats','auxin-elements' ),
|
131 |
'description' => '',
|
@@ -133,42 +128,98 @@ function auxin_get_recent_posts_tiles_master_array( $master_array ) {
|
|
133 |
'type' => 'aux_switch',
|
134 |
'value' => '1',
|
135 |
'class' => '',
|
136 |
-
'admin_label' =>
|
137 |
'dependency' => array(
|
138 |
'element' => 'exclude_custom_post_formats',
|
139 |
'value' => '0'
|
140 |
),
|
141 |
'weight' => '',
|
142 |
-
'group' => ''
|
143 |
'edit_field_class' => ''
|
144 |
),
|
145 |
-
|
146 |
array(
|
147 |
-
'heading'
|
148 |
-
'description'
|
149 |
-
'param_name'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
'type' => 'textfield',
|
151 |
'value' => '',
|
152 |
-
'holder' => '
|
153 |
'class' => '',
|
154 |
-
'admin_label' =>
|
155 |
'dependency' => '',
|
156 |
'weight' => '',
|
157 |
-
'group' => ''
|
158 |
'edit_field_class' => ''
|
159 |
),
|
160 |
array(
|
161 |
'heading' => __('Include posts','auxin-elements' ),
|
162 |
-
'description' => __('Post IDs separated by comma (eg. 53,34,87,25)', 'auxin-elements' ),
|
163 |
'param_name' => 'include',
|
164 |
'type' => 'textfield',
|
165 |
'value' => '',
|
166 |
-
'holder' => '
|
167 |
'class' => '',
|
168 |
-
'admin_label' =>
|
169 |
'dependency' => '',
|
170 |
'weight' => '',
|
171 |
-
'group' => ''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
172 |
'edit_field_class' => ''
|
173 |
),
|
174 |
array(
|
@@ -177,7 +228,7 @@ function auxin_get_recent_posts_tiles_master_array( $master_array ) {
|
|
177 |
'param_name' => 'order_by',
|
178 |
'type' => 'dropdown',
|
179 |
'def_value' => 'date',
|
180 |
-
'holder' => '
|
181 |
'class' => 'order_by',
|
182 |
'value' => array (
|
183 |
'date' => __('Date', 'auxin-elements'),
|
@@ -188,72 +239,70 @@ function auxin_get_recent_posts_tiles_master_array( $master_array ) {
|
|
188 |
'comment_count' => __('Comments', 'auxin-elements'),
|
189 |
'modified' => __('Date Modified', 'auxin-elements'),
|
190 |
'author' => __('Author', 'auxin-elements'),
|
|
|
191 |
),
|
192 |
-
'admin_label' =>
|
193 |
'dependency' => '',
|
194 |
'weight' => '',
|
195 |
-
'group' => ''
|
196 |
'edit_field_class' => ''
|
197 |
),
|
198 |
-
|
199 |
'heading' => __('Order', 'auxin-elements'),
|
200 |
'description' => '',
|
201 |
'param_name' => 'order',
|
202 |
'type' => 'dropdown',
|
203 |
'def_value' => 'DESC',
|
204 |
-
'holder' => '
|
205 |
'class' => 'order',
|
206 |
'value' =>array (
|
207 |
'DESC' => __('Descending', 'auxin-elements'),
|
208 |
'ASC' => __('Ascending', 'auxin-elements'),
|
209 |
),
|
210 |
-
'admin_label' =>
|
211 |
'dependency' => '',
|
212 |
'weight' => '',
|
213 |
-
'group' => ''
|
214 |
'edit_field_class' => ''
|
215 |
),
|
216 |
-
|
217 |
array(
|
218 |
-
'heading'
|
219 |
-
'description'
|
220 |
-
'param_name'
|
221 |
-
'type'
|
222 |
-
'value'
|
223 |
-
'holder'
|
224 |
-
'class'
|
225 |
-
'admin_label'
|
226 |
-
'dependency'
|
227 |
-
'weight'
|
228 |
-
'group'
|
229 |
'edit_field_class' => ''
|
230 |
),
|
231 |
-
|
232 |
array(
|
233 |
'heading' => __('Post tile style','auxin-elements' ),
|
234 |
'description' => '',
|
235 |
'param_name' => 'tile_style',
|
236 |
'type' => 'aux_visual_select',
|
237 |
-
'
|
238 |
-
'holder' => '
|
239 |
'class' => 'tile_style',
|
240 |
-
'admin_label' =>
|
241 |
'dependency' => '',
|
242 |
'weight' => '',
|
243 |
-
'group' => 'Style'
|
244 |
'edit_field_class' => '',
|
245 |
'choices' => array(
|
246 |
-
''
|
247 |
-
'label'
|
248 |
-
'image'
|
249 |
),
|
250 |
-
'aux-overlay'
|
251 |
-
'label'
|
252 |
-
'image'
|
253 |
)
|
254 |
)
|
255 |
),
|
256 |
-
|
257 |
array(
|
258 |
'heading' => __('Insert post title','auxin-elements' ),
|
259 |
'description' => '',
|
@@ -261,13 +310,12 @@ function auxin_get_recent_posts_tiles_master_array( $master_array ) {
|
|
261 |
'type' => 'aux_switch',
|
262 |
'value' => '1',
|
263 |
'class' => 'display_title',
|
264 |
-
'admin_label' =>
|
265 |
'dependency' => '',
|
266 |
'weight' => '',
|
267 |
'group' => '' ,
|
268 |
'edit_field_class' => ''
|
269 |
),
|
270 |
-
|
271 |
array(
|
272 |
'heading' => __('Insert post meta','auxin-elements' ),
|
273 |
'description' => '',
|
@@ -275,22 +323,20 @@ function auxin_get_recent_posts_tiles_master_array( $master_array ) {
|
|
275 |
'type' => 'aux_switch',
|
276 |
'value' => '1',
|
277 |
'class' => '',
|
278 |
-
'admin_label' =>
|
279 |
'weight' => '',
|
280 |
'group' => '' ,
|
281 |
'edit_field_class' => ''
|
282 |
),
|
283 |
-
|
284 |
array(
|
285 |
'heading' => __('Extra class name','auxin-elements' ),
|
286 |
'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' ),
|
287 |
'param_name' => 'extra_classes',
|
288 |
'type' => 'textfield',
|
289 |
'value' => '',
|
290 |
-
'
|
291 |
-
'holder' => 'textfield',
|
292 |
'class' => 'extra_classes',
|
293 |
-
'admin_label' =>
|
294 |
'dependency' => '',
|
295 |
'weight' => '',
|
296 |
'group' => '',
|
@@ -321,25 +367,27 @@ function auxin_widget_recent_posts_tiles_callback( $atts, $shortcode_content = n
|
|
321 |
$default_atts = array(
|
322 |
'title' => '', // header title
|
323 |
'cat' => ' ',
|
324 |
-
'num' => '
|
325 |
-
'
|
326 |
-
'include' => '',
|
|
|
327 |
'offset' => '',
|
328 |
'paged' => '',
|
329 |
-
'order_by' => '
|
330 |
-
'order' => '
|
331 |
'excerpt_len' => '160',
|
332 |
-
'exclude_without_media' => 1,
|
333 |
-
'exclude_custom_post_formats' => 1,
|
334 |
-
'exclude_quote_link' => 1,
|
335 |
'exclude_post_formats_in' => array(), // the list od post formats to exclude
|
336 |
'tile_style' => '',
|
337 |
-
'display_title' =>
|
338 |
-
'show_info' =>
|
339 |
'extra_classes' => '',
|
340 |
'custom_el_id' => '',
|
341 |
'reset_query' => true,
|
342 |
'use_wp_query' => false, // true to use the global wp_query, false to use internal custom query
|
|
|
343 |
'base_class' => 'aux-widget-recent-posts-tiles'
|
344 |
);
|
345 |
|
@@ -372,52 +420,34 @@ function auxin_widget_recent_posts_tiles_callback( $atts, $shortcode_content = n
|
|
372 |
|
373 |
// create wp_query to get latest items -----------
|
374 |
$args = array(
|
375 |
-
'post_type'
|
376 |
-
'orderby'
|
377 |
-
'order'
|
378 |
-
'offset'
|
379 |
-
'paged'
|
380 |
-
'cat'
|
381 |
-
'post__not_in'
|
382 |
-
'post__in'
|
383 |
-
'post_status'
|
384 |
-
'posts_per_page'
|
385 |
-
'ignore_sticky_posts'
|
|
|
|
|
|
|
|
|
|
|
|
|
386 |
);
|
387 |
|
388 |
-
//
|
389 |
-
if( ! empty( $exclude_post_formats_in ) ){
|
390 |
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
$post_format_terms[] = 'post-format-' . $_post_format;
|
395 |
-
}
|
396 |
-
|
397 |
-
// exclude the redundant taxonomies (post-format)
|
398 |
-
$args['tax_query'] = array(
|
399 |
-
array(
|
400 |
-
'taxonomy' => 'post_format',
|
401 |
-
'field' => 'slug',
|
402 |
-
'terms' => $post_format_terms,
|
403 |
-
'operator' => 'NOT IN'
|
404 |
-
)
|
405 |
-
);
|
406 |
-
|
407 |
-
}
|
408 |
-
|
409 |
-
// whether to exclude posts without featured-image or not
|
410 |
-
if( $exclude_without_media ){
|
411 |
-
$args['meta_query'] = array(
|
412 |
-
array(
|
413 |
-
'key' => '_thumbnail_id',
|
414 |
-
'value' => '',
|
415 |
-
'compare' => '!='
|
416 |
-
)
|
417 |
-
);
|
418 |
}
|
419 |
|
420 |
-
|
|
|
421 |
}
|
422 |
|
423 |
// widget header ------------------------------
|
13 |
function auxin_get_recent_posts_tiles_master_array( $master_array ) {
|
14 |
|
15 |
$categories = get_terms( 'category', 'orderby=count&hide_empty=0' );
|
16 |
+
$categories_list = array( ' ' => __('All Categories', 'auxin-elements' ) ) ;
|
17 |
foreach ( $categories as $key => $value ) {
|
18 |
$categories_list[$value->term_id] = $value->name;
|
19 |
}
|
57 |
'description' => __('Recent post title, leave it empty if you don`t need title.', 'auxin-elements'),
|
58 |
'param_name' => 'title',
|
59 |
'type' => 'textfield',
|
|
|
60 |
'value' => '',
|
61 |
'holder' => 'textfield',
|
62 |
'class' => 'title',
|
63 |
+
'admin_label' => false,
|
64 |
'dependency' => '',
|
65 |
'weight' => '',
|
66 |
+
'group' => '',
|
67 |
'edit_field_class' => ''
|
68 |
),
|
69 |
array(
|
70 |
'heading' => __('Categories', 'auxin-elements'),
|
71 |
'description' => __('Specifies a category that you want to show posts from it.', 'auxin-elements' ),
|
72 |
'param_name' => 'cat',
|
73 |
+
'type' => 'aux_select2_multiple',
|
74 |
+
'def_value' => ' ',
|
75 |
+
'holder' => '',
|
76 |
'class' => 'cat',
|
77 |
'value' => $categories_list,
|
78 |
+
'admin_label' => false,
|
79 |
'dependency' => '',
|
80 |
'weight' => '',
|
81 |
+
'group' => 'Query',
|
82 |
'edit_field_class' => ''
|
83 |
),
|
|
|
84 |
array(
|
85 |
'heading' => __('Number of posts to show', 'auxin-elements'),
|
86 |
'description' => '',
|
87 |
'param_name' => 'num',
|
88 |
'type' => 'textfield',
|
89 |
+
'value' => '8',
|
90 |
+
'holder' => '',
|
91 |
'class' => 'num',
|
92 |
+
'admin_label' => false,
|
93 |
'dependency' => '',
|
94 |
'weight' => '',
|
95 |
+
'group' => 'Query',
|
96 |
'edit_field_class' => ''
|
97 |
),
|
|
|
98 |
array(
|
99 |
'heading' => __('Exclude posts without media','auxin-elements' ),
|
100 |
'description' => '',
|
102 |
'type' => 'aux_switch',
|
103 |
'value' => '1',
|
104 |
'class' => '',
|
105 |
+
'admin_label' => false,
|
106 |
'dependency' => '',
|
107 |
'weight' => '',
|
108 |
+
'group' => 'Query',
|
109 |
'edit_field_class' => ''
|
110 |
),
|
|
|
111 |
array(
|
112 |
'heading' => __('Exclude custom post formats','auxin-elements' ),
|
113 |
'description' => '',
|
115 |
'type' => 'aux_switch',
|
116 |
'value' => '1',
|
117 |
'class' => '',
|
118 |
+
'admin_label' => false,
|
119 |
'dependency' => '',
|
120 |
'weight' => '',
|
121 |
+
'group' => 'Query',
|
122 |
'edit_field_class' => ''
|
123 |
),
|
|
|
124 |
array(
|
125 |
'heading' => __('Exclude quote and link post formats','auxin-elements' ),
|
126 |
'description' => '',
|
128 |
'type' => 'aux_switch',
|
129 |
'value' => '1',
|
130 |
'class' => '',
|
131 |
+
'admin_label' => false,
|
132 |
'dependency' => array(
|
133 |
'element' => 'exclude_custom_post_formats',
|
134 |
'value' => '0'
|
135 |
),
|
136 |
'weight' => '',
|
137 |
+
'group' => 'Query',
|
138 |
'edit_field_class' => ''
|
139 |
),
|
|
|
140 |
array(
|
141 |
+
'heading' => __('Order by', 'auxin-elements'),
|
142 |
+
'description' => '',
|
143 |
+
'param_name' => 'order_by',
|
144 |
+
'type' => 'dropdown',
|
145 |
+
'def_value' => 'date',
|
146 |
+
'holder' => '',
|
147 |
+
'class' => 'order_by',
|
148 |
+
'value' => array (
|
149 |
+
'date' => __('Date', 'auxin-elements'),
|
150 |
+
'menu_order date' => __('Menu Order', 'auxin-elements'),
|
151 |
+
'title' => __('Title', 'auxin-elements'),
|
152 |
+
'ID' => __('ID', 'auxin-elements'),
|
153 |
+
'rand' => __('Random', 'auxin-elements'),
|
154 |
+
'comment_count' => __('Comments', 'auxin-elements'),
|
155 |
+
'modified' => __('Date Modified', 'auxin-elements'),
|
156 |
+
'author' => __('Author', 'auxin-elements'),
|
157 |
+
'post__in' => __('Inserted Post IDs', 'auxin-elements')
|
158 |
+
),
|
159 |
+
'admin_label' => false,
|
160 |
+
'dependency' => '',
|
161 |
+
'weight' => '',
|
162 |
+
'group' => 'Query',
|
163 |
+
'edit_field_class' => ''
|
164 |
+
),
|
165 |
+
array(
|
166 |
+
'heading' => __('Order', 'auxin-elements'),
|
167 |
+
'description' => '',
|
168 |
+
'param_name' => 'order',
|
169 |
+
'type' => 'dropdown',
|
170 |
+
'def_value' => 'DESC',
|
171 |
+
'holder' => '',
|
172 |
+
'class' => 'order',
|
173 |
+
'value' =>array (
|
174 |
+
'DESC' => __('Descending', 'auxin-elements'),
|
175 |
+
'ASC' => __('Ascending', 'auxin-elements'),
|
176 |
+
),
|
177 |
+
'admin_label' => false,
|
178 |
+
'dependency' => '',
|
179 |
+
'weight' => '',
|
180 |
+
'group' => 'Query',
|
181 |
+
'edit_field_class' => ''
|
182 |
+
),
|
183 |
+
array(
|
184 |
+
'heading' => __('Only posts','auxin-elements' ),
|
185 |
+
'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' ),
|
186 |
+
'param_name' => 'only_posts__in',
|
187 |
'type' => 'textfield',
|
188 |
'value' => '',
|
189 |
+
'holder' => '',
|
190 |
'class' => '',
|
191 |
+
'admin_label' => false,
|
192 |
'dependency' => '',
|
193 |
'weight' => '',
|
194 |
+
'group' => 'Query',
|
195 |
'edit_field_class' => ''
|
196 |
),
|
197 |
array(
|
198 |
'heading' => __('Include posts','auxin-elements' ),
|
199 |
+
'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' ),
|
200 |
'param_name' => 'include',
|
201 |
'type' => 'textfield',
|
202 |
'value' => '',
|
203 |
+
'holder' => '',
|
204 |
'class' => '',
|
205 |
+
'admin_label' => false,
|
206 |
'dependency' => '',
|
207 |
'weight' => '',
|
208 |
+
'group' => 'Query',
|
209 |
+
'edit_field_class' => ''
|
210 |
+
),
|
211 |
+
array(
|
212 |
+
'heading' => __('Exclude posts','auxin-elements' ),
|
213 |
+
'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' ),
|
214 |
+
'param_name' => 'exclude',
|
215 |
+
'type' => 'textfield',
|
216 |
+
'value' => '',
|
217 |
+
'holder' => '',
|
218 |
+
'class' => '',
|
219 |
+
'admin_label' => false,
|
220 |
+
'dependency' => '',
|
221 |
+
'weight' => '',
|
222 |
+
'group' => 'Query',
|
223 |
'edit_field_class' => ''
|
224 |
),
|
225 |
array(
|
228 |
'param_name' => 'order_by',
|
229 |
'type' => 'dropdown',
|
230 |
'def_value' => 'date',
|
231 |
+
'holder' => '',
|
232 |
'class' => 'order_by',
|
233 |
'value' => array (
|
234 |
'date' => __('Date', 'auxin-elements'),
|
239 |
'comment_count' => __('Comments', 'auxin-elements'),
|
240 |
'modified' => __('Date Modified', 'auxin-elements'),
|
241 |
'author' => __('Author', 'auxin-elements'),
|
242 |
+
'post__in' => __('Inserted Post IDs', 'auxin-elements')
|
243 |
),
|
244 |
+
'admin_label' => false,
|
245 |
'dependency' => '',
|
246 |
'weight' => '',
|
247 |
+
'group' => 'Query',
|
248 |
'edit_field_class' => ''
|
249 |
),
|
250 |
+
array(
|
251 |
'heading' => __('Order', 'auxin-elements'),
|
252 |
'description' => '',
|
253 |
'param_name' => 'order',
|
254 |
'type' => 'dropdown',
|
255 |
'def_value' => 'DESC',
|
256 |
+
'holder' => '',
|
257 |
'class' => 'order',
|
258 |
'value' =>array (
|
259 |
'DESC' => __('Descending', 'auxin-elements'),
|
260 |
'ASC' => __('Ascending', 'auxin-elements'),
|
261 |
),
|
262 |
+
'admin_label' => false,
|
263 |
'dependency' => '',
|
264 |
'weight' => '',
|
265 |
+
'group' => 'Query',
|
266 |
'edit_field_class' => ''
|
267 |
),
|
|
|
268 |
array(
|
269 |
+
'heading' => __('Start offset','auxin-elements' ),
|
270 |
+
'description' => __('Number of post to displace or pass over.', 'auxin-elements' ),
|
271 |
+
'param_name' => 'offset',
|
272 |
+
'type' => 'textfield',
|
273 |
+
'value' => '',
|
274 |
+
'holder' => '',
|
275 |
+
'class' => '',
|
276 |
+
'admin_label' => false,
|
277 |
+
'dependency' => '',
|
278 |
+
'weight' => '',
|
279 |
+
'group' => 'Query',
|
280 |
'edit_field_class' => ''
|
281 |
),
|
|
|
282 |
array(
|
283 |
'heading' => __('Post tile style','auxin-elements' ),
|
284 |
'description' => '',
|
285 |
'param_name' => 'tile_style',
|
286 |
'type' => 'aux_visual_select',
|
287 |
+
'def_value' => '',
|
288 |
+
'holder' => '',
|
289 |
'class' => 'tile_style',
|
290 |
+
'admin_label' => false,
|
291 |
'dependency' => '',
|
292 |
'weight' => '',
|
293 |
+
'group' => 'Style',
|
294 |
'edit_field_class' => '',
|
295 |
'choices' => array(
|
296 |
+
'' => array(
|
297 |
+
'label' => __('Standard', 'auxin-elements' ),
|
298 |
+
'image' => AUX_URL . 'images/visual-select/button-normal.svg'
|
299 |
),
|
300 |
+
'aux-overlay' => array(
|
301 |
+
'label' => __('Dark', 'auxin-elements' ),
|
302 |
+
'image' => AUX_URL . 'images/visual-select/button-curved.svg'
|
303 |
)
|
304 |
)
|
305 |
),
|
|
|
306 |
array(
|
307 |
'heading' => __('Insert post title','auxin-elements' ),
|
308 |
'description' => '',
|
310 |
'type' => 'aux_switch',
|
311 |
'value' => '1',
|
312 |
'class' => 'display_title',
|
313 |
+
'admin_label' => false,
|
314 |
'dependency' => '',
|
315 |
'weight' => '',
|
316 |
'group' => '' ,
|
317 |
'edit_field_class' => ''
|
318 |
),
|
|
|
319 |
array(
|
320 |
'heading' => __('Insert post meta','auxin-elements' ),
|
321 |
'description' => '',
|
323 |
'type' => 'aux_switch',
|
324 |
'value' => '1',
|
325 |
'class' => '',
|
326 |
+
'admin_label' => false,
|
327 |
'weight' => '',
|
328 |
'group' => '' ,
|
329 |
'edit_field_class' => ''
|
330 |
),
|
|
|
331 |
array(
|
332 |
'heading' => __('Extra class name','auxin-elements' ),
|
333 |
'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' ),
|
334 |
'param_name' => 'extra_classes',
|
335 |
'type' => 'textfield',
|
336 |
'value' => '',
|
337 |
+
'holder' => '',
|
|
|
338 |
'class' => 'extra_classes',
|
339 |
+
'admin_label' => false,
|
340 |
'dependency' => '',
|
341 |
'weight' => '',
|
342 |
'group' => '',
|
367 |
$default_atts = array(
|
368 |
'title' => '', // header title
|
369 |
'cat' => ' ',
|
370 |
+
'num' => '8', // max generated entry
|
371 |
+
'only_posts__in' => '', // display only these post IDs. array or string comma separated
|
372 |
+
'include' => '', // include these post IDs in result too. array or string comma separated
|
373 |
+
'exclude' => '', // exclude these post IDs from result. array or string comma separated
|
374 |
'offset' => '',
|
375 |
'paged' => '',
|
376 |
+
'order_by' => 'date',
|
377 |
+
'order' => 'DESC',
|
378 |
'excerpt_len' => '160',
|
379 |
+
'exclude_without_media' => '1',
|
380 |
+
'exclude_custom_post_formats' => '1',
|
381 |
+
'exclude_quote_link' => '1',
|
382 |
'exclude_post_formats_in' => array(), // the list od post formats to exclude
|
383 |
'tile_style' => '',
|
384 |
+
'display_title' => '1',
|
385 |
+
'show_info' => '1',
|
386 |
'extra_classes' => '',
|
387 |
'custom_el_id' => '',
|
388 |
'reset_query' => true,
|
389 |
'use_wp_query' => false, // true to use the global wp_query, false to use internal custom query
|
390 |
+
'wp_query_args' => array(), // additional wp_query args
|
391 |
'base_class' => 'aux-widget-recent-posts-tiles'
|
392 |
);
|
393 |
|
420 |
|
421 |
// create wp_query to get latest items -----------
|
422 |
$args = array(
|
423 |
+
'post_type' => 'post',
|
424 |
+
'orderby' => $order_by,
|
425 |
+
'order' => $order,
|
426 |
+
'offset' => $offset,
|
427 |
+
'paged' => $paged,
|
428 |
+
'cat' => $cat,
|
429 |
+
'post__not_in' => array_filter( explode( ',', $exclude ) ),
|
430 |
+
'post__in' => array_filter( explode( ',', $include ) ),
|
431 |
+
'post_status' => 'publish',
|
432 |
+
'posts_per_page' => $num,
|
433 |
+
'ignore_sticky_posts' => 1,
|
434 |
+
'include_posts__in' => $include, // include posts in this liat
|
435 |
+
'posts__not_in' => $exclude, // exclude posts in this list
|
436 |
+
'posts__in' => $only_posts__in, // only posts in this list
|
437 |
+
|
438 |
+
'exclude_without_media' => $exclude_without_media,
|
439 |
+
'exclude_post_formats_in' => $exclude_post_formats_in
|
440 |
);
|
441 |
|
442 |
+
// ---------------------------------------------------------------------
|
|
|
443 |
|
444 |
+
// add the additional query args if available
|
445 |
+
if( $wp_query_args ){
|
446 |
+
$args = wp_parse_args( $args, $wp_query_args );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
447 |
}
|
448 |
|
449 |
+
// pass the args through the auxin query parser
|
450 |
+
$wp_query = new WP_Query( auxin_parse_query_args( $args ) );
|
451 |
}
|
452 |
|
453 |
// widget header ------------------------------
|
includes/elements/recent-posts-timeline.php
CHANGED
@@ -53,12 +53,12 @@ function auxin_get_recent_posts_timeline_master_array( $master_array ) {
|
|
53 |
'type' => 'textfield',
|
54 |
'std' => '',
|
55 |
'value' => '',
|
56 |
-
'holder' => '
|
57 |
'class' => 'title',
|
58 |
-
'admin_label' =>
|
59 |
'dependency' => '',
|
60 |
'weight' => '',
|
61 |
-
'group' => ''
|
62 |
'edit_field_class' => ''
|
63 |
),
|
64 |
array(
|
@@ -85,22 +85,22 @@ function auxin_get_recent_posts_timeline_master_array( $master_array ) {
|
|
85 |
'dependency' => '',
|
86 |
'admin_label' => false,
|
87 |
'weight' => '',
|
88 |
-
'group' => ''
|
89 |
'edit_field_class' => ''
|
90 |
),
|
91 |
array(
|
92 |
'heading' => __('Categories', 'auxin-elements'),
|
93 |
'description' => __('Specifies a category that you want to show posts from it.', 'auxin-elements' ),
|
94 |
'param_name' => 'cat',
|
95 |
-
'type' => '
|
96 |
'def_value' => ' ',
|
97 |
-
'holder' => '
|
98 |
'class' => 'cat',
|
99 |
'value' => $categories_list,
|
100 |
'admin_label' => true,
|
101 |
'dependency' => '',
|
102 |
'weight' => '',
|
103 |
-
'group' => ''
|
104 |
'edit_field_class' => ''
|
105 |
),
|
106 |
array(
|
@@ -108,13 +108,13 @@ function auxin_get_recent_posts_timeline_master_array( $master_array ) {
|
|
108 |
'description' => '',
|
109 |
'param_name' => 'num',
|
110 |
'type' => 'textfield',
|
111 |
-
'
|
112 |
-
'holder' => '
|
113 |
'class' => 'num',
|
114 |
-
'admin_label' =>
|
115 |
'dependency' => '',
|
116 |
'weight' => '',
|
117 |
-
'group' => ''
|
118 |
'edit_field_class' => ''
|
119 |
),
|
120 |
array(
|
@@ -124,12 +124,33 @@ function auxin_get_recent_posts_timeline_master_array( $master_array ) {
|
|
124 |
'type' => 'aux_switch',
|
125 |
'value' => '0',
|
126 |
'class' => '',
|
127 |
-
'admin_label' =>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
'dependency' => '',
|
129 |
'weight' => '',
|
130 |
-
'group' => ''
|
131 |
'edit_field_class' => ''
|
132 |
),
|
|
|
133 |
array(
|
134 |
'heading' => __('Exclude all custom post formats','auxin-elements' ),
|
135 |
'description' => '',
|
@@ -137,10 +158,10 @@ function auxin_get_recent_posts_timeline_master_array( $master_array ) {
|
|
137 |
'type' => 'aux_switch',
|
138 |
'value' => '0',
|
139 |
'class' => '',
|
140 |
-
'admin_label' =>
|
141 |
'dependency' => '',
|
142 |
'weight' => '',
|
143 |
-
'group' => ''
|
144 |
'edit_field_class' => ''
|
145 |
),
|
146 |
array(
|
@@ -150,41 +171,13 @@ function auxin_get_recent_posts_timeline_master_array( $master_array ) {
|
|
150 |
'type' => 'aux_switch',
|
151 |
'value' => '1',
|
152 |
'class' => '',
|
153 |
-
'admin_label' =>
|
154 |
'dependency' => array(
|
155 |
'element' => 'exclude_custom_post_formats',
|
156 |
'value' => '0'
|
157 |
),
|
158 |
'weight' => '',
|
159 |
-
'group' => ''
|
160 |
-
'edit_field_class' => ''
|
161 |
-
),
|
162 |
-
array(
|
163 |
-
'heading' => __('Exclude posts','auxin-elements' ),
|
164 |
-
'description' => __('Post IDs separated by comma (eg. 53,34,87,25)', 'auxin-elements' ),
|
165 |
-
'param_name' => 'exclude',
|
166 |
-
'type' => 'textfield',
|
167 |
-
'value' => '',
|
168 |
-
'holder' => 'textfield',
|
169 |
-
'class' => '',
|
170 |
-
'admin_label' => true,
|
171 |
-
'dependency' => '',
|
172 |
-
'weight' => '',
|
173 |
-
'group' => '' ,
|
174 |
-
'edit_field_class' => ''
|
175 |
-
),
|
176 |
-
array(
|
177 |
-
'heading' => __('Include posts','auxin-elements' ),
|
178 |
-
'description' => __('Post IDs separated by comma (eg. 53,34,87,25)', 'auxin-elements' ),
|
179 |
-
'param_name' => 'include',
|
180 |
-
'type' => 'textfield',
|
181 |
-
'value' => '',
|
182 |
-
'holder' => 'textfield',
|
183 |
-
'class' => '',
|
184 |
-
'admin_label' => true,
|
185 |
-
'dependency' => '',
|
186 |
-
'weight' => '',
|
187 |
-
'group' => '' ,
|
188 |
'edit_field_class' => ''
|
189 |
),
|
190 |
array(
|
@@ -193,7 +186,7 @@ function auxin_get_recent_posts_timeline_master_array( $master_array ) {
|
|
193 |
'param_name' => 'order_by',
|
194 |
'type' => 'dropdown',
|
195 |
'def_value' => 'date',
|
196 |
-
'holder' => '
|
197 |
'class' => 'order_by',
|
198 |
'value' => array (
|
199 |
'date' => __('Date', 'auxin-elements'),
|
@@ -204,11 +197,12 @@ function auxin_get_recent_posts_timeline_master_array( $master_array ) {
|
|
204 |
'comment_count' => __('Comments', 'auxin-elements'),
|
205 |
'modified' => __('Date Modified', 'auxin-elements'),
|
206 |
'author' => __('Author', 'auxin-elements'),
|
|
|
207 |
),
|
208 |
-
'admin_label' =>
|
209 |
'dependency' => '',
|
210 |
'weight' => '',
|
211 |
-
'group' => ''
|
212 |
'edit_field_class' => ''
|
213 |
),
|
214 |
array(
|
@@ -217,30 +211,72 @@ function auxin_get_recent_posts_timeline_master_array( $master_array ) {
|
|
217 |
'param_name' => 'order',
|
218 |
'type' => 'dropdown',
|
219 |
'def_value' => 'DESC',
|
220 |
-
'holder' => '
|
221 |
'class' => 'order',
|
222 |
'value' =>array (
|
223 |
'DESC' => __('Descending', 'auxin-elements'),
|
224 |
'ASC' => __('Ascending', 'auxin-elements'),
|
225 |
),
|
226 |
-
'admin_label' =>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
'dependency' => '',
|
228 |
'weight' => '',
|
229 |
-
'group' => ''
|
230 |
'edit_field_class' => ''
|
231 |
),
|
232 |
array(
|
233 |
-
'heading'
|
234 |
-
'description'
|
235 |
-
'param_name'
|
236 |
-
'type'
|
237 |
-
'value'
|
238 |
-
'holder'
|
239 |
-
'class'
|
240 |
-
'admin_label'
|
241 |
-
'dependency'
|
242 |
-
'weight'
|
243 |
-
'group'
|
244 |
'edit_field_class' => ''
|
245 |
),
|
246 |
array(
|
@@ -249,36 +285,14 @@ function auxin_get_recent_posts_timeline_master_array( $master_array ) {
|
|
249 |
'type' => 'aux_switch',
|
250 |
'def_value' => '',
|
251 |
'value' => '1',
|
252 |
-
'holder' => '
|
253 |
'class' => 'show_media',
|
254 |
-
'admin_label' =>
|
255 |
-
'dependency' => '',
|
256 |
-
'weight' => '',
|
257 |
-
'group' => '' ,
|
258 |
-
'edit_field_class' => ''
|
259 |
-
),
|
260 |
-
|
261 |
-
array(
|
262 |
-
'heading' => __('Image aspect ratio', 'auxin-elements'),
|
263 |
-
'description' => '',
|
264 |
-
'param_name' => 'image_aspect_ratio',
|
265 |
-
'type' => 'dropdown',
|
266 |
-
'def_value' => '0.75',
|
267 |
-
'holder' => 'dropdown',
|
268 |
-
'class' => 'order',
|
269 |
-
'value' =>array (
|
270 |
-
'0.75' => __('Horizontal 4:3' , 'auxin-elements'),
|
271 |
-
'0.56' => __('Horizontal 16:9', 'auxin-elements'),
|
272 |
-
'1.00' => __('Square 1:1' , 'auxin-elements'),
|
273 |
-
'1.33' => __('Vertical 3:4' , 'auxin-elements')
|
274 |
-
),
|
275 |
-
'admin_label' => true,
|
276 |
'dependency' => '',
|
277 |
'weight' => '',
|
278 |
-
'group' => ''
|
279 |
'edit_field_class' => ''
|
280 |
),
|
281 |
-
|
282 |
array(
|
283 |
'heading' => __('Display post title','auxin-elements' ),
|
284 |
'description' => '',
|
@@ -286,10 +300,10 @@ function auxin_get_recent_posts_timeline_master_array( $master_array ) {
|
|
286 |
'type' => 'aux_switch',
|
287 |
'value' => '1',
|
288 |
'class' => 'display_title',
|
289 |
-
'admin_label' =>
|
290 |
'dependency' => '',
|
291 |
'weight' => '',
|
292 |
-
'group' => ''
|
293 |
'edit_field_class' => ''
|
294 |
),
|
295 |
array(
|
@@ -299,9 +313,9 @@ function auxin_get_recent_posts_timeline_master_array( $master_array ) {
|
|
299 |
'type' => 'aux_switch',
|
300 |
'value' => '1',
|
301 |
'class' => '',
|
302 |
-
'admin_label' =>
|
303 |
'weight' => '',
|
304 |
-
'group' => ''
|
305 |
'edit_field_class' => ''
|
306 |
),
|
307 |
array(
|
@@ -311,12 +325,12 @@ function auxin_get_recent_posts_timeline_master_array( $master_array ) {
|
|
311 |
'type' => 'aux_switch',
|
312 |
'def_value' => '',
|
313 |
'value' => '1',
|
314 |
-
'holder' => '
|
315 |
'class' => 'show_excerpt',
|
316 |
-
'admin_label' =>
|
317 |
'dependency' => '',
|
318 |
'weight' => '',
|
319 |
-
'group' => ''
|
320 |
'edit_field_class' => ''
|
321 |
),
|
322 |
array(
|
@@ -325,15 +339,15 @@ function auxin_get_recent_posts_timeline_master_array( $master_array ) {
|
|
325 |
'param_name' => 'excerpt_len',
|
326 |
'type' => 'textfield',
|
327 |
'value' => '160',
|
328 |
-
'holder' => '
|
329 |
'class' => 'excerpt_len',
|
330 |
-
'admin_label' =>
|
331 |
'dependency' => array(
|
332 |
'element' => 'show_excerpt',
|
333 |
'value' => '1'
|
334 |
),
|
335 |
'weight' => '',
|
336 |
-
'group' => ''
|
337 |
'edit_field_class' => ''
|
338 |
),
|
339 |
array(
|
@@ -342,16 +356,16 @@ function auxin_get_recent_posts_timeline_master_array( $master_array ) {
|
|
342 |
'param_name' => 'author_or_readmore',
|
343 |
'type' => 'dropdown',
|
344 |
'def_value' => 'readmore',
|
345 |
-
'holder' => '
|
346 |
'class' => 'author_or_readmore',
|
347 |
'value' =>array (
|
348 |
'readmore' => __('Read More', 'auxin-elements'),
|
349 |
'author' => __('Author Name', 'auxin-elements'),
|
350 |
),
|
351 |
-
'admin_label' =>
|
352 |
'dependency' => '',
|
353 |
'weight' => '',
|
354 |
-
'group' => ''
|
355 |
'edit_field_class' => ''
|
356 |
),
|
357 |
array(
|
@@ -360,10 +374,9 @@ function auxin_get_recent_posts_timeline_master_array( $master_array ) {
|
|
360 |
'param_name' => 'extra_classes',
|
361 |
'type' => 'textfield',
|
362 |
'value' => '',
|
363 |
-
'
|
364 |
-
'holder' => 'textfield',
|
365 |
'class' => 'extra_classes',
|
366 |
-
'admin_label' =>
|
367 |
'dependency' => '',
|
368 |
'weight' => '',
|
369 |
'group' => '',
|
@@ -396,12 +409,13 @@ function auxin_widget_recent_posts_timeline_callback( $atts, $shortcode_content
|
|
396 |
'title' => '', // header title
|
397 |
'cat' => ' ',
|
398 |
'num' => '8',
|
399 |
-
'
|
400 |
-
'include' => '',
|
|
|
401 |
'paged' => '',
|
402 |
'offset' => '',
|
403 |
-
'order_by' => '
|
404 |
-
'order' => '
|
405 |
'exclude_without_media' => 0,
|
406 |
'exclude_custom_post_formats' => 0,
|
407 |
'exclude_quote_link' => 1,
|
@@ -421,6 +435,7 @@ function auxin_widget_recent_posts_timeline_callback( $atts, $shortcode_content
|
|
421 |
'custom_el_id' => '',
|
422 |
'reset_query' => true,
|
423 |
'use_wp_query' => false, // true to use the global wp_query, false to use internal custom query
|
|
|
424 |
'base_class' => 'aux-widget-recent-posts-timeline aux-column-post-entry'
|
425 |
);
|
426 |
|
@@ -461,52 +476,34 @@ function auxin_widget_recent_posts_timeline_callback( $atts, $shortcode_content
|
|
461 |
|
462 |
// create wp_query to get latest items -----------
|
463 |
$args = array(
|
464 |
-
'post_type'
|
465 |
-
'orderby'
|
466 |
-
'order'
|
467 |
-
'offset'
|
468 |
-
'paged'
|
469 |
-
'cat'
|
470 |
-
'post__not_in'
|
471 |
-
'post__in'
|
472 |
-
'post_status'
|
473 |
-
'posts_per_page'
|
474 |
-
'ignore_sticky_posts'
|
|
|
|
|
|
|
|
|
|
|
|
|
475 |
);
|
476 |
|
477 |
-
//
|
478 |
-
if( ! empty( $exclude_post_formats_in ) ){
|
479 |
-
|
480 |
-
// generate post-format terms (i.e post-format-aside)
|
481 |
-
$post_format_terms = array();
|
482 |
-
foreach ( $exclude_post_formats_in as $_post_format ) {
|
483 |
-
$post_format_terms[] = 'post-format-' . $_post_format;
|
484 |
-
}
|
485 |
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
'taxonomy' => 'post_format',
|
490 |
-
'field' => 'slug',
|
491 |
-
'terms' => $post_format_terms,
|
492 |
-
'operator' => 'NOT IN'
|
493 |
-
)
|
494 |
-
);
|
495 |
-
|
496 |
-
}
|
497 |
-
|
498 |
-
// whether to exclude posts without featured-image or not
|
499 |
-
if( $exclude_without_media ){
|
500 |
-
$args['meta_query'] = array(
|
501 |
-
array(
|
502 |
-
'key' => '_thumbnail_id',
|
503 |
-
'value' => '',
|
504 |
-
'compare' => '!='
|
505 |
-
)
|
506 |
-
);
|
507 |
}
|
508 |
|
509 |
-
|
|
|
510 |
}
|
511 |
|
512 |
// widget header ------------------------------
|
53 |
'type' => 'textfield',
|
54 |
'std' => '',
|
55 |
'value' => '',
|
56 |
+
'holder' => '',
|
57 |
'class' => 'title',
|
58 |
+
'admin_label' => false,
|
59 |
'dependency' => '',
|
60 |
'weight' => '',
|
61 |
+
'group' => '',
|
62 |
'edit_field_class' => ''
|
63 |
),
|
64 |
array(
|
85 |
'dependency' => '',
|
86 |
'admin_label' => false,
|
87 |
'weight' => '',
|
88 |
+
'group' => '',
|
89 |
'edit_field_class' => ''
|
90 |
),
|
91 |
array(
|
92 |
'heading' => __('Categories', 'auxin-elements'),
|
93 |
'description' => __('Specifies a category that you want to show posts from it.', 'auxin-elements' ),
|
94 |
'param_name' => 'cat',
|
95 |
+
'type' => 'aux_select2_multiple',
|
96 |
'def_value' => ' ',
|
97 |
+
'holder' => '',
|
98 |
'class' => 'cat',
|
99 |
'value' => $categories_list,
|
100 |
'admin_label' => true,
|
101 |
'dependency' => '',
|
102 |
'weight' => '',
|
103 |
+
'group' => 'Query',
|
104 |
'edit_field_class' => ''
|
105 |
),
|
106 |
array(
|
108 |
'description' => '',
|
109 |
'param_name' => 'num',
|
110 |
'type' => 'textfield',
|
111 |
+
'value' => '8',
|
112 |
+
'holder' => '',
|
113 |
'class' => 'num',
|
114 |
+
'admin_label' => false,
|
115 |
'dependency' => '',
|
116 |
'weight' => '',
|
117 |
+
'group' => 'Query',
|
118 |
'edit_field_class' => ''
|
119 |
),
|
120 |
array(
|
124 |
'type' => 'aux_switch',
|
125 |
'value' => '0',
|
126 |
'class' => '',
|
127 |
+
'admin_label' => false,
|
128 |
+
'dependency' => '',
|
129 |
+
'weight' => '',
|
130 |
+
'group' => 'Query',
|
131 |
+
'edit_field_class' => ''
|
132 |
+
),
|
133 |
+
array(
|
134 |
+
'heading' => __('Image aspect ratio', 'auxin-elements'),
|
135 |
+
'description' => '',
|
136 |
+
'param_name' => 'image_aspect_ratio',
|
137 |
+
'type' => 'dropdown',
|
138 |
+
'def_value' => '0.75',
|
139 |
+
'holder' => '',
|
140 |
+
'class' => 'order',
|
141 |
+
'value' =>array (
|
142 |
+
'0.75' => __('Horizontal 4:3' , 'auxin-elements'),
|
143 |
+
'0.56' => __('Horizontal 16:9', 'auxin-elements'),
|
144 |
+
'1.00' => __('Square 1:1' , 'auxin-elements'),
|
145 |
+
'1.33' => __('Vertical 3:4' , 'auxin-elements')
|
146 |
+
),
|
147 |
+
'admin_label' => false,
|
148 |
'dependency' => '',
|
149 |
'weight' => '',
|
150 |
+
'group' => '',
|
151 |
'edit_field_class' => ''
|
152 |
),
|
153 |
+
|
154 |
array(
|
155 |
'heading' => __('Exclude all custom post formats','auxin-elements' ),
|
156 |
'description' => '',
|
158 |
'type' => 'aux_switch',
|
159 |
'value' => '0',
|
160 |
'class' => '',
|
161 |
+
'admin_label' => false,
|
162 |
'dependency' => '',
|
163 |
'weight' => '',
|
164 |
+
'group' => 'Query',
|
165 |
'edit_field_class' => ''
|
166 |
),
|
167 |
array(
|
171 |
'type' => 'aux_switch',
|
172 |
'value' => '1',
|
173 |
'class' => '',
|
174 |
+
'admin_label' => false,
|
175 |
'dependency' => array(
|
176 |
'element' => 'exclude_custom_post_formats',
|
177 |
'value' => '0'
|
178 |
),
|
179 |
'weight' => '',
|
180 |
+
'group' => 'Query',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
'edit_field_class' => ''
|
182 |
),
|
183 |
array(
|
186 |
'param_name' => 'order_by',
|
187 |
'type' => 'dropdown',
|
188 |
'def_value' => 'date',
|
189 |
+
'holder' => '',
|
190 |
'class' => 'order_by',
|
191 |
'value' => array (
|
192 |
'date' => __('Date', 'auxin-elements'),
|
197 |
'comment_count' => __('Comments', 'auxin-elements'),
|
198 |
'modified' => __('Date Modified', 'auxin-elements'),
|
199 |
'author' => __('Author', 'auxin-elements'),
|
200 |
+
'post__in' => __('Inserted Post IDs', 'auxin-elements')
|
201 |
),
|
202 |
+
'admin_label' => false,
|
203 |
'dependency' => '',
|
204 |
'weight' => '',
|
205 |
+
'group' => 'Query',
|
206 |
'edit_field_class' => ''
|
207 |
),
|
208 |
array(
|
211 |
'param_name' => 'order',
|
212 |
'type' => 'dropdown',
|
213 |
'def_value' => 'DESC',
|
214 |
+
'holder' => '',
|
215 |
'class' => 'order',
|
216 |
'value' =>array (
|
217 |
'DESC' => __('Descending', 'auxin-elements'),
|
218 |
'ASC' => __('Ascending', 'auxin-elements'),
|
219 |
),
|
220 |
+
'admin_label' => false,
|
221 |
+
'dependency' => '',
|
222 |
+
'weight' => '',
|
223 |
+
'group' => 'Query',
|
224 |
+
'edit_field_class' => ''
|
225 |
+
),
|
226 |
+
array(
|
227 |
+
'heading' => __('Only posts','auxin-elements' ),
|
228 |
+
'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' ),
|
229 |
+
'param_name' => 'only_posts__in',
|
230 |
+
'type' => 'textfield',
|
231 |
+
'value' => '',
|
232 |
+
'holder' => '',
|
233 |
+
'class' => '',
|
234 |
+
'admin_label' => false,
|
235 |
+
'dependency' => '',
|
236 |
+
'weight' => '',
|
237 |
+
'group' => 'Query',
|
238 |
+
'edit_field_class' => ''
|
239 |
+
),
|
240 |
+
array(
|
241 |
+
'heading' => __('Include posts','auxin-elements' ),
|
242 |
+
'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' ),
|
243 |
+
'param_name' => 'include',
|
244 |
+
'type' => 'textfield',
|
245 |
+
'value' => '',
|
246 |
+
'holder' => '',
|
247 |
+
'class' => '',
|
248 |
+
'admin_label' => false,
|
249 |
+
'dependency' => '',
|
250 |
+
'weight' => '',
|
251 |
+
'group' => 'Query',
|
252 |
+
'edit_field_class' => ''
|
253 |
+
),
|
254 |
+
array(
|
255 |
+
'heading' => __('Exclude posts','auxin-elements' ),
|
256 |
+
'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' ),
|
257 |
+
'param_name' => 'exclude',
|
258 |
+
'type' => 'textfield',
|
259 |
+
'value' => '',
|
260 |
+
'holder' => '',
|
261 |
+
'class' => '',
|
262 |
+
'admin_label' => false,
|
263 |
'dependency' => '',
|
264 |
'weight' => '',
|
265 |
+
'group' => 'Query',
|
266 |
'edit_field_class' => ''
|
267 |
),
|
268 |
array(
|
269 |
+
'heading' => __('Start offset','auxin-elements' ),
|
270 |
+
'description' => __('Number of post to displace or pass over.', 'auxin-elements' ),
|
271 |
+
'param_name' => 'offset',
|
272 |
+
'type' => 'textfield',
|
273 |
+
'value' => '',
|
274 |
+
'holder' => '',
|
275 |
+
'class' => '',
|
276 |
+
'admin_label' => false,
|
277 |
+
'dependency' => '',
|
278 |
+
'weight' => '',
|
279 |
+
'group' => 'Query',
|
280 |
'edit_field_class' => ''
|
281 |
),
|
282 |
array(
|
285 |
'type' => 'aux_switch',
|
286 |
'def_value' => '',
|
287 |
'value' => '1',
|
288 |
+
'holder' => '',
|
289 |
'class' => 'show_media',
|
290 |
+
'admin_label' => false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
291 |
'dependency' => '',
|
292 |
'weight' => '',
|
293 |
+
'group' => '',
|
294 |
'edit_field_class' => ''
|
295 |
),
|
|
|
296 |
array(
|
297 |
'heading' => __('Display post title','auxin-elements' ),
|
298 |
'description' => '',
|
300 |
'type' => 'aux_switch',
|
301 |
'value' => '1',
|
302 |
'class' => 'display_title',
|
303 |
+
'admin_label' => false,
|
304 |
'dependency' => '',
|
305 |
'weight' => '',
|
306 |
+
'group' => '',
|
307 |
'edit_field_class' => ''
|
308 |
),
|
309 |
array(
|
313 |
'type' => 'aux_switch',
|
314 |
'value' => '1',
|
315 |
'class' => '',
|
316 |
+
'admin_label' => false,
|
317 |
'weight' => '',
|
318 |
+
'group' => '',
|
319 |
'edit_field_class' => ''
|
320 |
),
|
321 |
array(
|
325 |
'type' => 'aux_switch',
|
326 |
'def_value' => '',
|
327 |
'value' => '1',
|
328 |
+
'holder' => '',
|
329 |
'class' => 'show_excerpt',
|
330 |
+
'admin_label' => false,
|
331 |
'dependency' => '',
|
332 |
'weight' => '',
|
333 |
+
'group' => '',
|
334 |
'edit_field_class' => ''
|
335 |
),
|
336 |
array(
|
339 |
'param_name' => 'excerpt_len',
|
340 |
'type' => 'textfield',
|
341 |
'value' => '160',
|
342 |
+
'holder' => '',
|
343 |
'class' => 'excerpt_len',
|
344 |
+
'admin_label' => false,
|
345 |
'dependency' => array(
|
346 |
'element' => 'show_excerpt',
|
347 |
'value' => '1'
|
348 |
),
|
349 |
'weight' => '',
|
350 |
+
'group' => '',
|
351 |
'edit_field_class' => ''
|
352 |
),
|
353 |
array(
|
356 |
'param_name' => 'author_or_readmore',
|
357 |
'type' => 'dropdown',
|
358 |
'def_value' => 'readmore',
|
359 |
+
'holder' => '',
|
360 |
'class' => 'author_or_readmore',
|
361 |
'value' =>array (
|
362 |
'readmore' => __('Read More', 'auxin-elements'),
|
363 |
'author' => __('Author Name', 'auxin-elements'),
|
364 |
),
|
365 |
+
'admin_label' => false,
|
366 |
'dependency' => '',
|
367 |
'weight' => '',
|
368 |
+
'group' => '',
|
369 |
'edit_field_class' => ''
|
370 |
),
|
371 |
array(
|
374 |
'param_name' => 'extra_classes',
|
375 |
'type' => 'textfield',
|
376 |
'value' => '',
|
377 |
+
'holder' => '',
|
|
|
378 |
'class' => 'extra_classes',
|
379 |
+
'admin_label' => false,
|
380 |
'dependency' => '',
|
381 |
'weight' => '',
|
382 |
'group' => '',
|
409 |
'title' => '', // header title
|
410 |
'cat' => ' ',
|
411 |
'num' => '8',
|
412 |
+
'only_posts__in' => '', // display only these post IDs. array or string comma separated
|
413 |
+
'include' => '', // include these post IDs in result too. array or string comma separated
|
414 |
+
'exclude' => '', // exclude these post IDs from result. array or string comma separated
|
415 |
'paged' => '',
|
416 |
'offset' => '',
|
417 |
+
'order_by' => 'date',
|
418 |
+
'order' => 'DESC',
|
419 |
'exclude_without_media' => 0,
|
420 |
'exclude_custom_post_formats' => 0,
|
421 |
'exclude_quote_link' => 1,
|
435 |
'custom_el_id' => '',
|
436 |
'reset_query' => true,
|
437 |
'use_wp_query' => false, // true to use the global wp_query, false to use internal custom query
|
438 |
+
'wp_query_args' => array(), // additional wp_query args
|
439 |
'base_class' => 'aux-widget-recent-posts-timeline aux-column-post-entry'
|
440 |
);
|
441 |
|
476 |
|
477 |
// create wp_query to get latest items -----------
|
478 |
$args = array(
|
479 |
+
'post_type' => 'post',
|
480 |
+
'orderby' => $order_by,
|
481 |
+
'order' => $order,
|
482 |
+
'offset' => $offset,
|
483 |
+
'paged' => $paged,
|
484 |
+
'cat' => $cat,
|
485 |
+
'post__not_in' => array_filter( explode( ',', $exclude ) ),
|
486 |
+
'post__in' => array_filter( explode( ',', $include ) ),
|
487 |
+
'post_status' => 'publish',
|
488 |
+
'posts_per_page' => $num,
|
489 |
+
'ignore_sticky_posts' => 1,
|
490 |
+
'include_posts__in' => $include, // include posts in this liat
|
491 |
+
'posts__not_in' => $exclude, // exclude posts in this list
|
492 |
+
'posts__in' => $only_posts__in, // only posts in this list
|
493 |
+
|
494 |
+
'exclude_without_media' => $exclude_without_media,
|
495 |
+
'exclude_post_formats_in' => $exclude_post_formats_in
|
496 |
);
|
497 |
|
498 |
+
// ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
499 |
|
500 |
+
// add the additional query args if available
|
501 |
+
if( $wp_query_args ){
|
502 |
+
$args = wp_parse_args( $args, $wp_query_args );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
503 |
}
|
504 |
|
505 |
+
// pass the args through the auxin query parser
|
506 |
+
$wp_query = new WP_Query( auxin_parse_query_args( $args ) );
|
507 |
}
|
508 |
|
509 |
// widget header ------------------------------
|
includes/elements/search.php
CHANGED
@@ -43,10 +43,9 @@ function auxin_get_search_master_array( $master_array ) {
|
|
43 |
'param_name' => 'title',
|
44 |
'type' => 'textfield',
|
45 |
'value' => '',
|
46 |
-
'def_value' => '',
|
47 |
'holder' => 'textfield',
|
48 |
'class' => 'title',
|
49 |
-
'admin_label' =>
|
50 |
'dependency' => '',
|
51 |
'weight' => '',
|
52 |
'group' => '' ,
|
@@ -58,10 +57,9 @@ function auxin_get_search_master_array( $master_array ) {
|
|
58 |
'param_name' => 'extra_classes',
|
59 |
'type' => 'textfield',
|
60 |
'value' => '',
|
61 |
-
'
|
62 |
-
'holder' => 'textfield',
|
63 |
'class' => 'extra_classes',
|
64 |
-
'admin_label' =>
|
65 |
'dependency' => '',
|
66 |
'weight' => '',
|
67 |
'group' => '' ,
|
43 |
'param_name' => 'title',
|
44 |
'type' => 'textfield',
|
45 |
'value' => '',
|
|
|
46 |
'holder' => 'textfield',
|
47 |
'class' => 'title',
|
48 |
+
'admin_label' => false,
|
49 |
'dependency' => '',
|
50 |
'weight' => '',
|
51 |
'group' => '' ,
|
57 |
'param_name' => 'extra_classes',
|
58 |
'type' => 'textfield',
|
59 |
'value' => '',
|
60 |
+
'holder' => '',
|
|
|
61 |
'class' => 'extra_classes',
|
62 |
+
'admin_label' => false,
|
63 |
'dependency' => '',
|
64 |
'weight' => '',
|
65 |
'group' => '' ,
|
includes/elements/socials-list.php
CHANGED
@@ -22,7 +22,7 @@ function auxin_get_social_master_array( $master_array ) {
|
|
22 |
'is_widget' => true,
|
23 |
'is_shortcode' => true,
|
24 |
'is_so' => true,
|
25 |
-
'is_vc' =>
|
26 |
'category' => THEME_NAME,
|
27 |
'group' => '',
|
28 |
'admin_enqueue_js' => '',
|
@@ -47,10 +47,10 @@ function auxin_get_social_master_array( $master_array ) {
|
|
47 |
'def_value' => '',
|
48 |
'holder' => 'textfield',
|
49 |
'class' => 'id',
|
50 |
-
'admin_label' =>
|
51 |
'dependency' => '',
|
52 |
'weight' => '',
|
53 |
-
'group' => ''
|
54 |
'edit_field_class' => ''
|
55 |
),
|
56 |
array(
|
@@ -65,12 +65,12 @@ function auxin_get_social_master_array( $master_array ) {
|
|
65 |
'large' => __('Large' , 'auxin-elements'),
|
66 |
'extra-large' => __('Extra large' , 'auxin-elements')
|
67 |
),
|
68 |
-
'holder' => '
|
69 |
'class' => 'size',
|
70 |
-
'admin_label' =>
|
71 |
'dependency' => '',
|
72 |
'weight' => '',
|
73 |
-
'group' => ''
|
74 |
'edit_field_class' => ''
|
75 |
),
|
76 |
array(
|
@@ -83,14 +83,14 @@ function auxin_get_social_master_array( $master_array ) {
|
|
83 |
'horizontal' => __('Horizontal' , 'auxin-elements'),
|
84 |
'vertical' => __('Vertical' , 'auxin-elements')
|
85 |
),
|
86 |
-
'holder' => '
|
87 |
'class' => 'direction',
|
88 |
-
'admin_label' =>
|
89 |
'dependency' => '',
|
90 |
'weight' => '',
|
91 |
-
'group' => ''
|
92 |
'edit_field_class' => ''
|
93 |
-
)
|
94 |
|
95 |
)
|
96 |
);
|
22 |
'is_widget' => true,
|
23 |
'is_shortcode' => true,
|
24 |
'is_so' => true,
|
25 |
+
'is_vc' => true,
|
26 |
'category' => THEME_NAME,
|
27 |
'group' => '',
|
28 |
'admin_enqueue_js' => '',
|
47 |
'def_value' => '',
|
48 |
'holder' => 'textfield',
|
49 |
'class' => 'id',
|
50 |
+
'admin_label' => false,
|
51 |
'dependency' => '',
|
52 |
'weight' => '',
|
53 |
+
'group' => '',
|
54 |
'edit_field_class' => ''
|
55 |
),
|
56 |
array(
|
65 |
'large' => __('Large' , 'auxin-elements'),
|
66 |
'extra-large' => __('Extra large' , 'auxin-elements')
|
67 |
),
|
68 |
+
'holder' => '',
|
69 |
'class' => 'size',
|
70 |
+
'admin_label' => false,
|
71 |
'dependency' => '',
|
72 |
'weight' => '',
|
73 |
+
'group' => '',
|
74 |
'edit_field_class' => ''
|
75 |
),
|
76 |
array(
|
83 |
'horizontal' => __('Horizontal' , 'auxin-elements'),
|
84 |
'vertical' => __('Vertical' , 'auxin-elements')
|
85 |
),
|
86 |
+
'holder' => '',
|
87 |
'class' => 'direction',
|
88 |
+
'admin_label' => false,
|
89 |
'dependency' => '',
|
90 |
'weight' => '',
|
91 |
+
'group' => '',
|
92 |
'edit_field_class' => ''
|
93 |
+
)
|
94 |
|
95 |
)
|
96 |
);
|
includes/elements/tabs.php
CHANGED
@@ -20,6 +20,10 @@ function auxin_get_tabs_master_array( $master_array ) {
|
|
20 |
'show_settings_on_create' => true,
|
21 |
'so_api' => true,
|
22 |
'weight' => 1,
|
|
|
|
|
|
|
|
|
23 |
'category' => THEME_NAME,
|
24 |
'group' => '',
|
25 |
'admin_enqueue_js' => '',
|
20 |
'show_settings_on_create' => true,
|
21 |
'so_api' => true,
|
22 |
'weight' => 1,
|
23 |
+
'is_widget' => true,
|
24 |
+
'is_shortcode' => true,
|
25 |
+
'is_so' => true,
|
26 |
+
'is_vc' => false,
|
27 |
'category' => THEME_NAME,
|
28 |
'group' => '',
|
29 |
'admin_enqueue_js' => '',
|
includes/elements/text.php
CHANGED
@@ -303,15 +303,15 @@ function auxin_get_text_master_array( $master_array ) {
|
|
303 |
'def_value' => 'top',
|
304 |
'choices' => array(
|
305 |
'top' => array(
|
306 |
-
'label' => __('
|
307 |
'image' => AUX_URL . 'images/visual-select/column-icon-top.svg'
|
308 |
),
|
309 |
'left' => array(
|
310 |
-
'label' => __('
|
311 |
'image' => AUX_URL . 'images/visual-select/column-icon-left.svg'
|
312 |
),
|
313 |
'right' => array(
|
314 |
-
'label' => __('
|
315 |
'image' => AUX_URL . 'images/visual-select/column-icon-right.svg'
|
316 |
)
|
317 |
),
|
303 |
'def_value' => 'top',
|
304 |
'choices' => array(
|
305 |
'top' => array(
|
306 |
+
'label' => __('Top', 'auxin-elements'),
|
307 |
'image' => AUX_URL . 'images/visual-select/column-icon-top.svg'
|
308 |
),
|
309 |
'left' => array(
|
310 |
+
'label' => __('Left', 'auxin-elements'),
|
311 |
'image' => AUX_URL . 'images/visual-select/column-icon-left.svg'
|
312 |
),
|
313 |
'right' => array(
|
314 |
+
'label' => __('Right', 'auxin-elements'),
|
315 |
'image' => AUX_URL . 'images/visual-select/column-icon-right.svg'
|
316 |
)
|
317 |
),
|
includes/elements/touch-slider.php
CHANGED
@@ -45,12 +45,12 @@ function auxin_touch_slider_master_array( $master_array ) {
|
|
45 |
'param_name' => 'title',
|
46 |
'type' => 'textfield',
|
47 |
'value' => '',
|
48 |
-
'holder' => '
|
49 |
'class' => 'title',
|
50 |
-
'admin_label' =>
|
51 |
'dependency' => '',
|
52 |
'weight' => '',
|
53 |
-
'group' => ''
|
54 |
'edit_field_class' => ''
|
55 |
),
|
56 |
array(
|
@@ -59,13 +59,12 @@ function auxin_touch_slider_master_array( $master_array ) {
|
|
59 |
'param_name' => 'images',
|
60 |
'type' => 'attach_images',
|
61 |
'value' => '',
|
62 |
-
'
|
63 |
-
'holder' => 'attach_images',
|
64 |
'class' => 'images',
|
65 |
-
'admin_label' =>
|
66 |
'dependency' => '',
|
67 |
'weight' => '',
|
68 |
-
'group' => ''
|
69 |
'edit_field_class' => ''
|
70 |
),
|
71 |
array(
|
@@ -73,9 +72,9 @@ function auxin_touch_slider_master_array( $master_array ) {
|
|
73 |
'param_name' => 'width',
|
74 |
'type' => 'textfield',
|
75 |
'value' => '960',
|
76 |
-
'holder' => '
|
77 |
'class' => '',
|
78 |
-
'admin_label' =>
|
79 |
'dependency' => '',
|
80 |
'weight' => '',
|
81 |
'group' => '' ,
|
@@ -86,12 +85,12 @@ function auxin_touch_slider_master_array( $master_array ) {
|
|
86 |
'param_name' => 'height',
|
87 |
'type' => 'textfield',
|
88 |
'value' => '560',
|
89 |
-
'holder' => '
|
90 |
'class' => '',
|
91 |
-
'admin_label' =>
|
92 |
'dependency' => '',
|
93 |
'weight' => '',
|
94 |
-
'group' => ''
|
95 |
'edit_field_class' => ''
|
96 |
),
|
97 |
array(
|
@@ -101,10 +100,10 @@ function auxin_touch_slider_master_array( $master_array ) {
|
|
101 |
'type' => 'aux_switch',
|
102 |
'value' => '1',
|
103 |
'class' => '',
|
104 |
-
'admin_label' =>
|
105 |
'dependency' => '',
|
106 |
'weight' => '',
|
107 |
-
'group' => '
|
108 |
'edit_field_class' => ''
|
109 |
),
|
110 |
array(
|
@@ -112,12 +111,12 @@ function auxin_touch_slider_master_array( $master_array ) {
|
|
112 |
'param_name' => 'space',
|
113 |
'type' => 'textfield',
|
114 |
'value' => '5',
|
115 |
-
'holder' => '
|
116 |
'class' => '',
|
117 |
-
'admin_label' =>
|
118 |
'dependency' => '',
|
119 |
'weight' => '',
|
120 |
-
'group' => '
|
121 |
'edit_field_class' => ''
|
122 |
),
|
123 |
array(
|
@@ -127,10 +126,10 @@ function auxin_touch_slider_master_array( $master_array ) {
|
|
127 |
'type' => 'aux_switch',
|
128 |
'value' => '0',
|
129 |
'class' => '',
|
130 |
-
'admin_label' =>
|
131 |
'dependency' => '',
|
132 |
'weight' => '',
|
133 |
-
'group' => '
|
134 |
'edit_field_class' => ''
|
135 |
),
|
136 |
array(
|
@@ -143,7 +142,7 @@ function auxin_touch_slider_master_array( $master_array ) {
|
|
143 |
'admin_label' => true,
|
144 |
'dependency' => '',
|
145 |
'weight' => '',
|
146 |
-
'group' => '
|
147 |
'edit_field_class' => ''
|
148 |
),
|
149 |
array(
|
@@ -151,18 +150,17 @@ function auxin_touch_slider_master_array( $master_array ) {
|
|
151 |
'param_name' => 'slideshow_delay',
|
152 |
'type' => 'textfield',
|
153 |
'value' => '2',
|
154 |
-
'holder' => '
|
155 |
'class' => '',
|
156 |
-
'admin_label' =>
|
157 |
'dependency' => array(
|
158 |
'element' => 'slideshow',
|
159 |
'value' => '1'
|
160 |
),
|
161 |
'weight' => '',
|
162 |
-
'group' => '
|
163 |
'edit_field_class' => ''
|
164 |
),
|
165 |
-
|
166 |
array(
|
167 |
'heading' => __('Display image title','auxin-elements' ),
|
168 |
'description' => '',
|
@@ -170,10 +168,10 @@ function auxin_touch_slider_master_array( $master_array ) {
|
|
170 |
'type' => 'aux_switch',
|
171 |
'value' => '0',
|
172 |
'class' => '',
|
173 |
-
'admin_label' =>
|
174 |
'dependency' => '',
|
175 |
'weight' => '',
|
176 |
-
'group' => ''
|
177 |
'edit_field_class' => ''
|
178 |
),
|
179 |
array(
|
@@ -183,10 +181,10 @@ function auxin_touch_slider_master_array( $master_array ) {
|
|
183 |
'type' => 'aux_switch',
|
184 |
'value' => '0',
|
185 |
'class' => '',
|
186 |
-
'dependency' =>
|
187 |
-
'admin_label' =>
|
188 |
'weight' => '',
|
189 |
-
'group' => ''
|
190 |
'edit_field_class' => ''
|
191 |
)
|
192 |
)
|
@@ -214,23 +212,14 @@ function auxin_touch_slider_callback( $atts, $shortcode_content = null ){
|
|
214 |
'images' => '',
|
215 |
'width' => '960',
|
216 |
'height' => '560',
|
217 |
-
'loop' => '
|
218 |
'space' => '5',
|
219 |
'slideshow' => '0',
|
220 |
'slideshow_delay' => '2',
|
221 |
'arrows' => '1',
|
222 |
-
'
|
223 |
-
'
|
224 |
-
'add_caption' => false,
|
225 |
-
|
226 |
'skin' => 'aux-light-skin',
|
227 |
-
'width' => '960',
|
228 |
-
'height' => '560',
|
229 |
-
'loop' => '1',
|
230 |
-
'space' => '5',
|
231 |
-
'slideshow' => '0',
|
232 |
-
'slideshow_delay' => '2',
|
233 |
-
'arrows' => '0',
|
234 |
|
235 |
'extra_classes' => '', // custom css class names for this element
|
236 |
'custom_el_id' => '', // custom id attribute for this element
|
45 |
'param_name' => 'title',
|
46 |
'type' => 'textfield',
|
47 |
'value' => '',
|
48 |
+
'holder' => '',
|
49 |
'class' => 'title',
|
50 |
+
'admin_label' => false,
|
51 |
'dependency' => '',
|
52 |
'weight' => '',
|
53 |
+
'group' => '',
|
54 |
'edit_field_class' => ''
|
55 |
),
|
56 |
array(
|
59 |
'param_name' => 'images',
|
60 |
'type' => 'attach_images',
|
61 |
'value' => '',
|
62 |
+
'holder' => '',
|
|
|
63 |
'class' => 'images',
|
64 |
+
'admin_label' => false,
|
65 |
'dependency' => '',
|
66 |
'weight' => '',
|
67 |
+
'group' => '',
|
68 |
'edit_field_class' => ''
|
69 |
),
|
70 |
array(
|
72 |
'param_name' => 'width',
|
73 |
'type' => 'textfield',
|
74 |
'value' => '960',
|
75 |
+
'holder' => '',
|
76 |
'class' => '',
|
77 |
+
'admin_label' => false,
|
78 |
'dependency' => '',
|
79 |
'weight' => '',
|
80 |
'group' => '' ,
|
85 |
'param_name' => 'height',
|
86 |
'type' => 'textfield',
|
87 |
'value' => '560',
|
88 |
+
'holder' => '',
|
89 |
'class' => '',
|
90 |
+
'admin_label' => false,
|
91 |
'dependency' => '',
|
92 |
'weight' => '',
|
93 |
+
'group' => '',
|
94 |
'edit_field_class' => ''
|
95 |
),
|
96 |
array(
|
100 |
'type' => 'aux_switch',
|
101 |
'value' => '1',
|
102 |
'class' => '',
|
103 |
+
'admin_label' => false,
|
104 |
'dependency' => '',
|
105 |
'weight' => '',
|
106 |
+
'group' => 'Style',
|
107 |
'edit_field_class' => ''
|
108 |
),
|
109 |
array(
|
111 |
'param_name' => 'space',
|
112 |
'type' => 'textfield',
|
113 |
'value' => '5',
|
114 |
+
'holder' => '',
|
115 |
'class' => '',
|
116 |
+
'admin_label' => false,
|
117 |
'dependency' => '',
|
118 |
'weight' => '',
|
119 |
+
'group' => 'Style',
|
120 |
'edit_field_class' => ''
|
121 |
),
|
122 |
array(
|
126 |
'type' => 'aux_switch',
|
127 |
'value' => '0',
|
128 |
'class' => '',
|
129 |
+
'admin_label' => false,
|
130 |
'dependency' => '',
|
131 |
'weight' => '',
|
132 |
+
'group' => 'Style',
|
133 |
'edit_field_class' => ''
|
134 |
),
|
135 |
array(
|
142 |
'admin_label' => true,
|
143 |
'dependency' => '',
|
144 |
'weight' => '',
|
145 |
+
'group' => 'Style',
|
146 |
'edit_field_class' => ''
|
147 |
),
|
148 |
array(
|
150 |
'param_name' => 'slideshow_delay',
|
151 |
'type' => 'textfield',
|
152 |
'value' => '2',
|
153 |
+
'holder' => '',
|
154 |
'class' => '',
|
155 |
+
'admin_label' => false,
|
156 |
'dependency' => array(
|
157 |
'element' => 'slideshow',
|
158 |
'value' => '1'
|
159 |
),
|
160 |
'weight' => '',
|
161 |
+
'group' => 'Style',
|
162 |
'edit_field_class' => ''
|
163 |
),
|
|
|
164 |
array(
|
165 |
'heading' => __('Display image title','auxin-elements' ),
|
166 |
'description' => '',
|
168 |
'type' => 'aux_switch',
|
169 |
'value' => '0',
|
170 |
'class' => '',
|
171 |
+
'admin_label' => false,
|
172 |
'dependency' => '',
|
173 |
'weight' => '',
|
174 |
+
'group' => 'Style',
|
175 |
'edit_field_class' => ''
|
176 |
),
|
177 |
array(
|
181 |
'type' => 'aux_switch',
|
182 |
'value' => '0',
|
183 |
'class' => '',
|
184 |
+
'dependency' => '',
|
185 |
+
'admin_label' => false,
|
186 |
'weight' => '',
|
187 |
+
'group' => 'Style',
|
188 |
'edit_field_class' => ''
|
189 |
)
|
190 |
)
|
212 |
'images' => '',
|
213 |
'width' => '960',
|
214 |
'height' => '560',
|
215 |
+
'loop' => '0',
|
216 |
'space' => '5',
|
217 |
'slideshow' => '0',
|
218 |
'slideshow_delay' => '2',
|
219 |
'arrows' => '1',
|
220 |
+
'add_title' => '0',
|
221 |
+
'add_caption' => '0',
|
|
|
|
|
222 |
'skin' => 'aux-light-skin',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
|
224 |
'extra_classes' => '', // custom css class names for this element
|
225 |
'custom_el_id' => '', // custom id attribute for this element
|
includes/elements/video.php
CHANGED
@@ -40,13 +40,12 @@ function auxin_get_video_master_array( $master_array ) {
|
|
40 |
'param_name' => 'title',
|
41 |
'type' => 'textfield',
|
42 |
'value' => '',
|
43 |
-
'def_value' => '',
|
44 |
'holder' => 'textfield',
|
45 |
'class' => 'title',
|
46 |
-
'admin_label' =>
|
47 |
'dependency' => '',
|
48 |
'weight' => '',
|
49 |
-
'group' => ''
|
50 |
'edit_field_class' => ''
|
51 |
),
|
52 |
array(
|
@@ -54,13 +53,12 @@ function auxin_get_video_master_array( $master_array ) {
|
|
54 |
'description' => __('Whether to start the video automatically or not.','auxin-elements'),
|
55 |
'param_name' => 'autoplay',
|
56 |
'type' => 'aux_switch',
|
57 |
-
'def_value' => '0',
|
58 |
'value' => '0',
|
59 |
'class' => 'autoplay',
|
60 |
-
'admin_label' =>
|
61 |
'dependency' => '',
|
62 |
'weight' => '',
|
63 |
-
'group' => ''
|
64 |
'edit_field_class' => ''
|
65 |
),
|
66 |
array(
|
@@ -68,13 +66,12 @@ function auxin_get_video_master_array( $master_array ) {
|
|
68 |
'description' => __('Play video again when it ends.','auxin-elements'),
|
69 |
'param_name' => 'loop',
|
70 |
'type' => 'aux_switch',
|
71 |
-
'def_value' => '0',
|
72 |
'value' => '0',
|
73 |
'class' => 'loop',
|
74 |
'admin_label' => true,
|
75 |
'dependency' => '',
|
76 |
'weight' => '',
|
77 |
-
'group' => '
|
78 |
'edit_field_class' => ''
|
79 |
),
|
80 |
array(
|
@@ -82,14 +79,13 @@ function auxin_get_video_master_array( $master_array ) {
|
|
82 |
'description' => __('Width size of video in pixel.','auxin-elements'),
|
83 |
'param_name' => 'width',
|
84 |
'type' => 'textfield',
|
85 |
-
'value' => '',
|
86 |
-
'
|
87 |
-
'holder' => 'textfield',
|
88 |
'class' => '',
|
89 |
-
'admin_label' =>
|
90 |
'dependency' => '',
|
91 |
'weight' => '',
|
92 |
-
'group' => ''
|
93 |
'edit_field_class' => ''
|
94 |
),
|
95 |
array(
|
@@ -97,14 +93,13 @@ function auxin_get_video_master_array( $master_array ) {
|
|
97 |
'description' => __('Height size of video in pixel.','auxin-elements'),
|
98 |
'param_name' => 'height',
|
99 |
'type' => 'textfield',
|
100 |
-
'value' => '',
|
101 |
-
'
|
102 |
-
'holder' => 'textfield',
|
103 |
'class' => '',
|
104 |
-
'admin_label' =>
|
105 |
'dependency' => '',
|
106 |
'weight' => '',
|
107 |
-
'group' => ''
|
108 |
'edit_field_class' => ''
|
109 |
),
|
110 |
array(
|
@@ -113,13 +108,12 @@ function auxin_get_video_master_array( $master_array ) {
|
|
113 |
'param_name' => 'src',
|
114 |
'type' => 'aux_select_video',
|
115 |
'value' => '',
|
116 |
-
'
|
117 |
-
'holder' => 'aux_select_video',
|
118 |
'class' => '',
|
119 |
-
'admin_label' =>
|
120 |
'dependency' => '',
|
121 |
'weight' => '',
|
122 |
-
'group' => ''
|
123 |
'edit_field_class' => ''
|
124 |
),
|
125 |
array(
|
@@ -128,13 +122,12 @@ function auxin_get_video_master_array( $master_array ) {
|
|
128 |
'param_name' => 'url',
|
129 |
'type' => 'textfield',
|
130 |
'value' => '',
|
131 |
-
'
|
132 |
-
'holder' => 'textfield',
|
133 |
'class' => '',
|
134 |
-
'admin_label' =>
|
135 |
'dependency' => '',
|
136 |
'weight' => '',
|
137 |
-
'group' => ''
|
138 |
'edit_field_class' => ''
|
139 |
),
|
140 |
array(
|
@@ -143,17 +136,16 @@ function auxin_get_video_master_array( $master_array ) {
|
|
143 |
'param_name' => 'poster',
|
144 |
'type' => 'textfield',
|
145 |
'value' => '',
|
146 |
-
'
|
147 |
-
'holder' => 'textfield',
|
148 |
'class' => '',
|
149 |
-
'admin_label' =>
|
150 |
'dependency' => '',
|
151 |
'weight' => '',
|
152 |
-
'group' => ''
|
153 |
'edit_field_class' => ''
|
154 |
),
|
155 |
array(
|
156 |
-
'heading' => __('Player skin
|
157 |
'description' => __('Specifies skin for the player.','auxin-elements'),
|
158 |
'param_name' => 'skin',
|
159 |
'type' => 'aux_visual_select',
|
@@ -168,12 +160,12 @@ function auxin_get_video_master_array( $master_array ) {
|
|
168 |
'image' => AUX_URL . 'images/visual-select/audio-player-light.svg'
|
169 |
)
|
170 |
),
|
171 |
-
'holder' => '
|
172 |
'class' => 'skin',
|
173 |
'admin_label' => true,
|
174 |
'dependency' => '',
|
175 |
'weight' => '',
|
176 |
-
'group' => '
|
177 |
'edit_field_class' => ''
|
178 |
),
|
179 |
array(
|
@@ -182,13 +174,12 @@ function auxin_get_video_master_array( $master_array ) {
|
|
182 |
'param_name' => 'extra_classes',
|
183 |
'type' => 'textfield',
|
184 |
'value' => '',
|
185 |
-
'
|
186 |
-
'holder' => 'textfield',
|
187 |
'class' => 'extra_classes',
|
188 |
-
'admin_label' =>
|
189 |
'dependency' => '',
|
190 |
'weight' => '',
|
191 |
-
'group' => '
|
192 |
'edit_field_class' => ''
|
193 |
)
|
194 |
|
@@ -217,7 +208,7 @@ function auxin_widget_video_callback( $atts, $shortcode_content = null ){
|
|
217 |
'url' => '', // embed video link
|
218 |
'src' => '', // quick set for mp4 file
|
219 |
'poster' => '',
|
220 |
-
'skin' => '', // dark or light
|
221 |
|
222 |
'extra_classes' => '', // custom css class names for this element
|
223 |
'custom_el_id' => '', // custom id attribute for this element
|
40 |
'param_name' => 'title',
|
41 |
'type' => 'textfield',
|
42 |
'value' => '',
|
|
|
43 |
'holder' => 'textfield',
|
44 |
'class' => 'title',
|
45 |
+
'admin_label' => false,
|
46 |
'dependency' => '',
|
47 |
'weight' => '',
|
48 |
+
'group' => '',
|
49 |
'edit_field_class' => ''
|
50 |
),
|
51 |
array(
|
53 |
'description' => __('Whether to start the video automatically or not.','auxin-elements'),
|
54 |
'param_name' => 'autoplay',
|
55 |
'type' => 'aux_switch',
|
|
|
56 |
'value' => '0',
|
57 |
'class' => 'autoplay',
|
58 |
+
'admin_label' => false,
|
59 |
'dependency' => '',
|
60 |
'weight' => '',
|
61 |
+
'group' => '',
|
62 |
'edit_field_class' => ''
|
63 |
),
|
64 |
array(
|
66 |
'description' => __('Play video again when it ends.','auxin-elements'),
|
67 |
'param_name' => 'loop',
|
68 |
'type' => 'aux_switch',
|
|
|
69 |
'value' => '0',
|
70 |
'class' => 'loop',
|
71 |
'admin_label' => true,
|
72 |
'dependency' => '',
|
73 |
'weight' => '',
|
74 |
+
'group' => '',
|
75 |
'edit_field_class' => ''
|
76 |
),
|
77 |
array(
|
79 |
'description' => __('Width size of video in pixel.','auxin-elements'),
|
80 |
'param_name' => 'width',
|
81 |
'type' => 'textfield',
|
82 |
+
'value' => '1200',
|
83 |
+
'holder' => '',
|
|
|
84 |
'class' => '',
|
85 |
+
'admin_label' => false,
|
86 |
'dependency' => '',
|
87 |
'weight' => '',
|
88 |
+
'group' => 'Style',
|
89 |
'edit_field_class' => ''
|
90 |
),
|
91 |
array(
|
93 |
'description' => __('Height size of video in pixel.','auxin-elements'),
|
94 |
'param_name' => 'height',
|
95 |
'type' => 'textfield',
|
96 |
+
'value' => '675',
|
97 |
+
'holder' => '',
|
|
|
98 |
'class' => '',
|
99 |
+
'admin_label' => false,
|
100 |
'dependency' => '',
|
101 |
'weight' => '',
|
102 |
+
'group' => 'Style',
|
103 |
'edit_field_class' => ''
|
104 |
),
|
105 |
array(
|
108 |
'param_name' => 'src',
|
109 |
'type' => 'aux_select_video',
|
110 |
'value' => '',
|
111 |
+
'holder' => '',
|
|
|
112 |
'class' => '',
|
113 |
+
'admin_label' => false,
|
114 |
'dependency' => '',
|
115 |
'weight' => '',
|
116 |
+
'group' => '',
|
117 |
'edit_field_class' => ''
|
118 |
),
|
119 |
array(
|
122 |
'param_name' => 'url',
|
123 |
'type' => 'textfield',
|
124 |
'value' => '',
|
125 |
+
'holder' => '',
|
|
|
126 |
'class' => '',
|
127 |
+
'admin_label' => false,
|
128 |
'dependency' => '',
|
129 |
'weight' => '',
|
130 |
+
'group' => '',
|
131 |
'edit_field_class' => ''
|
132 |
),
|
133 |
array(
|
136 |
'param_name' => 'poster',
|
137 |
'type' => 'textfield',
|
138 |
'value' => '',
|
139 |
+
'holder' => '',
|
|
|
140 |
'class' => '',
|
141 |
+
'admin_label' => false,
|
142 |
'dependency' => '',
|
143 |
'weight' => '',
|
144 |
+
'group' => '',
|
145 |
'edit_field_class' => ''
|
146 |
),
|
147 |
array(
|
148 |
+
'heading' => __('Player skin','auxin-elements'),
|
149 |
'description' => __('Specifies skin for the player.','auxin-elements'),
|
150 |
'param_name' => 'skin',
|
151 |
'type' => 'aux_visual_select',
|
160 |
'image' => AUX_URL . 'images/visual-select/audio-player-light.svg'
|
161 |
)
|
162 |
),
|
163 |
+
'holder' => '',
|
164 |
'class' => 'skin',
|
165 |
'admin_label' => true,
|
166 |
'dependency' => '',
|
167 |
'weight' => '',
|
168 |
+
'group' => 'Style',
|
169 |
'edit_field_class' => ''
|
170 |
),
|
171 |
array(
|
174 |
'param_name' => 'extra_classes',
|
175 |
'type' => 'textfield',
|
176 |
'value' => '',
|
177 |
+
'holder' => '',
|
|
|
178 |
'class' => 'extra_classes',
|
179 |
+
'admin_label' => false,
|
180 |
'dependency' => '',
|
181 |
'weight' => '',
|
182 |
+
'group' => '',
|
183 |
'edit_field_class' => ''
|
184 |
)
|
185 |
|
208 |
'url' => '', // embed video link
|
209 |
'src' => '', // quick set for mp4 file
|
210 |
'poster' => '',
|
211 |
+
'skin' => 'dark', // dark or light
|
212 |
|
213 |
'extra_classes' => '', // custom css class names for this element
|
214 |
'custom_el_id' => '', // custom id attribute for this element
|
includes/general-functions.php
CHANGED
@@ -22,3 +22,874 @@ if( ! function_exists( 'auxin_is_plugin_active' ) ){
|
|
22 |
}
|
23 |
}
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
}
|
23 |
}
|
24 |
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Retrieves the markup for footer logo element
|
28 |
+
*
|
29 |
+
* @param array $args The properties fort this element
|
30 |
+
*
|
31 |
+
* @return string The markup for logo element
|
32 |
+
*/
|
33 |
+
function auxin_get_footer_logo_block( $args = array() ){
|
34 |
+
|
35 |
+
$defaults = array(
|
36 |
+
'css_class' => '',
|
37 |
+
'middle' => true
|
38 |
+
);
|
39 |
+
|
40 |
+
$args = wp_parse_args( $args, $defaults );
|
41 |
+
|
42 |
+
ob_start();
|
43 |
+
?>
|
44 |
+
<div class="aux-logo <?php echo $args['css_class']; ?>">
|
45 |
+
<a class="aux-logo-anchor <?php echo ($args['middle'] ? 'aux-middle' : ''); ?>" href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
|
46 |
+
<?php echo _auxin_get_footer_logo_image(); ?>
|
47 |
+
</a>
|
48 |
+
</div><!-- end logo aux-fold -->
|
49 |
+
|
50 |
+
<?php
|
51 |
+
return ob_get_clean();
|
52 |
+
}
|
53 |
+
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Retrieves the footer logo image tag
|
57 |
+
*
|
58 |
+
* @return string The markup for logo image
|
59 |
+
*/
|
60 |
+
function _auxin_get_footer_logo_image(){
|
61 |
+
|
62 |
+
return wp_get_attachment_image( auxin_get_option('site_secondary_logo_image'), 'full', false, array(
|
63 |
+
'class' => 'aux-logo-image aux-logo-dark',
|
64 |
+
'itemprop' => 'logo',
|
65 |
+
'alt' => esc_attr( get_bloginfo( 'name', 'display' ) )
|
66 |
+
) );
|
67 |
+
|
68 |
+
}
|
69 |
+
|
70 |
+
//// is absolute url ///////////////////////////////////////////////////////////////////
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Whether it's absolute url or not
|
74 |
+
*
|
75 |
+
* @param string $url The URL
|
76 |
+
* @return bool TRUE if the URL is absolute
|
77 |
+
*/
|
78 |
+
|
79 |
+
if( ! function_exists( "auxin_is_absolute_url" ) ){
|
80 |
+
|
81 |
+
function auxin_is_absolute_url( $url ){
|
82 |
+
return preg_match( "~^(?:f|ht)tps?://~i", $url );
|
83 |
+
}
|
84 |
+
|
85 |
+
}
|
86 |
+
|
87 |
+
|
88 |
+
//// create absolute url if the url is relative ////////////////////////////////////////
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Print absolute URL for media file even if the URL is relative
|
92 |
+
*
|
93 |
+
* @param string $url The link to media file
|
94 |
+
* @return void
|
95 |
+
*/
|
96 |
+
function auxin_the_absolute_image_url( $url ){
|
97 |
+
echo auxin_get_the_absolute_image_url( $url );
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Get absolute URL for media file event if the URL is relative
|
102 |
+
*
|
103 |
+
* @param string $url The link to media file
|
104 |
+
* @return string The absolute URL to media file
|
105 |
+
*/
|
106 |
+
if( ! function_exists( 'auxin_get_the_absolute_image_url' ) ){
|
107 |
+
|
108 |
+
function auxin_get_the_absolute_image_url( $url ){
|
109 |
+
if( ! isset( $url ) || empty( $url ) ) return '';
|
110 |
+
|
111 |
+
if( auxin_is_absolute_url( $url ) || auxin_contains_upload_dir( $url ) ) return $url;
|
112 |
+
|
113 |
+
$uploads = wp_get_upload_dir();
|
114 |
+
return trailingslashit( $uploads['baseurl'] ) . $url;
|
115 |
+
}
|
116 |
+
|
117 |
+
}
|
118 |
+
|
119 |
+
//// get all registerd siderbar ids ///////////////////////////////////////////////////
|
120 |
+
|
121 |
+
if( ! function_exists( 'auxin_get_all_sidebar_ids' ) ){
|
122 |
+
|
123 |
+
function auxin_get_all_sidebar_ids(){
|
124 |
+
$sidebars = get_option( THEME_ID.'_sidebars');
|
125 |
+
$output = array();
|
126 |
+
|
127 |
+
if( isset( $auxin_sidebars ) && ! empty( $auxin_sidebars ) ){
|
128 |
+
foreach( $sidebars as $key => $value ) {
|
129 |
+
$output[] = THEME_ID .'-'. strtolower( str_replace(' ', '-', $value) );
|
130 |
+
}
|
131 |
+
}
|
132 |
+
return $output;
|
133 |
+
}
|
134 |
+
|
135 |
+
}
|
136 |
+
|
137 |
+
//// remove all auto generated p tags from shortcode content //////////////////////////
|
138 |
+
|
139 |
+
if( ! function_exists( "auxin_do_cleanup_shortcode" ) ){
|
140 |
+
|
141 |
+
function auxin_do_cleanup_shortcode( $content ) {
|
142 |
+
|
143 |
+
/* Parse nested shortcodes and add formatting. */
|
144 |
+
$content = trim( wpautop( do_shortcode( $content ) ) );
|
145 |
+
|
146 |
+
/* Remove any instances of '<p>' '</p>'. */
|
147 |
+
$content = auxin_cleanup_content( $content );
|
148 |
+
|
149 |
+
return $content;
|
150 |
+
}
|
151 |
+
|
152 |
+
}
|
153 |
+
|
154 |
+
|
155 |
+
//// remove all p tags from string ////////////////////////////////////////////////////
|
156 |
+
|
157 |
+
if( ! function_exists( 'auxin_cleanup_content' ) ){
|
158 |
+
|
159 |
+
function auxin_cleanup_content( $content ) {
|
160 |
+
/* Remove any instances of '<p>' '</p>'. */
|
161 |
+
return str_replace( array('<p>','</p>'), array('','') , $content );
|
162 |
+
}
|
163 |
+
|
164 |
+
}
|
165 |
+
|
166 |
+
/*-----------------------------------------------------------------------------------*/
|
167 |
+
/* A function that makes excluding featured image, post formats and post ids simpler
|
168 |
+
/*-----------------------------------------------------------------------------------*/
|
169 |
+
|
170 |
+
if( ! function_exists( 'auxin_parse_query_args' ) ){
|
171 |
+
|
172 |
+
|
173 |
+
/**
|
174 |
+
* A function that makes excluding featured image, post formats and post ids simpler
|
175 |
+
*
|
176 |
+
* @param array $args The list of options and query params
|
177 |
+
* @return array The parsed args as array
|
178 |
+
*/
|
179 |
+
function auxin_parse_query_args( $args ){
|
180 |
+
|
181 |
+
$defaults = array(
|
182 |
+
'post_type' => 'post',
|
183 |
+
'post_status' => 'publish',
|
184 |
+
'posts_per_page' => -1,
|
185 |
+
'ignore_sticky_posts' => 1,
|
186 |
+
|
187 |
+
'posts__in' => '', // display only these post IDs. array or string comma separated
|
188 |
+
'posts__not_in' => '', // exclude these post IDs from result. array or string comma separated
|
189 |
+
|
190 |
+
'include_posts__in' => '', // include these post IDs in result too. array or string comma separated
|
191 |
+
'exclude_without_media' => 0, // exclude the posts without featured image
|
192 |
+
'exclude_post_formats_in' => '', // exclude the post with these post formats
|
193 |
+
);
|
194 |
+
|
195 |
+
// parse and merge the passed args
|
196 |
+
$parsed_args = wp_parse_args( $args, $defaults );
|
197 |
+
|
198 |
+
|
199 |
+
// Exclude post formats ----------------------------------------------------
|
200 |
+
|
201 |
+
// exclude post formats if specified
|
202 |
+
if( ! empty( $parsed_args['exclude_post_formats_in'] ) ){
|
203 |
+
|
204 |
+
// generate post-format terms (i.e post-format-aside)
|
205 |
+
$post_format_terms = array();
|
206 |
+
foreach ( $parsed_args['exclude_post_formats_in'] as $_post_format ) {
|
207 |
+
$post_format_terms[] = 'post-format-' . $_post_format;
|
208 |
+
}
|
209 |
+
|
210 |
+
// exclude the redundant taxonomies (post-format)
|
211 |
+
$parsed_args['tax_query'] = array(
|
212 |
+
array(
|
213 |
+
'taxonomy' => 'post_format',
|
214 |
+
'field' => 'slug',
|
215 |
+
'terms' => $post_format_terms,
|
216 |
+
'operator' => 'NOT IN'
|
217 |
+
)
|
218 |
+
);
|
219 |
+
|
220 |
+
}
|
221 |
+
|
222 |
+
// Exclude posts without featured image ------------------------------------
|
223 |
+
|
224 |
+
// whether to exclude posts without featured-image or not
|
225 |
+
if( $parsed_args['exclude_without_media'] ){
|
226 |
+
$parsed_args['meta_query'] = array(
|
227 |
+
array(
|
228 |
+
'key' => '_thumbnail_id',
|
229 |
+
'value' => '',
|
230 |
+
'compare' => '!='
|
231 |
+
)
|
232 |
+
);
|
233 |
+
}
|
234 |
+
|
235 |
+
|
236 |
+
// Include, Exclude & Replace Post IDs -------------------------------------
|
237 |
+
|
238 |
+
// get the list of custom post ids to display
|
239 |
+
$only_posts = $parsed_args['posts__in'] ? wp_parse_id_list( $parsed_args['posts__in'] ) : array();
|
240 |
+
|
241 |
+
// get the list of custom post ids to include
|
242 |
+
$include_posts = $parsed_args['include_posts__in'] ? wp_parse_id_list( $parsed_args['include_posts__in'] ) : array();
|
243 |
+
|
244 |
+
// get the list of custom post ids to exclude
|
245 |
+
$exclude_posts = $parsed_args['posts__not_in'] ? wp_parse_id_list( $parsed_args['posts__not_in'] ) : array();
|
246 |
+
|
247 |
+
|
248 |
+
// if both of post__in and post__not_in options are defined, we have to array_diff the arrays,
|
249 |
+
// because we cannot use post__in & post__not_in at the time in WordPress
|
250 |
+
|
251 |
+
if( $only_posts ){
|
252 |
+
|
253 |
+
if( $exclude_posts ){
|
254 |
+
// remove the excluded post ids from post__in list
|
255 |
+
if( $only_posts = array_filter( array_diff( $only_posts, $exclude_posts ) ) ){
|
256 |
+
$parsed_args['post__in'] = $only_posts;
|
257 |
+
}
|
258 |
+
} else {
|
259 |
+
$parsed_args['post__in'] = $only_posts;
|
260 |
+
}
|
261 |
+
$parsed_args['posts__not_in'] = '';
|
262 |
+
|
263 |
+
// if include_posts__in was specified
|
264 |
+
} else if( $include_posts ){
|
265 |
+
|
266 |
+
$extra_query_args = $parsed_args;
|
267 |
+
|
268 |
+
// query the posts other than the ones we intend to include
|
269 |
+
$include_and_exclude_posts = array_unique( array_filter( array_merge( $include_posts, $exclude_posts ) ) );
|
270 |
+
// remove the excluded post ids from include_posts__in list
|
271 |
+
$the_posts_to_include = array_diff( $include_posts, $exclude_posts );
|
272 |
+
|
273 |
+
$extra_query_args['fields'] = 'ids'; // just get IDs, for better performance
|
274 |
+
$extra_query_args['post__in'] = ''; // forget post__in in this pre query
|
275 |
+
$extra_query_args['post__not_in'] = $include_and_exclude_posts; // dont select our include adn exclude posts in this query, we will prepend them later
|
276 |
+
|
277 |
+
// get the post ids other than our include and exclude list
|
278 |
+
$other_post_ids = get_posts( $extra_query_args );
|
279 |
+
|
280 |
+
// prepend the included post ids
|
281 |
+
$merged_post_ids = array_merge( $the_posts_to_include, $other_post_ids );
|
282 |
+
|
283 |
+
// change the main query base on previous result
|
284 |
+
$parsed_args = array(
|
285 |
+
'post__in' => $merged_post_ids,
|
286 |
+
'orderby' => 'post__in', // query base on the order of defined post ids
|
287 |
+
'posts_per_page' => $parsed_args['posts_per_page'],
|
288 |
+
'ignore_sticky_posts' => 1
|
289 |
+
);
|
290 |
+
|
291 |
+
// if just "post__not_in" option is specified
|
292 |
+
} else if( $exclude_posts ) {
|
293 |
+
$parsed_args['post__not_in'] = $exclude_posts;
|
294 |
+
}
|
295 |
+
|
296 |
+
// Remove extra query args -------------------------------------------------
|
297 |
+
|
298 |
+
unset( $parsed_args['include_posts__in'] );
|
299 |
+
unset( $parsed_args['exclude_without_media'] );
|
300 |
+
unset( $parsed_args['exclude_post_formats_in'] );
|
301 |
+
|
302 |
+
return $parsed_args;
|
303 |
+
}
|
304 |
+
|
305 |
+
}
|
306 |
+
|
307 |
+
|
308 |
+
|
309 |
+
/*-----------------------------------------------------------------------------------*/
|
310 |
+
/* Extract only raw text - remove all special charecters, html tags, js and css codes
|
311 |
+
/*-----------------------------------------------------------------------------------*/
|
312 |
+
|
313 |
+
function auxin_extract_text( $content = null ) {
|
314 |
+
// decode encoded html tags
|
315 |
+
$content = htmlspecialchars_decode($content);
|
316 |
+
// remove script tag and inline js content
|
317 |
+
$content = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $content);
|
318 |
+
// remove style tag and inline css content
|
319 |
+
$content = preg_replace('#<style(.*?)>(.*?)</style>#is' , '', $content);
|
320 |
+
// remove iframe content
|
321 |
+
$content = preg_replace('#<if'.'rame(.*?)>(.*?)</iframe>#is', '', $content);
|
322 |
+
// remove extra white spaces
|
323 |
+
$content = preg_replace('/[\s]+/', ' ', $content );
|
324 |
+
// strip html tags and escape special charecters
|
325 |
+
$content = esc_attr(strip_tags($content));
|
326 |
+
// remove double space
|
327 |
+
$content = preg_replace('/\s{3,}/',' ', $content );
|
328 |
+
return $content;
|
329 |
+
}
|
330 |
+
|
331 |
+
/*-----------------------------------------------------------------------------------*/
|
332 |
+
/* Tiles layout patterns
|
333 |
+
/*-----------------------------------------------------------------------------------*/
|
334 |
+
|
335 |
+
/**
|
336 |
+
* Defines the size of post tile based on pattern and given index
|
337 |
+
* @param string $pattern
|
338 |
+
* @param int $index
|
339 |
+
* @return Array classname, image size
|
340 |
+
*/
|
341 |
+
function auxin_get_tile_pattern( $pattern = 'default', $index, $column_media_width ) {
|
342 |
+
|
343 |
+
$div_index = $index % 12;
|
344 |
+
$return_value = array();
|
345 |
+
|
346 |
+
switch ( $div_index ) {
|
347 |
+
|
348 |
+
// large squares
|
349 |
+
case 0:
|
350 |
+
case 7:
|
351 |
+
$return_value = array(
|
352 |
+
'classname' => 'aux-tile-2-2 aux-t-tile-4-2 aux-m-tile-4-2',
|
353 |
+
'size' => array( 'width' => 2 * $column_media_width, 'height' => 2 * $column_media_width ),
|
354 |
+
'image_sizes' => array(
|
355 |
+
array( 'min' => '' , 'max' => '992px', 'width' => '100vw' ),
|
356 |
+
array( 'min' => '' , 'max' => '', 'width' => 2 * $column_media_width . 'px' )
|
357 |
+
),
|
358 |
+
'srcset_sizes' => array(
|
359 |
+
array( 'width' => 2 * $column_media_width, 'height' => 2 * $column_media_width ),
|
360 |
+
array( 'width' => 4 * $column_media_width, 'height' => 4 * $column_media_width ),
|
361 |
+
array( 'width' => 8 * $column_media_width, 'height' => 8 * $column_media_width )
|
362 |
+
)
|
363 |
+
);
|
364 |
+
break;
|
365 |
+
|
366 |
+
// full width
|
367 |
+
case 5:
|
368 |
+
case 11:
|
369 |
+
$return_value = array(
|
370 |
+
'classname' => 'aux-tile-4-2',
|
371 |
+
'size' => array( 'width' => $column_media_width, 'height' => $column_media_width * 0.5 ),
|
372 |
+
'image_sizes' => array(
|
373 |
+
|
374 |
+
),
|
375 |
+
'srcset_sizes' => array(
|
376 |
+
array( 'width' => $column_media_width, 'height' => $column_media_width * 0.5),
|
377 |
+
array( 'width' => 2 * $column_media_width, 'height' => 2 * $column_media_width * 0.5),
|
378 |
+
array( 'width' => 4 * $column_media_width, 'height' => 4 * $column_media_width * 0.5 )
|
379 |
+
)
|
380 |
+
);
|
381 |
+
break;
|
382 |
+
|
383 |
+
// small squares
|
384 |
+
default:
|
385 |
+
$return_value = array(
|
386 |
+
'classname' => 'aux-tile-1-1 aux-t-tile-2-2 aux-m-tile-4-2',
|
387 |
+
'size' => array( 'width' => $column_media_width, 'height' => $column_media_width ),
|
388 |
+
'image_sizes' => array(
|
389 |
+
array( 'min' => '', 'max' => '767px', 'width' => '100vw' ),
|
390 |
+
array( 'min' => '' , 'max' => '992px', 'width' => '50vw' ),
|
391 |
+
array( 'min' => '' , 'max' => '', 'width' => $column_media_width . 'px' )
|
392 |
+
),
|
393 |
+
'srcset_sizes' => array(
|
394 |
+
array( 'width' => $column_media_width, 'height' => $column_media_width ),
|
395 |
+
array( 'width' => 2 * $column_media_width, 'height' => 2 * $column_media_width ),
|
396 |
+
array( 'width' => 4 * $column_media_width, 'height' => 4 * $column_media_width )
|
397 |
+
)
|
398 |
+
);
|
399 |
+
|
400 |
+
}
|
401 |
+
|
402 |
+
return $return_value;
|
403 |
+
}
|
404 |
+
|
405 |
+
|
406 |
+
/*-----------------------------------------------------------------------------------*/
|
407 |
+
/* Retrieves the provider from an embed code link
|
408 |
+
/*-----------------------------------------------------------------------------------*/
|
409 |
+
|
410 |
+
|
411 |
+
function auxin_extract_embed_provider_name( $src ){
|
412 |
+
require_once( ABSPATH . WPINC . '/class-oembed.php' );
|
413 |
+
$oembed = _wp_oembed_get_object();
|
414 |
+
if( ! $provider = $oembed->get_provider( $src ) ){
|
415 |
+
return '';
|
416 |
+
}
|
417 |
+
|
418 |
+
$provider_info = parse_url( $provider );
|
419 |
+
if( $provider_info['host'] ){
|
420 |
+
$host_parts = explode( '.', $provider_info['host'] );
|
421 |
+
$host_parts_num = count( $host_parts );
|
422 |
+
if( $host_parts_num > 1 ){
|
423 |
+
return $host_parts[ $host_parts_num -2 ];
|
424 |
+
}
|
425 |
+
}
|
426 |
+
|
427 |
+
return '';
|
428 |
+
}
|
429 |
+
|
430 |
+
|
431 |
+
|
432 |
+
//// Store content in file ////////////////////////////////////////////////////////
|
433 |
+
|
434 |
+
/**
|
435 |
+
* Creates and stores content in a file (#admin)
|
436 |
+
*
|
437 |
+
* @param string $content The content for writing in the file
|
438 |
+
* @param string $file_location The address that we plan to create the file in.
|
439 |
+
*
|
440 |
+
* @return boolean Returns true if the file is created and updated successfully, false on failure
|
441 |
+
*/
|
442 |
+
function auxin_put_contents( $content, $file_location = '', $chmode = 0644 ){
|
443 |
+
|
444 |
+
if( empty( $file_location ) ){
|
445 |
+
return false;
|
446 |
+
}
|
447 |
+
|
448 |
+
/**
|
449 |
+
* Initialize the WP_Filesystem
|
450 |
+
*/
|
451 |
+
global $wp_filesystem;
|
452 |
+
if ( empty( $wp_filesystem ) ) {
|
453 |
+
require_once ( ABSPATH.'/wp-admin/includes/file.php' );
|
454 |
+
WP_Filesystem();
|
455 |
+
}
|
456 |
+
|
457 |
+
// Write the content, if possible
|
458 |
+
if ( wp_mkdir_p( dirname( $file_location ) ) && ! $wp_filesystem->put_contents( $file_location, $content, $chmode ) ) {
|
459 |
+
// If writing the content in the file was not successful
|
460 |
+
return false;
|
461 |
+
} else {
|
462 |
+
return true;
|
463 |
+
}
|
464 |
+
|
465 |
+
}
|
466 |
+
|
467 |
+
|
468 |
+
//// Stores content in custom js file /////////////////////////////////////////////
|
469 |
+
|
470 |
+
|
471 |
+
/**
|
472 |
+
* Stores JavaScript content in custom js file (#admin)
|
473 |
+
*
|
474 |
+
* @return boolean Returns true if the file is created and updated successfully, false on failure
|
475 |
+
*/
|
476 |
+
function auxin_save_custom_js(){
|
477 |
+
|
478 |
+
$js_string = get_option( THEME_ID.'_custom_js_string' );
|
479 |
+
|
480 |
+
ob_start();
|
481 |
+
?>
|
482 |
+
/*
|
483 |
+
===============================================================
|
484 |
+
#CUSTOM JavaScript
|
485 |
+
- Please do not edit this file. This file is generated from admin area.
|
486 |
+
- Every changes here will be overwritten by theme
|
487 |
+
===============================================================*/
|
488 |
+
<?php
|
489 |
+
|
490 |
+
$js_string = ob_get_clean() . $js_string;
|
491 |
+
|
492 |
+
|
493 |
+
if ( auxin_put_contents_dir( $js_string, 'custom.js' ) ) {
|
494 |
+
update_option( THEME_ID.'_custom_js_ver', rand(10, 99)/10 ); // disable inline css output
|
495 |
+
update_option( THEME_ID.'_inline_custom_js' , false ); // disable inline css output
|
496 |
+
|
497 |
+
return true;
|
498 |
+
} else {
|
499 |
+
// if the directory is not writable, try inline css fallback
|
500 |
+
update_option( THEME_ID.'_inline_custom_js' , true ); // save css rules as option to print as inline css
|
501 |
+
|
502 |
+
return false;
|
503 |
+
}
|
504 |
+
}
|
505 |
+
|
506 |
+
|
507 |
+
/**
|
508 |
+
* Removes an specific content from custom js file (#admin)
|
509 |
+
*
|
510 |
+
* @param string $ref_name The reference name for referring a content in $js_array array
|
511 |
+
*
|
512 |
+
* @return boolean Returns true if the content was removed successfully, false on failure
|
513 |
+
*/
|
514 |
+
function auxin_remove_custom_js( $ref_name = '' ){
|
515 |
+
|
516 |
+
// retrieve the js array list
|
517 |
+
$js_array = get_option( THEME_ID.'_custom_js_array', array() );
|
518 |
+
|
519 |
+
if( isset( $js_array[ $ref_name ] ) ){
|
520 |
+
unset( $js_array[ $ref_name ] );
|
521 |
+
|
522 |
+
update_option( THEME_ID.'_custom_js_array' , $js_array );
|
523 |
+
// update the file content too
|
524 |
+
auxin_add_custom_js();
|
525 |
+
}
|
526 |
+
}
|
527 |
+
|
528 |
+
|
529 |
+
/**
|
530 |
+
* Retrieves the list of custom scripts generated with themes options
|
531 |
+
*
|
532 |
+
* @param string $exclude_ref_names The reference names that are expected to be excluded from result
|
533 |
+
*
|
534 |
+
* @return boolean The list of custom scripts generated with themes options
|
535 |
+
*/
|
536 |
+
function auxin_get_custom_js_array( $exclude_ref_names = array() ){
|
537 |
+
// retrieve the css array list
|
538 |
+
$js_array = get_option( THEME_ID.'_custom_js_array', array() );
|
539 |
+
|
540 |
+
return array_diff_key( $js_array, array_flip( (array) $exclude_ref_names ) );
|
541 |
+
}
|
542 |
+
|
543 |
+
|
544 |
+
|
545 |
+
//// Stores content in custom css file /////////////////////////////////////////////
|
546 |
+
|
547 |
+
|
548 |
+
/**
|
549 |
+
* Stores css content in custom css file (#admin)
|
550 |
+
*
|
551 |
+
* @return boolean Returns true if the file is created and updated successfully, false on failure
|
552 |
+
*/
|
553 |
+
function auxin_save_custom_css(){
|
554 |
+
|
555 |
+
$css_string = get_option( THEME_ID.'_custom_css_string' );
|
556 |
+
|
557 |
+
ob_start();
|
558 |
+
?>
|
559 |
+
/*
|
560 |
+
===============================================================
|
561 |
+
#CUSTOM CSS
|
562 |
+
- Please do not edit this file. This file is generated from admin area.
|
563 |
+
- Every changes here will be overwritten by theme
|
564 |
+
===============================================================*/
|
565 |
+
<?php
|
566 |
+
|
567 |
+
$css_string = ob_get_clean() . $css_string;
|
568 |
+
|
569 |
+
if ( auxin_put_contents_dir( $css_string, 'custom.css' ) ) {
|
570 |
+
|
571 |
+
update_option( THEME_ID.'_custom_css_ver', rand(10, 99)/10 );
|
572 |
+
update_option( THEME_ID.'_inline_custom_css' , false ); // disable inline css output
|
573 |
+
|
574 |
+
return true;
|
575 |
+
// if the directory is not writable, try inline css fallback
|
576 |
+
} else {
|
577 |
+
update_option( THEME_ID.'_inline_custom_css' , true ); // save css rules as option to print as inline css
|
578 |
+
return false;
|
579 |
+
}
|
580 |
+
}
|
581 |
+
|
582 |
+
|
583 |
+
/**
|
584 |
+
* Removes an specific content from custom css file (#admin)
|
585 |
+
*
|
586 |
+
* @param string $ref_name The reference name for referring a content in $css_array array
|
587 |
+
*
|
588 |
+
* @return boolean Returns true if the content was removed successfully, false on failure
|
589 |
+
*/
|
590 |
+
function auxin_remove_custom_css( $ref_name = '' ){
|
591 |
+
|
592 |
+
// retrieve the css array list
|
593 |
+
$css_array = get_option( THEME_ID.'_custom_css_array', array() );
|
594 |
+
|
595 |
+
if( isset( $css_array[ $ref_name ] ) ){
|
596 |
+
unset( $css_array[ $ref_name ] );
|
597 |
+
|
598 |
+
update_option( THEME_ID.'_custom_css_array' , $css_array );
|
599 |
+
// update the file content too
|
600 |
+
auxin_add_custom_css();
|
601 |
+
}
|
602 |
+
}
|
603 |
+
|
604 |
+
|
605 |
+
/**
|
606 |
+
* Retrieves the list of custom styles generated with themes options
|
607 |
+
*
|
608 |
+
* @param string $exclude_ref_names The reference names that are expected to be excluded from result
|
609 |
+
*
|
610 |
+
* @return boolean The list of custom styles generated with themes options
|
611 |
+
*/
|
612 |
+
function auxin_get_custom_css_array( $exclude_ref_names = array() ){
|
613 |
+
// retrieve the css array list
|
614 |
+
$css_array = get_option( THEME_ID.'_custom_css_array', array() );
|
615 |
+
|
616 |
+
return array_diff_key( $css_array, array_flip( (array) $exclude_ref_names ) );
|
617 |
+
}
|
618 |
+
|
619 |
+
|
620 |
+
/**
|
621 |
+
* Retrieves the custom styles generated with themes options
|
622 |
+
*
|
623 |
+
* @param string $exclude_ref_names The css reference names that are expected to be excluded from result
|
624 |
+
*
|
625 |
+
* @return boolean The custom styles generated with themes options
|
626 |
+
*/
|
627 |
+
function auxin_get_custom_css_string( $exclude_ref_names = array() ){
|
628 |
+
// retrieve the css array list
|
629 |
+
$css_array = auxin_get_custom_css_array( (array) $exclude_ref_names );
|
630 |
+
$css_string = '';
|
631 |
+
|
632 |
+
$sep_comment = apply_filters( 'auxin_custom_css_sep_comment', "/* %s \n=========================*/\n" );
|
633 |
+
|
634 |
+
// Convert the contents in array to string
|
635 |
+
if( is_array( $css_array ) ){
|
636 |
+
foreach ( $css_array as $node_ref => $node_content ) {
|
637 |
+
if( ! is_numeric( $node_ref) ){
|
638 |
+
$css_string .= sprintf( $sep_comment, str_replace( '_', '-', $node_ref ) );
|
639 |
+
}
|
640 |
+
$css_string .= "$node_content\n";
|
641 |
+
}
|
642 |
+
}
|
643 |
+
|
644 |
+
// Remove <style> if user used them in the style content
|
645 |
+
return str_replace( array( "<style>", "</style>" ), array('', ''), $css_string );
|
646 |
+
}
|
647 |
+
|
648 |
+
|
649 |
+
/**
|
650 |
+
* Extract numbers from string
|
651 |
+
*
|
652 |
+
* @param string $str The string that contains numbers
|
653 |
+
* @param int $default The number which should be returned if no number found in the string
|
654 |
+
* @return int The extracted numbers
|
655 |
+
*/
|
656 |
+
function auxin_get_numerics( $str, $default = null ) {
|
657 |
+
if( empty( $str ) ){
|
658 |
+
return is_numeric( $default ) ? $default: '';
|
659 |
+
}
|
660 |
+
preg_match('/\d+/', $str, $matches);
|
661 |
+
return $matches[0];
|
662 |
+
}
|
663 |
+
|
664 |
+
/*-----------------------------------------------------------------------------------*/
|
665 |
+
/* Returns post type menu name
|
666 |
+
/*-----------------------------------------------------------------------------------*/
|
667 |
+
|
668 |
+
if( ! function_exists( 'auxin_get_post_type_name' ) ){
|
669 |
+
|
670 |
+
// returns post type menu name
|
671 |
+
function auxin_get_post_type_name( $post_type = '' ){
|
672 |
+
$post_type = empty( $post_type ) ? get_post_type() : $post_type;
|
673 |
+
$post_type_obj = get_post_type_object( $post_type );
|
674 |
+
|
675 |
+
return apply_filters( 'auxin_get_post_type_name', $post_type_obj->labels->menu_name, $post_type );
|
676 |
+
}
|
677 |
+
|
678 |
+
}
|
679 |
+
|
680 |
+
|
681 |
+
/*-----------------------------------------------------------------------------------*/
|
682 |
+
/* A function to generate header and footer for all widgets
|
683 |
+
/*-----------------------------------------------------------------------------------*/
|
684 |
+
|
685 |
+
function auxin_get_widget_scafold( $atts, $default_atts, $shortcode_content = '' ){
|
686 |
+
|
687 |
+
$result = array(
|
688 |
+
'parsed_atts' => '',
|
689 |
+
'widget_info' => '',
|
690 |
+
'widget_header' => '',
|
691 |
+
'widget_title' => '',
|
692 |
+
'widget_footer' => ''
|
693 |
+
);
|
694 |
+
|
695 |
+
// ----
|
696 |
+
if( ! isset( $default_atts['extra_classes'] ) ){
|
697 |
+
$default_atts['extra_classes'] = '';
|
698 |
+
}
|
699 |
+
if( ! isset( $default_atts['custom_el_id'] ) ){
|
700 |
+
$default_atts['custom_el_id'] = '';
|
701 |
+
}
|
702 |
+
if( ! isset( $default_atts['content'] ) ){
|
703 |
+
$default_atts['content'] = '';
|
704 |
+
}
|
705 |
+
|
706 |
+
// Widget general info
|
707 |
+
$before_widget = $after_widget = '';
|
708 |
+
$before_title = $after_title = '';
|
709 |
+
|
710 |
+
// If widget info is passed, extract them in above variables
|
711 |
+
if( isset( $atts['widget_info'] ) ){
|
712 |
+
$result['widget_info'] = $atts['widget_info'];
|
713 |
+
extract( $atts['widget_info'] );
|
714 |
+
}
|
715 |
+
// CSS class names for section -------------
|
716 |
+
|
717 |
+
// The default CSS classes for widget container
|
718 |
+
// Note that 'widget-container' should be in all element
|
719 |
+
$_css_classes = array( 'widget-container' );
|
720 |
+
|
721 |
+
// Parse shortcode attributes
|
722 |
+
$parsed_atts = shortcode_atts( $default_atts, $atts, __FUNCTION__ );
|
723 |
+
|
724 |
+
if( empty( $parsed_atts['content'] ) ){
|
725 |
+
$parsed_atts['content'] = $shortcode_content;
|
726 |
+
}
|
727 |
+
|
728 |
+
$result['parsed_atts'] = $parsed_atts;
|
729 |
+
|
730 |
+
// make the result params filterable prior to generating markup variables
|
731 |
+
$result = apply_filters( 'auxin_pre_widget_scafold_params', $result, $atts, $default_atts, $shortcode_content );
|
732 |
+
|
733 |
+
// Defining extra class names --------------
|
734 |
+
|
735 |
+
// Add extra class names to class list here - widget-{element_name}
|
736 |
+
$_css_classes[] = $result['parsed_atts']['base_class'];
|
737 |
+
|
738 |
+
// Covering classes in list to class attribute for main section
|
739 |
+
$section_class_attr = auxin_make_html_class_attribute( $_css_classes, $result['parsed_atts']['extra_classes'] );
|
740 |
+
|
741 |
+
|
742 |
+
if( $before_widget ){
|
743 |
+
$result['widget_header'] .= str_replace(
|
744 |
+
array( 'class="', '<div'),
|
745 |
+
array( 'class="'. $result['parsed_atts']['base_class'].' '.$result['parsed_atts']['extra_classes'].' widget-container ', '<section' ),
|
746 |
+
$before_widget
|
747 |
+
);
|
748 |
+
} elseif ( !empty($result['parsed_atts']['custom_el_id']) ){
|
749 |
+
$result['widget_header'] .= sprintf('<section id="%s" %s>', $result['parsed_atts']['custom_el_id'], $section_class_attr );
|
750 |
+
} else {
|
751 |
+
$result['widget_header'] .= sprintf('<section %s>', $section_class_attr );
|
752 |
+
}
|
753 |
+
|
754 |
+
if( ! empty( $result['parsed_atts']['title'] ) ){
|
755 |
+
if( $before_title ){
|
756 |
+
$result['widget_title'] .= $before_title . $result['parsed_atts']['title'] . $after_title;
|
757 |
+
} elseif( ! empty( $result['parsed_atts']['title'] ) ){
|
758 |
+
$result['widget_title'] .= '<h3 class="widget-title">'. $result['parsed_atts']['title'] .'</h3>';
|
759 |
+
}
|
760 |
+
}
|
761 |
+
|
762 |
+
if( $after_widget ){
|
763 |
+
// fix for the difference in end tag in siteorigin page builder
|
764 |
+
$result['widget_footer'] .= str_replace( '</div', '</section', $after_widget );
|
765 |
+
} else {
|
766 |
+
$result['widget_footer'] .= '</section><!-- widget-container -->';
|
767 |
+
}
|
768 |
+
|
769 |
+
return $result;
|
770 |
+
}
|
771 |
+
|
772 |
+
|
773 |
+
/*----------------------------------------------------------------------------*/
|
774 |
+
/* Retrieves remote data
|
775 |
+
/*----------------------------------------------------------------------------*/
|
776 |
+
|
777 |
+
/**
|
778 |
+
* Retrieves a URL using the HTTP POST method
|
779 |
+
*
|
780 |
+
* @return mixed|boolean The body content
|
781 |
+
*/
|
782 |
+
function auxin_remote_post( $url, $args ) {
|
783 |
+
$request = wp_remote_post( $url, $args );
|
784 |
+
|
785 |
+
if ( ! is_wp_error( $request ) || wp_remote_retrieve_response_code( $request ) === 200 ) {
|
786 |
+
return $request['body'];
|
787 |
+
}
|
788 |
+
return false;
|
789 |
+
}
|
790 |
+
|
791 |
+
/**
|
792 |
+
* Retrieves a URL using the HTTP GET method
|
793 |
+
*
|
794 |
+
* @return mixed|boolean The body content
|
795 |
+
*/
|
796 |
+
function auxin_remote_get( $url, $args ) {
|
797 |
+
$request = wp_remote_get( $url, $args );
|
798 |
+
|
799 |
+
if ( ! is_wp_error( $request ) || wp_remote_retrieve_response_code( $request ) === 200 ) {
|
800 |
+
return $request['body'];
|
801 |
+
}
|
802 |
+
return false;
|
803 |
+
}
|
804 |
+
|
805 |
+
/*----------------------------------------------------------------------------*/
|
806 |
+
/* Removes a class method from a specified filter hook.
|
807 |
+
/*----------------------------------------------------------------------------*/
|
808 |
+
|
809 |
+
if( ! function_exists( 'auxin_remove_filter_from_class' ) ){
|
810 |
+
|
811 |
+
/**
|
812 |
+
* Removes a class method from a specified filter hook.
|
813 |
+
*
|
814 |
+
* @param string $hook_name The filter hook to which the function to be removed is hooked
|
815 |
+
* @param string $class_name The name of class which its method should be removed.
|
816 |
+
* @param string $method_name The name of the method which should be removed.
|
817 |
+
* @param integer $priority Optional. The priority of the function. Default 10.
|
818 |
+
* @return bool Whether the function existed before it was removed.
|
819 |
+
*/
|
820 |
+
function auxin_remove_filter_from_class( $hook_name = '', $class_name ='', $method_name = '', $priority = 10 ) {
|
821 |
+
global $wp_filter;
|
822 |
+
|
823 |
+
// Take only filters on right hook name and priority
|
824 |
+
if ( !isset($wp_filter[$hook_name][$priority]) || !is_array($wp_filter[$hook_name][$priority]) )
|
825 |
+
return false;
|
826 |
+
|
827 |
+
// Loop on filters registered
|
828 |
+
foreach( (array) $wp_filter[$hook_name][$priority] as $unique_id => $filter_array ) {
|
829 |
+
// Test if filter is an array ! (always for class/method)
|
830 |
+
if ( isset($filter_array['function']) && is_array($filter_array['function']) ) {
|
831 |
+
// Test if object is a class, class and method is equal to param !
|
832 |
+
if ( is_object($filter_array['function'][0]) && get_class($filter_array['function'][0]) && get_class($filter_array['function'][0]) == $class_name && $filter_array['function'][1] == $method_name ) {
|
833 |
+
unset($wp_filter[$hook_name][$priority][$unique_id]);
|
834 |
+
}
|
835 |
+
}
|
836 |
+
|
837 |
+
}
|
838 |
+
|
839 |
+
return false;
|
840 |
+
}
|
841 |
+
|
842 |
+
}
|
843 |
+
|
844 |
+
|
845 |
+
if( ! function_exists( 'auxin_remove_action_from_class' ) ){
|
846 |
+
|
847 |
+
/**
|
848 |
+
* Removes a class method from a specified filter hook.
|
849 |
+
*
|
850 |
+
* @param string $hook_name The filter hook to which the function to be removed is hooked
|
851 |
+
* @param string $class_name The name of class which its method should be removed.
|
852 |
+
* @param string $method_name The name of the method which should be removed.
|
853 |
+
* @param integer $priority Optional. The priority of the function. Default 10.
|
854 |
+
* @return bool Whether the function existed before it was removed.
|
855 |
+
*/
|
856 |
+
function auxin_remove_action_from_class( $hook_name = '', $class_name ='', $method_name = '', $priority = 10 ) {
|
857 |
+
global $wp_action;
|
858 |
+
|
859 |
+
// Take only filters on right hook name and priority
|
860 |
+
if ( !isset($wp_action[$hook_name][$priority]) || !is_array($wp_action[$hook_name][$priority]) )
|
861 |
+
return false;
|
862 |
+
|
863 |
+
// Loop on filters registered
|
864 |
+
foreach( (array) $wp_action[$hook_name][$priority] as $unique_id => $filter_array ) {
|
865 |
+
// Test if filter is an array ! (always for class/method)
|
866 |
+
if ( isset($filter_array['function']) && is_array($filter_array['function']) ) {
|
867 |
+
// Test if object is a class, class and method is equal to param !
|
868 |
+
if ( is_object($filter_array['function'][0]) && get_class($filter_array['function'][0]) && get_class($filter_array['function'][0]) == $class_name && $filter_array['function'][1] == $method_name ) {
|
869 |
+
unset($wp_action[$hook_name][$priority][$unique_id]);
|
870 |
+
}
|
871 |
+
}
|
872 |
+
|
873 |
+
}
|
874 |
+
|
875 |
+
return false;
|
876 |
+
}
|
877 |
+
|
878 |
+
}
|
879 |
+
|
880 |
+
|
881 |
+
|
882 |
+
/*-----------------------------------------------------------------------------------*/
|
883 |
+
/* A function to get the custom style of Google maps
|
884 |
+
/*-----------------------------------------------------------------------------------*/
|
885 |
+
|
886 |
+
if ( ! function_exists( 'auxin_get_gmap_style' ) ) {
|
887 |
+
|
888 |
+
function auxin_get_gmap_style () {
|
889 |
+
|
890 |
+
$styler = '[{"featureType":"landscape.man_made","elementType":"geometry.fill","stylers":[{"color":"#e9e5dc"}]},{"featureType":"landscape.natural","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"color":"#b8cb93"}]},{"featureType":"poi","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"poi.business","elementType":"all","stylers":[{"visibility":"simplified"}]},{"featureType":"poi.medical","elementType":"all","stylers":[{"visibility":"on"}]},{"featureType":"poi.park","elementType":"all","stylers":[{"visibility":"on"}]},{"featureType":"poi.park","elementType":"geometry.fill","stylers":[{"color":"#ccdca1"}]},{"featureType":"poi.sports_complex","elementType":"all","stylers":[{"visibility":"on"}]},{"featureType":"road","elementType":"geometry.fill","stylers":[{"hue":"#ff0000"},{"saturation":-100},{"lightness":99}]},{"featureType":"road","elementType":"geometry.stroke","stylers":[{"color":"#808080"},{"lightness":54},{"visibility":"off"}]},{"featureType":"road","elementType":"labels.text.fill","stylers":[{"color":"#767676"}]},{"featureType":"road","elementType":"labels.text.stroke","stylers":[{"color":"#ffffff"}]},{"featureType":"water","elementType":"all","stylers":[{"saturation":43},{"lightness":-11},{"color":"#89cada"}]}]';
|
891 |
+
|
892 |
+
return apply_filters( 'auxin_gmap_style', $styler );
|
893 |
+
}
|
894 |
+
}
|
895 |
+
|
includes/general-hooks.php
CHANGED
@@ -36,15 +36,47 @@ function auxin_add_vc_field_types(){
|
|
36 |
|
37 |
if ( defined( 'WPB_VC_VERSION' ) ) {
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
vc_add_shortcode_param( 'aux_visual_select', 'auxin_aux_visual_select_settings_field', ADMIN_JS_URL . 'scripts.js' );
|
40 |
function auxin_aux_visual_select_settings_field( $settings, $value ) {
|
41 |
|
42 |
-
$output = '<select
|
|
|
|
|
|
|
|
|
|
|
43 |
foreach ( $settings['choices'] as $id => $option_info ) {
|
44 |
-
$active_attr = ( $id == $
|
45 |
$data_class = isset( $option_info['css_class'] ) && ! empty( $option_info['css_class'] ) ? 'data-class="'. $option_info['css_class'].'"' : '';
|
46 |
$data_symbol = empty( $data_class ) && isset( $option_info['image'] ) && ! empty( $option_info['image'] ) ? 'data-symbol="'. $option_info['image'].'"' : '';
|
47 |
-
$
|
|
|
48 |
|
49 |
}
|
50 |
$output .= '</select>';
|
@@ -52,31 +84,93 @@ function auxin_add_vc_field_types(){
|
|
52 |
return $output; // This is html markup that will be outputted in content elements edit form
|
53 |
}
|
54 |
|
55 |
-
vc_add_shortcode_param( 'aux_switch', 'auxin_aux_switch_settings_field', ADMIN_JS_URL . 'scripts.js' );
|
56 |
-
function auxin_aux_switch_settings_field( $settings, $value ) {
|
57 |
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
}
|
64 |
|
65 |
-
|
66 |
-
vc_add_shortcode_param( '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
|
|
|
|
|
|
|
|
|
|
|
68 |
function aux_multiple_selector_settings_field( $settings, $value ) {
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
}
|
79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
}
|
81 |
|
82 |
/**
|
@@ -434,6 +528,52 @@ function auxin_add_theme_options_in_plugin( $fields_sections_list ){
|
|
434 |
|
435 |
|
436 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
437 |
|
438 |
|
439 |
|
@@ -938,6 +1078,78 @@ function auxin_custom_js_for_pages( $js, $post ){
|
|
938 |
add_filter( 'auxin_footer_inline_script', 'auxin_custom_js_for_pages', 15, 2 );
|
939 |
|
940 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
941 |
/*-----------------------------------------------------------------------------------*/
|
942 |
/* Print meta tags to preview post while sharing on facebook
|
943 |
/*-----------------------------------------------------------------------------------*/
|
@@ -991,3 +1203,103 @@ if ( auxin_is_plugin_active( 'so-widgets-bundle/so-widgets-bundle.php') ) {
|
|
991 |
|
992 |
add_filter( 'siteorigin_widgets_field_class_paths', 'register_custom_fields' );
|
993 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
if ( defined( 'WPB_VC_VERSION' ) ) {
|
38 |
|
39 |
+
// aux_iconpicker field type definition for VC
|
40 |
+
vc_add_shortcode_param( 'aux_iconpicker', 'auxin_aux_iconpicker_settings_field', ADMIN_JS_URL . 'scripts.js' );
|
41 |
+
function auxin_aux_iconpicker_settings_field( $settings, $value ) {
|
42 |
+
|
43 |
+
$font_icons = Auxin()->Font_Icons->get_icons_list('fontastic');
|
44 |
+
$output = '<div class="aux-element-field aux-iconpicker">';
|
45 |
+
$output .= sprintf( '<select name="%1$s" id="%1$s" class="aux-fonticonpicker aux-select wpb_vc_param_value wpb-select ' .
|
46 |
+
esc_attr( $settings['param_name'] ) . ' ' . $settings['type'] . '_field" >', esc_attr($settings['param_name']) );
|
47 |
+
$output .= '<option value="">' . __('Choose ..', 'auxin-elements') . '</option>';
|
48 |
+
|
49 |
+
if( is_array( $font_icons ) ){
|
50 |
+
foreach ( $font_icons as $icon ) {
|
51 |
+
$icon_id = trim( $icon->classname, '.' );
|
52 |
+
// $output .= '<option value="'. $icon_id .'" '. selected( $instance[$id], $icon_id, false ) .' >'. $icon->name . '</option>';
|
53 |
+
$output .= '<option value="'. $icon_id .'" '. selected( esc_attr( $value ) , $icon_id, false ) .' >'. $icon->name . '</option>';
|
54 |
+
|
55 |
+
}
|
56 |
+
}
|
57 |
+
|
58 |
+
$output .= '</select>';
|
59 |
+
$output .= '</div>';
|
60 |
+
|
61 |
+
return $output; // This is html markup that will be outputted in content elements edit form
|
62 |
+
}
|
63 |
+
|
64 |
+
// aux_visual_select field type definition for VC
|
65 |
vc_add_shortcode_param( 'aux_visual_select', 'auxin_aux_visual_select_settings_field', ADMIN_JS_URL . 'scripts.js' );
|
66 |
function auxin_aux_visual_select_settings_field( $settings, $value ) {
|
67 |
|
68 |
+
$output = '<select name="' . esc_attr($settings['param_name']) .
|
69 |
+
'" class="aux-element-field visual-select-wrapper wpb_vc_param_value wpb-select ' .
|
70 |
+
esc_attr( $settings['param_name'] ) . ' ' . $settings['type'] . '_field" '.
|
71 |
+
' id="' . esc_attr($settings['param_name']) .
|
72 |
+
'" data-option="' . esc_attr( $value ) . '" >';
|
73 |
+
'" >';
|
74 |
foreach ( $settings['choices'] as $id => $option_info ) {
|
75 |
+
$active_attr = ( $id == esc_attr( $value ) ) ? 'selected' : '';
|
76 |
$data_class = isset( $option_info['css_class'] ) && ! empty( $option_info['css_class'] ) ? 'data-class="'. $option_info['css_class'].'"' : '';
|
77 |
$data_symbol = empty( $data_class ) && isset( $option_info['image'] ) && ! empty( $option_info['image'] ) ? 'data-symbol="'. $option_info['image'].'"' : '';
|
78 |
+
$css_classs = 'class="'. ($id) .'"';
|
79 |
+
$output .= sprintf( '<option value="%s" %s %s %s %s>%s</option>', $id,$css_classs, $active_attr, $data_symbol, $data_class, $option_info['label'] );
|
80 |
|
81 |
}
|
82 |
$output .= '</select>';
|
84 |
return $output; // This is html markup that will be outputted in content elements edit form
|
85 |
}
|
86 |
|
|
|
|
|
87 |
|
88 |
+
// aux_select_audio field type definition for VC
|
89 |
+
vc_add_shortcode_param( 'aux_select_audio', 'aux_select_audio_settings_field', ADMIN_JS_URL . 'scripts.js' );
|
90 |
+
function aux_select_audio_settings_field( $settings, $value ) {
|
91 |
+
|
92 |
+
// Store attachment src for avertaAttachMedia field
|
93 |
+
if( !empty( $value) ) {
|
94 |
+
$att_ids = explode( ',', $value );
|
95 |
+
$attach_ids_list = auxin_get_the_resized_attachment_src( $att_ids, 80, 80, true );
|
96 |
+
if(!empty($att_ids)) {
|
97 |
+
printf( "<script>auxin.attachmedia = jQuery.extend( auxin.attachmedia, %s );</script>", json_encode( array_unique( $attach_ids_list ) ) );
|
98 |
+
}
|
99 |
+
}
|
100 |
+
|
101 |
+
|
102 |
+
$output = '';
|
103 |
+
$output .= '<div class="aux-element-field av3_container aux_select_image axi-attachmedia-wrapper">'.
|
104 |
+
'<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']) . '" '
|
105 |
+
. 'value="' . esc_attr( $value ) . '" data-media-type="audio" data-limit="1" data-multiple="0"'
|
106 |
+
.'data-add-to-list="'.__('Add Audio', 'auxin-elements').'" '
|
107 |
+
.'data-uploader-submit="'.__('Add Audio', 'auxin-elements').'"'
|
108 |
+
.'data-uploader-title="'.__('Select Audio', 'auxin-elements').'"> '
|
109 |
+
.'</div>';
|
110 |
+
|
111 |
+
return $output; // This is html markup that will be outputted in content elements edit form
|
112 |
}
|
113 |
|
114 |
+
// aux_select_video field type definition for VC
|
115 |
+
vc_add_shortcode_param( 'aux_select_video', 'aux_select_video_settings_field', ADMIN_JS_URL . 'scripts.js' );
|
116 |
+
function aux_select_video_settings_field( $settings, $value ) {
|
117 |
+
|
118 |
+
// Store attachment src for avertaAttachMedia field
|
119 |
+
if( !empty( $value) ) {
|
120 |
+
$att_ids = explode( ',', $value );
|
121 |
+
$attach_ids_list = auxin_get_the_resized_attachment_src( $att_ids, 80, 80, true );
|
122 |
+
if(!empty($att_ids)) {
|
123 |
+
printf( "<script>auxin.attachmedia = jQuery.extend( auxin.attachmedia, %s );</script>", json_encode( array_unique( $attach_ids_list ) ) );
|
124 |
+
}
|
125 |
+
}
|
126 |
+
|
127 |
+
$output = '';
|
128 |
+
$output .= '<div class="aux-element-field av3_container aux_select_image axi-attachmedia-wrapper">'.
|
129 |
+
'<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']) . '" '
|
130 |
+
. 'value="' . esc_attr( $value ) . '" data-media-type="video" data-limit="1" data-multiple="0"'
|
131 |
+
.'data-add-to-list="'.__('Add Video', 'auxin-elements').'" '
|
132 |
+
.'data-uploader-submit="'.__('Add Video', 'auxin-elements').'"'
|
133 |
+
.'data-uploader-title="'.__('Select Video', 'auxin-elements').'"> '
|
134 |
+
.'</div>';
|
135 |
|
136 |
+
return $output; // This is html markup that will be outputted in content elements edit form
|
137 |
+
}
|
138 |
+
|
139 |
+
// aux_select2_multiple field type definition for VC
|
140 |
+
vc_add_shortcode_param( 'aux_select2_multiple', 'aux_multiple_selector_settings_field', ADMIN_JS_URL . 'scripts.js' );
|
141 |
function aux_multiple_selector_settings_field( $settings, $value ) {
|
142 |
+
|
143 |
+
if( gettype( $value ) === "string" ) {
|
144 |
+
$value = explode( ",", $value);
|
145 |
+
}
|
146 |
+
|
147 |
+
$select = $value;
|
148 |
+
|
149 |
+
$output = '';
|
150 |
+
$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" '. '>';
|
151 |
+
foreach ( $settings['value'] as $id => $option_info ) {
|
152 |
+
$active_attr = in_array( $id, $select) ? 'selected="selected"' : '';
|
153 |
+
$output .= sprintf( '<option value="%s" %s >%s</option>', $id, $active_attr, $option_info );
|
154 |
+
}
|
155 |
+
$output.= '</select>';
|
156 |
+
|
157 |
+
return $output; // This is html markup that will be outputted in content elements edit form
|
158 |
}
|
159 |
|
160 |
+
|
161 |
+
vc_add_shortcode_param( 'aux_switch', 'auxin_aux_switch_settings_field', ADMIN_JS_URL . 'scripts.js' );
|
162 |
+
function auxin_aux_switch_settings_field( $settings, $value ) {
|
163 |
+
$active_attr = auxin_is_true( $value ) ? 'checked="checked"' : '';
|
164 |
+
return '<div class="av3_container aux_switch">'.
|
165 |
+
'<input type="checkbox" name="' . esc_attr( $settings['param_name'] ) . '" class="wpb_vc_param_value wpb_checkbox checkbox '.
|
166 |
+
esc_attr( $settings['param_name'] ) . ' ' .
|
167 |
+
esc_attr( $settings['type'] ) . '_field' .
|
168 |
+
'" value="' . esc_attr( $value ) . '" ' . $active_attr . ' >' .
|
169 |
+
'</div>'; // This is html markup that will be outputted in content elements edit form
|
170 |
+
}
|
171 |
+
|
172 |
+
|
173 |
+
|
174 |
}
|
175 |
|
176 |
/**
|
528 |
|
529 |
|
530 |
|
531 |
+
$fields_sections_list['fields'][] = array(
|
532 |
+
'title' => __('Footer Brand Image', 'auxin-elements'),
|
533 |
+
'description' => __('This image appears as site brand image on footer section.', 'auxin-elements'),
|
534 |
+
'id' => 'site_secondary_logo_image',
|
535 |
+
'section' => 'footer-setting-section-footer',
|
536 |
+
'dependency' => array(
|
537 |
+
array(
|
538 |
+
'id' => 'show_site_footer',
|
539 |
+
'value' => array('1'),
|
540 |
+
'operator'=> '=='
|
541 |
+
)
|
542 |
+
),
|
543 |
+
'default' => '',
|
544 |
+
'transport' => 'postMessage',
|
545 |
+
'partial' => array(
|
546 |
+
'selector' => '.aux-logo-footer .aux-logo-anchor',
|
547 |
+
'container_inclusive' => false,
|
548 |
+
'render_callback' => function(){ echo _auxin_get_footer_logo_image(); }
|
549 |
+
),
|
550 |
+
'type' => 'image'
|
551 |
+
);
|
552 |
+
|
553 |
+
$fields_sections_list['fields'][] = array(
|
554 |
+
'title' => __('Footer Brand Height', 'auxin-elements'),
|
555 |
+
'description' => __('Specifies maximum height of logo in footer.', 'auxin-elements'),
|
556 |
+
'id' => 'site_secondary_logo_max_height',
|
557 |
+
'section' => 'footer-setting-section-footer',
|
558 |
+
'dependency' => array(
|
559 |
+
array(
|
560 |
+
'id' => 'show_site_footer',
|
561 |
+
'value' => array('1'),
|
562 |
+
'operator'=> '=='
|
563 |
+
)
|
564 |
+
),
|
565 |
+
'default' => '50',
|
566 |
+
'transport' => 'postMessage',
|
567 |
+
'post_js' => '$(".aux-logo-footer .aux-logo-anchor img").css( "max-height", $.trim(to) + "px" );',
|
568 |
+
'style_callback' => function( $value = null ){
|
569 |
+
if( ! $value ){
|
570 |
+
$value = auxin_get_option( 'site_secondary_logo_max_height' );
|
571 |
+
}
|
572 |
+
$value = trim( $value, 'px');
|
573 |
+
return $value ? ".aux-logo-footer .aux-logo-anchor img { max-height:{$value}px; }" : '';
|
574 |
+
},
|
575 |
+
'type' => 'text'
|
576 |
+
);
|
577 |
|
578 |
|
579 |
|
1078 |
add_filter( 'auxin_footer_inline_script', 'auxin_custom_js_for_pages', 15, 2 );
|
1079 |
|
1080 |
|
1081 |
+
/*-----------------------------------------------------------------------------------*/
|
1082 |
+
/* Add preconnect for Google Fonts.
|
1083 |
+
/*-----------------------------------------------------------------------------------*/
|
1084 |
+
|
1085 |
+
/**
|
1086 |
+
* Add preconnect for Google Fonts.
|
1087 |
+
*
|
1088 |
+
* @param array $urls URLs to print for resource hints.
|
1089 |
+
* @param string $relation_type The relation type the URLs are printed.
|
1090 |
+
* @return array $urls URLs to print for resource hints.
|
1091 |
+
*/
|
1092 |
+
function auxin_resource_hints( $urls, $relation_type ) {
|
1093 |
+
if ( wp_style_is( 'auxin-fonts-google', 'queue' ) && 'preconnect' === $relation_type ) {
|
1094 |
+
$urls[] = array(
|
1095 |
+
'href' => 'https://fonts.gstatic.com',
|
1096 |
+
'crossorigin',
|
1097 |
+
);
|
1098 |
+
}
|
1099 |
+
return $urls;
|
1100 |
+
}
|
1101 |
+
//add_filter( 'wp_resource_hints', 'auxin_resource_hints', 10, 2 );
|
1102 |
+
|
1103 |
+
|
1104 |
+
/*-----------------------------------------------------------------------------------*/
|
1105 |
+
/* Setup Header
|
1106 |
+
/*-----------------------------------------------------------------------------------*/
|
1107 |
+
|
1108 |
+
function auxin_after_setup_theme_extra(){
|
1109 |
+
// gererate shortcodes in widget text
|
1110 |
+
add_filter('widget_text', 'do_shortcode');
|
1111 |
+
}
|
1112 |
+
add_action( 'after_setup_theme', 'auxin_after_setup_theme_extra' );
|
1113 |
+
|
1114 |
+
/*-----------------------------------------------------------------------------------*/
|
1115 |
+
/* add excerpts to pages
|
1116 |
+
/*-----------------------------------------------------------------------------------*/
|
1117 |
+
|
1118 |
+
function auxin_add_excerpts_to_pages() {
|
1119 |
+
add_post_type_support( 'page', 'excerpt' );
|
1120 |
+
}
|
1121 |
+
add_action( 'init', 'auxin_add_excerpts_to_pages' );
|
1122 |
+
|
1123 |
+
|
1124 |
+
/*-----------------------------------------------------------------------------------*/
|
1125 |
+
/* Add some user contact fields
|
1126 |
+
/*-----------------------------------------------------------------------------------*/
|
1127 |
+
|
1128 |
+
function auxin_user_contactmethods($user_contactmethods){
|
1129 |
+
$user_contactmethods['twitter'] = __('Twitter' , 'auxin-elements');
|
1130 |
+
$user_contactmethods['facebook'] = __('Facebook' , 'auxin-elements');
|
1131 |
+
$user_contactmethods['googleplus'] = __('Google Plus', 'auxin-elements');
|
1132 |
+
$user_contactmethods['flickr'] = __('Flickr' , 'auxin-elements');
|
1133 |
+
$user_contactmethods['delicious'] = __('Delicious' , 'auxin-elements');
|
1134 |
+
$user_contactmethods['pinterest'] = __('Pinterest' , 'auxin-elements');
|
1135 |
+
$user_contactmethods['github'] = __('GitHub' , 'auxin-elements');
|
1136 |
+
$user_contactmethods['skills'] = __('Skills' , 'auxin-elements');
|
1137 |
+
|
1138 |
+
return $user_contactmethods;
|
1139 |
+
}
|
1140 |
+
add_filter('user_contactmethods', 'auxin_user_contactmethods');
|
1141 |
+
|
1142 |
+
|
1143 |
+
/*-----------------------------------------------------------------------------------*/
|
1144 |
+
/* Add home page menu arg to menu item list
|
1145 |
+
/*-----------------------------------------------------------------------------------*/
|
1146 |
+
|
1147 |
+
function auxin_add_home_page_to_menu_args( $args ) {
|
1148 |
+
$args['show_home'] = true;
|
1149 |
+
return $args;
|
1150 |
+
}
|
1151 |
+
add_filter( 'wp_page_menu_args', 'auxin_add_home_page_to_menu_args' );
|
1152 |
+
|
1153 |
/*-----------------------------------------------------------------------------------*/
|
1154 |
/* Print meta tags to preview post while sharing on facebook
|
1155 |
/*-----------------------------------------------------------------------------------*/
|
1203 |
|
1204 |
add_filter( 'siteorigin_widgets_field_class_paths', 'register_custom_fields' );
|
1205 |
}
|
1206 |
+
|
1207 |
+
|
1208 |
+
/**
|
1209 |
+
* Replace WooCommerce Default Pagination with auxin pagination
|
1210 |
+
*
|
1211 |
+
*/
|
1212 |
+
remove_action( 'woocommerce_pagination' , 'woocommerce_pagination', 10 );
|
1213 |
+
add_action ( 'woocommerce_pagination', 'auxin_woocommerce_pagination' , 10 );
|
1214 |
+
|
1215 |
+
function auxin_woocommerce_pagination() {
|
1216 |
+
auxin_the_paginate_nav(
|
1217 |
+
array( 'css_class' => auxin_get_option('archive_pagination_skin') )
|
1218 |
+
);
|
1219 |
+
}
|
1220 |
+
|
1221 |
+
|
1222 |
+
|
1223 |
+
|
1224 |
+
function auxels_add_post_type_metafields(){
|
1225 |
+
|
1226 |
+
$all_post_types = auxin_get_possible_post_types(true);
|
1227 |
+
|
1228 |
+
$auxin_is_admin = is_admin();
|
1229 |
+
|
1230 |
+
foreach ( $all_post_types as $post_type => $is_post_type_allowed ) {
|
1231 |
+
|
1232 |
+
if( ! $is_post_type_allowed ){
|
1233 |
+
continue;
|
1234 |
+
}
|
1235 |
+
|
1236 |
+
// define metabox args
|
1237 |
+
$metabox_args = array( 'post_type' => $post_type );
|
1238 |
+
|
1239 |
+
switch( $post_type ) {
|
1240 |
+
|
1241 |
+
|
1242 |
+
case 'page':
|
1243 |
+
|
1244 |
+
$metabox_args['hub_id'] = 'axi_meta_hub_page';
|
1245 |
+
$metabox_args['hub_title'] = __('Page Options', 'auxin-elements');
|
1246 |
+
$metabox_args['to_post_types'] = array( $post_type );
|
1247 |
+
|
1248 |
+
break;
|
1249 |
+
|
1250 |
+
case 'post':
|
1251 |
+
|
1252 |
+
$metabox_args['hub_id'] = 'axi_meta_hub_post';
|
1253 |
+
$metabox_args['hub_title'] = __('Post Options', 'auxin-elements');
|
1254 |
+
$metabox_args['to_post_types'] = array( $post_type );
|
1255 |
+
|
1256 |
+
default:
|
1257 |
+
break;
|
1258 |
+
}
|
1259 |
+
|
1260 |
+
// Load metabox fields on admin
|
1261 |
+
if( $auxin_is_admin ){
|
1262 |
+
auxin_maybe_render_metabox_hub_for_post_type( $metabox_args );
|
1263 |
+
}
|
1264 |
+
|
1265 |
+
}
|
1266 |
+
|
1267 |
+
}
|
1268 |
+
|
1269 |
+
add_action( 'init', 'auxels_add_post_type_metafields' );
|
1270 |
+
|
1271 |
+
|
1272 |
+
|
1273 |
+
|
1274 |
+
/*-----------------------------------------------------------------------------------*/
|
1275 |
+
/* Filtering wp_title to improve seo and letting seo plugins to filter the output too
|
1276 |
+
/*-----------------------------------------------------------------------------------*/
|
1277 |
+
|
1278 |
+
if( ! defined( 'WPSEO_VERSION') ){
|
1279 |
+
|
1280 |
+
function auxin_wp_title($title, $sep, $seplocation) {
|
1281 |
+
global $page, $paged, $post;
|
1282 |
+
|
1283 |
+
// Don't affect feeds
|
1284 |
+
if ( is_feed() ) return $title;
|
1285 |
+
|
1286 |
+
// Add the blog name
|
1287 |
+
if ( 'right' == $seplocation )
|
1288 |
+
$title .= get_bloginfo( 'name' );
|
1289 |
+
else
|
1290 |
+
$title = get_bloginfo( 'name' ) . $title;
|
1291 |
+
|
1292 |
+
// Add the blog description for the home/front page
|
1293 |
+
$site_description = get_bloginfo( 'description', 'display' );
|
1294 |
+
if ( $site_description && ( is_home() || is_front_page() ) )
|
1295 |
+
$title .= " $sep $site_description";
|
1296 |
+
|
1297 |
+
// Add a page number if necessary
|
1298 |
+
if ( $paged >= 2 || $page >= 2 )
|
1299 |
+
$title .= " $sep " . sprintf( __( 'Page %s', THEME_DOMAIN), max( $paged, $page ) );
|
1300 |
+
|
1301 |
+
return $title;
|
1302 |
+
}
|
1303 |
+
|
1304 |
+
add_filter( 'wp_title', 'auxin_wp_title', 10, 3 );
|
1305 |
+
}
|
includes/index.php
CHANGED
@@ -1,8 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
-
include_once( 'classes/class-auxin-siteorigin-widget.php' );
|
5 |
-
include_once( 'classes/class-auxin-widget-shortcode-map.php' );
|
6 |
// commeon functions
|
7 |
include_once( 'general-functions.php' );
|
8 |
include_once( 'general-hooks.php' );
|
@@ -11,6 +9,8 @@ include_once( 'general-hooks.php' );
|
|
11 |
include_once( 'general-shortcodes.php' );
|
12 |
|
13 |
|
|
|
|
|
14 |
|
15 |
// load elements
|
16 |
include_once( 'elements/about-widget.php' );
|
@@ -20,11 +20,16 @@ include_once( 'elements/recent-posts-grid-carousel.php' );
|
|
20 |
include_once( 'elements/recent-posts-timeline.php' );
|
21 |
include_once( 'elements/recent-posts-masonry.php' );
|
22 |
include_once( 'elements/recent-posts-land-style.php' );
|
|
|
23 |
if( auxin_is_plugin_active( 'so-widgets-bundle/so-widgets-bundle.php' ) ) {
|
24 |
include_once( 'elements/accordion.php' );
|
25 |
include_once( 'elements/tabs.php' );
|
26 |
include_once( 'elements/text.php' );
|
27 |
}
|
|
|
|
|
|
|
|
|
28 |
|
29 |
include_once( 'elements/recent-posts-tiles.php' );
|
30 |
include_once( 'elements/attachment-url.php' );
|
1 |
<?php
|
2 |
|
3 |
+
|
|
|
|
|
4 |
// commeon functions
|
5 |
include_once( 'general-functions.php' );
|
6 |
include_once( 'general-hooks.php' );
|
9 |
include_once( 'general-shortcodes.php' );
|
10 |
|
11 |
|
12 |
+
Auxin_Widget_Shortcode_Map::get_instance();
|
13 |
+
Auxin_Import::get_instance();
|
14 |
|
15 |
// load elements
|
16 |
include_once( 'elements/about-widget.php' );
|
20 |
include_once( 'elements/recent-posts-timeline.php' );
|
21 |
include_once( 'elements/recent-posts-masonry.php' );
|
22 |
include_once( 'elements/recent-posts-land-style.php' );
|
23 |
+
// if siteorigin bundle plugin is active
|
24 |
if( auxin_is_plugin_active( 'so-widgets-bundle/so-widgets-bundle.php' ) ) {
|
25 |
include_once( 'elements/accordion.php' );
|
26 |
include_once( 'elements/tabs.php' );
|
27 |
include_once( 'elements/text.php' );
|
28 |
}
|
29 |
+
// if visual composer plugin is active
|
30 |
+
if( defined( 'WPB_VC_VERSION' ) || auxin_is_plugin_active( 'js_composer/js_composer.php' ) ){
|
31 |
+
|
32 |
+
}
|
33 |
|
34 |
include_once( 'elements/recent-posts-tiles.php' );
|
35 |
include_once( 'elements/attachment-url.php' );
|
public/assets/js/gmaps.min.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
"use strict";!function(a,b){"object"==typeof exports?module.exports=b():"function"==typeof define&&define.amd?define(["jquery","googlemaps!"],b):a.GMaps=b()}(this,function(){var a=function(a,b){var c;if(a===b)return a;for(c in b)void 0!==b[c]&&(a[c]=b[c]);return a},b=function(a,b){var c,d=Array.prototype.slice.call(arguments,2),e=[],f=a.length;if(Array.prototype.map&&a.map===Array.prototype.map)e=Array.prototype.map.call(a,function(a){var c=d.slice(0);return c.splice(0,0,a),b.apply(this,c)});else for(c=0;f>c;c++)callback_params=d,callback_params.splice(0,0,a[c]),e.push(b.apply(this,callback_params));return e},c=function(a){var b,c=[];for(b=0;b<a.length;b++)c=c.concat(a[b]);return c},d=function(a,b){var c=a[0],d=a[1];return b&&(c=a[1],d=a[0]),new google.maps.LatLng(c,d)},f=function(a,b){var c;for(c=0;c<a.length;c++)a[c]instanceof google.maps.LatLng||(a[c].length>0&&"object"==typeof a[c][0]?a[c]=f(a[c],b):a[c]=d(a[c],b));return a},g=function(a,b){var c,d=a.replace(".","");return c="jQuery"in this&&b?$("."+d,b)[0]:document.getElementsByClassName(d)[0]},h=function(a,b){var c,a=a.replace("#","");return c="jQuery"in window&&b?$("#"+a,b)[0]:document.getElementById(a)},i=function(a){var b=0,c=0;if(a.offsetParent)do b+=a.offsetLeft,c+=a.offsetTop;while(a=a.offsetParent);return[b,c]},j=function(b){var c=document,d=function(b){if("object"!=typeof window.google||!window.google.maps)return"object"==typeof window.console&&window.console.error&&console.error("Google Maps API is required. Please register the following JavaScript library https://maps.googleapis.com/maps/api/js."),function(){};if(!this)return new d(b);b.zoom=b.zoom||15,b.mapType=b.mapType||"roadmap";var e,f=function(a,b){return void 0===a?b:a},j=this,k=["bounds_changed","center_changed","click","dblclick","drag","dragend","dragstart","idle","maptypeid_changed","projection_changed","resize","tilesloaded","zoom_changed"],l=["mousemove","mouseout","mouseover"],m=["el","lat","lng","mapType","width","height","markerClusterer","enableNewStyle"],n=b.el||b.div,o=b.markerClusterer,p=google.maps.MapTypeId[b.mapType.toUpperCase()],q=new google.maps.LatLng(b.lat,b.lng),r=f(b.zoomControl,!0),s=b.zoomControlOpt||{style:"DEFAULT",position:"TOP_LEFT"},t=s.style||"DEFAULT",u=s.position||"TOP_LEFT",v=f(b.panControl,!0),w=f(b.mapTypeControl,!0),x=f(b.scaleControl,!0),y=f(b.streetViewControl,!0),z=f(z,!0),A={},B={zoom:this.zoom,center:q,mapTypeId:p},C={panControl:v,zoomControl:r,zoomControlOptions:{style:google.maps.ZoomControlStyle[t],position:google.maps.ControlPosition[u]},mapTypeControl:w,scaleControl:x,streetViewControl:y,overviewMapControl:z};if("string"==typeof b.el||"string"==typeof b.div?n.indexOf("#")>-1?this.el=h(n,b.context):this.el=g.apply(this,[n,b.context]):this.el=n,"undefined"==typeof this.el||null===this.el)throw"No element defined.";for(window.context_menu=window.context_menu||{},window.context_menu[j.el.id]={},this.controls=[],this.overlays=[],this.layers=[],this.singleLayers={},this.markers=[],this.polylines=[],this.routes=[],this.polygons=[],this.infoWindow=null,this.overlay_el=null,this.zoom=b.zoom,this.registered_events={},this.el.style.width=b.width||this.el.scrollWidth||this.el.offsetWidth,this.el.style.height=b.height||this.el.scrollHeight||this.el.offsetHeight,google.maps.visualRefresh=b.enableNewStyle,e=0;e<m.length;e++)delete b[m[e]];for(1!=b.disableDefaultUI&&(B=a(B,C)),A=a(B,b),e=0;e<k.length;e++)delete A[k[e]];for(e=0;e<l.length;e++)delete A[l[e]];this.map=new google.maps.Map(this.el,A),o&&(this.markerClusterer=o.apply(this,[this.map]));var D=function(a,b){var c="",d=window.context_menu[j.el.id][a];for(var e in d)if(d.hasOwnProperty(e)){var f=d[e];c+='<li><a id="'+a+"_"+e+'" href="#">'+f.title+"</a></li>"}if(h("gmaps_context_menu")){var g=h("gmaps_context_menu");g.innerHTML=c;var e,k=g.getElementsByTagName("a"),l=k.length;for(e=0;l>e;e++){var m=k[e],n=function(c){c.preventDefault(),d[this.id.replace(a+"_","")].action.apply(j,[b]),j.hideContextMenu()};google.maps.event.clearListeners(m,"click"),google.maps.event.addDomListenerOnce(m,"click",n,!1)}var o=i.apply(this,[j.el]),p=o[0]+b.pixel.x-15,q=o[1]+b.pixel.y-15;g.style.left=p+"px",g.style.top=q+"px"}};this.buildContextMenu=function(a,b){if("marker"===a){b.pixel={};var c=new google.maps.OverlayView;c.setMap(j.map),c.draw=function(){var d=c.getProjection(),e=b.marker.getPosition();b.pixel=d.fromLatLngToContainerPixel(e),D(a,b)}}else D(a,b);var d=h("gmaps_context_menu");setTimeout(function(){d.style.display="block"},0)},this.setContextMenu=function(a){window.context_menu[j.el.id][a.control]={};var b,d=c.createElement("ul");for(b in a.options)if(a.options.hasOwnProperty(b)){var e=a.options[b];window.context_menu[j.el.id][a.control][e.name]={title:e.title,action:e.action}}d.id="gmaps_context_menu",d.style.display="none",d.style.position="absolute",d.style.minWidth="100px",d.style.background="white",d.style.listStyle="none",d.style.padding="8px",d.style.boxShadow="2px 2px 6px #ccc",h("gmaps_context_menu")||c.body.appendChild(d);var f=h("gmaps_context_menu");google.maps.event.addDomListener(f,"mouseout",function(a){a.relatedTarget&&this.contains(a.relatedTarget)||window.setTimeout(function(){f.style.display="none"},400)},!1)},this.hideContextMenu=function(){var a=h("gmaps_context_menu");a&&(a.style.display="none")};var E=function(a,c){google.maps.event.addListener(a,c,function(a){void 0==a&&(a=this),b[c].apply(this,[a]),j.hideContextMenu()})};google.maps.event.addListener(this.map,"zoom_changed",this.hideContextMenu);for(var F=0;F<k.length;F++){var G=k[F];G in b&&E(this.map,G)}for(var F=0;F<l.length;F++){var G=l[F];G in b&&E(this.map,G)}google.maps.event.addListener(this.map,"rightclick",function(a){b.rightclick&&b.rightclick.apply(this,[a]),void 0!=window.context_menu[j.el.id].map&&j.buildContextMenu("map",a)}),this.refresh=function(){google.maps.event.trigger(this.map,"resize")},this.fitZoom=function(){var a,b=[],c=this.markers.length;for(a=0;c>a;a++)"boolean"==typeof this.markers[a].visible&&this.markers[a].visible&&b.push(this.markers[a].getPosition());this.fitLatLngBounds(b)},this.fitLatLngBounds=function(a){var b,c=a.length,d=new google.maps.LatLngBounds;for(b=0;c>b;b++)d.extend(a[b]);this.map.fitBounds(d)},this.setCenter=function(a,b,c){this.map.panTo(new google.maps.LatLng(a,b)),c&&c()},this.getElement=function(){return this.el},this.zoomIn=function(a){a=a||1,this.zoom=this.map.getZoom()+a,this.map.setZoom(this.zoom)},this.zoomOut=function(a){a=a||1,this.zoom=this.map.getZoom()-a,this.map.setZoom(this.zoom)};var H,I=[];for(H in this.map)"function"!=typeof this.map[H]||this[H]||I.push(H);for(e=0;e<I.length;e++)!function(a,b,c){a[c]=function(){return b[c].apply(b,arguments)}}(this,this.map,I[e])};return d}(this);j.prototype.createControl=function(a){var b=document.createElement("div");b.style.cursor="pointer",a.disableDefaultStyles!==!0&&(b.style.fontFamily="Roboto, Arial, sans-serif",b.style.fontSize="11px",b.style.boxShadow="rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px");for(var c in a.style)b.style[c]=a.style[c];a.id&&(b.id=a.id),a.title&&(b.title=a.title),a.classes&&(b.className=a.classes),a.content&&("string"==typeof a.content?b.innerHTML=a.content:a.content instanceof HTMLElement&&b.appendChild(a.content)),a.position&&(b.position=google.maps.ControlPosition[a.position.toUpperCase()]);for(var d in a.events)!function(b,c){google.maps.event.addDomListener(b,c,function(){a.events[c].apply(this,[this])})}(b,d);return b.index=1,b},j.prototype.addControl=function(a){var b=this.createControl(a);return this.controls.push(b),this.map.controls[b.position].push(b),b},j.prototype.removeControl=function(a){var b,c=null;for(b=0;b<this.controls.length;b++)this.controls[b]==a&&(c=this.controls[b].position,this.controls.splice(b,1));if(c)for(b=0;b<this.map.controls.length;b++){var d=this.map.controls[a.position];if(d.getAt(b)==a){d.removeAt(b);break}}return a},j.prototype.createMarker=function(b){if(void 0==b.lat&&void 0==b.lng&&void 0==b.position)throw"No latitude or longitude defined.";var c=this,d=b.details,e=b.fences,f=b.outside,g={position:new google.maps.LatLng(b.lat,b.lng),map:null},h=a(g,b);delete h.lat,delete h.lng,delete h.fences,delete h.outside;var i=new google.maps.Marker(h);if(i.fences=e,b.infoWindow){i.infoWindow=new google.maps.InfoWindow(b.infoWindow);for(var j=["closeclick","content_changed","domready","position_changed","zindex_changed"],k=0;k<j.length;k++)!function(a,c){b.infoWindow[c]&&google.maps.event.addListener(a,c,function(a){b.infoWindow[c].apply(this,[a])})}(i.infoWindow,j[k])}for(var l=["animation_changed","clickable_changed","cursor_changed","draggable_changed","flat_changed","icon_changed","position_changed","shadow_changed","shape_changed","title_changed","visible_changed","zindex_changed"],m=["dblclick","drag","dragend","dragstart","mousedown","mouseout","mouseover","mouseup"],k=0;k<l.length;k++)!function(a,c){b[c]&&google.maps.event.addListener(a,c,function(){b[c].apply(this,[this])})}(i,l[k]);for(var k=0;k<m.length;k++)!function(a,c,d){b[d]&&google.maps.event.addListener(c,d,function(c){c.pixel||(c.pixel=a.getProjection().fromLatLngToPoint(c.latLng)),b[d].apply(this,[c])})}(this.map,i,m[k]);return google.maps.event.addListener(i,"click",function(){this.details=d,b.click&&b.click.apply(this,[this]),i.infoWindow&&(c.hideInfoWindows(),i.infoWindow.open(c.map,i))}),google.maps.event.addListener(i,"rightclick",function(a){a.marker=this,b.rightclick&&b.rightclick.apply(this,[a]),void 0!=window.context_menu[c.el.id].marker&&c.buildContextMenu("marker",a)}),i.fences&&google.maps.event.addListener(i,"dragend",function(){c.checkMarkerGeofence(i,function(a,b){f(a,b)})}),i},j.prototype.addMarker=function(a){var b;if(a.hasOwnProperty("gm_accessors_"))b=a;else{if(!(a.hasOwnProperty("lat")&&a.hasOwnProperty("lng")||a.position))throw"No latitude or longitude defined.";b=this.createMarker(a)}return b.setMap(this.map),this.markerClusterer&&this.markerClusterer.addMarker(b),this.markers.push(b),j.fire("marker_added",b,this),b},j.prototype.addMarkers=function(a){for(var b,c=0;b=a[c];c++)this.addMarker(b);return this.markers},j.prototype.hideInfoWindows=function(){for(var a,b=0;a=this.markers[b];b++)a.infoWindow&&a.infoWindow.close()},j.prototype.removeMarker=function(a){for(var b=0;b<this.markers.length;b++)if(this.markers[b]===a){this.markers[b].setMap(null),this.markers.splice(b,1),this.markerClusterer&&this.markerClusterer.removeMarker(a),j.fire("marker_removed",a,this);break}return a},j.prototype.removeMarkers=function(a){var b=[];if("undefined"==typeof a){for(var c=0;c<this.markers.length;c++){var d=this.markers[c];d.setMap(null),j.fire("marker_removed",d,this)}this.markerClusterer&&this.markerClusterer.clearMarkers&&this.markerClusterer.clearMarkers(),this.markers=b}else{for(var c=0;c<a.length;c++){var e=this.markers.indexOf(a[c]);if(e>-1){var d=this.markers[e];d.setMap(null),this.markerClusterer&&this.markerClusterer.removeMarker(d),j.fire("marker_removed",d,this)}}for(var c=0;c<this.markers.length;c++){var d=this.markers[c];null!=d.getMap()&&b.push(d)}this.markers=b}},j.prototype.drawOverlay=function(a){var b=new google.maps.OverlayView,c=!0;return b.setMap(this.map),null!=a.auto_show&&(c=a.auto_show),b.onAdd=function(){var c=document.createElement("div");c.style.borderStyle="none",c.style.borderWidth="0px",c.style.position="absolute",c.style.zIndex=100,c.innerHTML=a.content,b.el=c,a.layer||(a.layer="overlayLayer");var d=this.getPanes(),e=d[a.layer],f=["contextmenu","DOMMouseScroll","dblclick","mousedown"];e.appendChild(c);for(var g=0;g<f.length;g++)!function(a,b){google.maps.event.addDomListener(a,b,function(a){-1!=navigator.userAgent.toLowerCase().indexOf("msie")&&document.all?(a.cancelBubble=!0,a.returnValue=!1):a.stopPropagation()})}(c,f[g]);a.click&&(d.overlayMouseTarget.appendChild(b.el),google.maps.event.addDomListener(b.el,"click",function(){a.click.apply(b,[b])})),google.maps.event.trigger(this,"ready")},b.draw=function(){var d=this.getProjection(),e=d.fromLatLngToDivPixel(new google.maps.LatLng(a.lat,a.lng));a.horizontalOffset=a.horizontalOffset||0,a.verticalOffset=a.verticalOffset||0;var f=b.el,g=f.children[0],h=g.clientHeight,i=g.clientWidth;switch(a.verticalAlign){case"top":f.style.top=e.y-h+a.verticalOffset+"px";break;default:case"middle":f.style.top=e.y-h/2+a.verticalOffset+"px";break;case"bottom":f.style.top=e.y+a.verticalOffset+"px"}switch(a.horizontalAlign){case"left":f.style.left=e.x-i+a.horizontalOffset+"px";break;default:case"center":f.style.left=e.x-i/2+a.horizontalOffset+"px";break;case"right":f.style.left=e.x+a.horizontalOffset+"px"}f.style.display=c?"block":"none",c||a.show.apply(this,[f])},b.onRemove=function(){var c=b.el;a.remove?a.remove.apply(this,[c]):(b.el.parentNode.removeChild(b.el),b.el=null)},this.overlays.push(b),b},j.prototype.removeOverlay=function(a){for(var b=0;b<this.overlays.length;b++)if(this.overlays[b]===a){this.overlays[b].setMap(null),this.overlays.splice(b,1);break}},j.prototype.removeOverlays=function(){for(var a,b=0;a=this.overlays[b];b++)a.setMap(null);this.overlays=[]},j.prototype.drawPolyline=function(a){var b=[],c=a.path;if(c.length)if(void 0===c[0][0])b=c;else for(var d,e=0;d=c[e];e++)b.push(new google.maps.LatLng(d[0],d[1]));var f={map:this.map,path:b,strokeColor:a.strokeColor,strokeOpacity:a.strokeOpacity,strokeWeight:a.strokeWeight,geodesic:a.geodesic,clickable:!0,editable:!1,visible:!0};a.hasOwnProperty("clickable")&&(f.clickable=a.clickable),a.hasOwnProperty("editable")&&(f.editable=a.editable),a.hasOwnProperty("icons")&&(f.icons=a.icons),a.hasOwnProperty("zIndex")&&(f.zIndex=a.zIndex);for(var g=new google.maps.Polyline(f),h=["click","dblclick","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"],i=0;i<h.length;i++)!function(b,c){a[c]&&google.maps.event.addListener(b,c,function(b){a[c].apply(this,[b])})}(g,h[i]);return this.polylines.push(g),j.fire("polyline_added",g,this),g},j.prototype.removePolyline=function(a){for(var b=0;b<this.polylines.length;b++)if(this.polylines[b]===a){this.polylines[b].setMap(null),this.polylines.splice(b,1),j.fire("polyline_removed",a,this);break}},j.prototype.removePolylines=function(){for(var a,b=0;a=this.polylines[b];b++)a.setMap(null);this.polylines=[]},j.prototype.drawCircle=function(b){b=a({map:this.map,center:new google.maps.LatLng(b.lat,b.lng)},b),delete b.lat,delete b.lng;for(var c=new google.maps.Circle(b),d=["click","dblclick","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"],e=0;e<d.length;e++)!function(a,c){b[c]&&google.maps.event.addListener(a,c,function(a){b[c].apply(this,[a])})}(c,d[e]);return this.polygons.push(c),c},j.prototype.drawRectangle=function(b){b=a({map:this.map},b);var c=new google.maps.LatLngBounds(new google.maps.LatLng(b.bounds[0][0],b.bounds[0][1]),new google.maps.LatLng(b.bounds[1][0],b.bounds[1][1]));b.bounds=c;for(var d=new google.maps.Rectangle(b),e=["click","dblclick","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"],f=0;f<e.length;f++)!function(a,c){b[c]&&google.maps.event.addListener(a,c,function(a){b[c].apply(this,[a])})}(d,e[f]);return this.polygons.push(d),d},j.prototype.drawPolygon=function(d){var e=!1;d.hasOwnProperty("useGeoJSON")&&(e=d.useGeoJSON),delete d.useGeoJSON,d=a({map:this.map},d),0==e&&(d.paths=[d.paths.slice(0)]),d.paths.length>0&&d.paths[0].length>0&&(d.paths=c(b(d.paths,f,e)));for(var g=new google.maps.Polygon(d),h=["click","dblclick","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"],i=0;i<h.length;i++)!function(a,b){d[b]&&google.maps.event.addListener(a,b,function(a){d[b].apply(this,[a])})}(g,h[i]);return this.polygons.push(g),j.fire("polygon_added",g,this),g},j.prototype.removePolygon=function(a){for(var b=0;b<this.polygons.length;b++)if(this.polygons[b]===a){this.polygons[b].setMap(null),this.polygons.splice(b,1),j.fire("polygon_removed",a,this);break}},j.prototype.removePolygons=function(){for(var a,b=0;a=this.polygons[b];b++)a.setMap(null);this.polygons=[]},j.prototype.getFromFusionTables=function(a){var b=a.events;delete a.events;var c=a,d=new google.maps.FusionTablesLayer(c);for(var e in b)!function(a,c){google.maps.event.addListener(a,c,function(a){b[c].apply(this,[a])})}(d,e);return this.layers.push(d),d},j.prototype.loadFromFusionTables=function(a){var b=this.getFromFusionTables(a);return b.setMap(this.map),b},j.prototype.getFromKML=function(a){var b=a.url,c=a.events;delete a.url,delete a.events;var d=a,e=new google.maps.KmlLayer(b,d);for(var f in c)!function(a,b){google.maps.event.addListener(a,b,function(a){c[b].apply(this,[a])})}(e,f);return this.layers.push(e),e},j.prototype.loadFromKML=function(a){var b=this.getFromKML(a);return b.setMap(this.map),b},j.prototype.addLayer=function(a,b){b=b||{};var c;switch(a){case"weather":this.singleLayers.weather=c=new google.maps.weather.WeatherLayer;break;case"clouds":this.singleLayers.clouds=c=new google.maps.weather.CloudLayer;break;case"traffic":this.singleLayers.traffic=c=new google.maps.TrafficLayer;break;case"transit":this.singleLayers.transit=c=new google.maps.TransitLayer;break;case"bicycling":this.singleLayers.bicycling=c=new google.maps.BicyclingLayer;break;case"panoramio":this.singleLayers.panoramio=c=new google.maps.panoramio.PanoramioLayer,c.setTag(b.filter),delete b.filter,b.click&&google.maps.event.addListener(c,"click",function(a){b.click(a),delete b.click});break;case"places":if(this.singleLayers.places=c=new google.maps.places.PlacesService(this.map),b.search||b.nearbySearch||b.radarSearch){var d={bounds:b.bounds||null,keyword:b.keyword||null,location:b.location||null,name:b.name||null,radius:b.radius||null,rankBy:b.rankBy||null,types:b.types||null};b.radarSearch&&c.radarSearch(d,b.radarSearch),b.search&&c.search(d,b.search),b.nearbySearch&&c.nearbySearch(d,b.nearbySearch)}if(b.textSearch){var e={bounds:b.bounds||null,location:b.location||null,query:b.query||null,radius:b.radius||null};c.textSearch(e,b.textSearch)}}return void 0!==c?("function"==typeof c.setOptions&&c.setOptions(b),"function"==typeof c.setMap&&c.setMap(this.map),c):void 0},j.prototype.removeLayer=function(a){if("string"==typeof a&&void 0!==this.singleLayers[a])this.singleLayers[a].setMap(null),delete this.singleLayers[a];else for(var b=0;b<this.layers.length;b++)if(this.layers[b]===a){this.layers[b].setMap(null),this.layers.splice(b,1);break}};var k,l;return j.prototype.getRoutes=function(b){switch(b.travelMode){case"bicycling":k=google.maps.TravelMode.BICYCLING;break;case"transit":k=google.maps.TravelMode.TRANSIT;break;case"driving":k=google.maps.TravelMode.DRIVING;break;default:k=google.maps.TravelMode.WALKING}l="imperial"===b.unitSystem?google.maps.UnitSystem.IMPERIAL:google.maps.UnitSystem.METRIC;var c={avoidHighways:!1,avoidTolls:!1,optimizeWaypoints:!1,waypoints:[]},d=a(c,b);d.origin=/string/.test(typeof b.origin)?b.origin:new google.maps.LatLng(b.origin[0],b.origin[1]),d.destination=/string/.test(typeof b.destination)?b.destination:new google.maps.LatLng(b.destination[0],b.destination[1]),d.travelMode=k,d.unitSystem=l,delete d.callback,delete d.error;var e=[],f=new google.maps.DirectionsService;f.route(d,function(a,c){if(c===google.maps.DirectionsStatus.OK){for(var d in a.routes)a.routes.hasOwnProperty(d)&&e.push(a.routes[d]);b.callback&&b.callback(e,a,c)}else b.error&&b.error(a,c)})},j.prototype.removeRoutes=function(){this.routes.length=0},j.prototype.getElevations=function(d){d=a({locations:[],path:!1,samples:256},d),d.locations.length>0&&d.locations[0].length>0&&(d.locations=c(b([d.locations],f,!1)));var e=d.callback;delete d.callback;var g=new google.maps.ElevationService;if(d.path){var h={path:d.locations,samples:d.samples};g.getElevationAlongPath(h,function(a,b){e&&"function"==typeof e&&e(a,b)})}else delete d.path,delete d.samples,g.getElevationForLocations(d,function(a,b){e&&"function"==typeof e&&e(a,b)})},j.prototype.cleanRoute=j.prototype.removePolylines,j.prototype.renderRoute=function(b,c){var d,e="string"==typeof c.panel?document.getElementById(c.panel.replace("#","")):c.panel;c.panel=e,c=a({map:this.map},c),d=new google.maps.DirectionsRenderer(c),this.getRoutes({origin:b.origin,destination:b.destination,travelMode:b.travelMode,waypoints:b.waypoints,unitSystem:b.unitSystem,error:b.error,avoidHighways:b.avoidHighways,avoidTolls:b.avoidTolls,optimizeWaypoints:b.optimizeWaypoints,callback:function(a,b,c){c===google.maps.DirectionsStatus.OK&&d.setDirections(b)}})},j.prototype.drawRoute=function(a){var b=this;this.getRoutes({origin:a.origin,destination:a.destination,travelMode:a.travelMode,waypoints:a.waypoints,unitSystem:a.unitSystem,error:a.error,avoidHighways:a.avoidHighways,avoidTolls:a.avoidTolls,optimizeWaypoints:a.optimizeWaypoints,callback:function(c){if(c.length>0){var d={path:c[c.length-1].overview_path,strokeColor:a.strokeColor,strokeOpacity:a.strokeOpacity,strokeWeight:a.strokeWeight};a.hasOwnProperty("icons")&&(d.icons=a.icons),b.drawPolyline(d),a.callback&&a.callback(c[c.length-1])}}})},j.prototype.travelRoute=function(a){if(a.origin&&a.destination)this.getRoutes({origin:a.origin,destination:a.destination,travelMode:a.travelMode,waypoints:a.waypoints,unitSystem:a.unitSystem,error:a.error,callback:function(b){if(b.length>0&&a.start&&a.start(b[b.length-1]),b.length>0&&a.step){var c=b[b.length-1];if(c.legs.length>0)for(var d,e=c.legs[0].steps,f=0;d=e[f];f++)d.step_number=f,a.step(d,c.legs[0].steps.length-1)}b.length>0&&a.end&&a.end(b[b.length-1])}});else if(a.route&&a.route.legs.length>0)for(var b,c=a.route.legs[0].steps,d=0;b=c[d];d++)b.step_number=d,a.step(b)},j.prototype.drawSteppedRoute=function(a){var b=this;if(a.origin&&a.destination)this.getRoutes({origin:a.origin,destination:a.destination,travelMode:a.travelMode,waypoints:a.waypoints,error:a.error,callback:function(c){if(c.length>0&&a.start&&a.start(c[c.length-1]),c.length>0&&a.step){var d=c[c.length-1];if(d.legs.length>0)for(var e,f=d.legs[0].steps,g=0;e=f[g];g++){e.step_number=g;var h={path:e.path,strokeColor:a.strokeColor,strokeOpacity:a.strokeOpacity,strokeWeight:a.strokeWeight};a.hasOwnProperty("icons")&&(h.icons=a.icons),b.drawPolyline(h),a.step(e,d.legs[0].steps.length-1)}}c.length>0&&a.end&&a.end(c[c.length-1])}});else if(a.route&&a.route.legs.length>0)for(var c,d=a.route.legs[0].steps,e=0;c=d[e];e++){c.step_number=e;var f={path:c.path,strokeColor:a.strokeColor,strokeOpacity:a.strokeOpacity,strokeWeight:a.strokeWeight};a.hasOwnProperty("icons")&&(f.icons=a.icons),b.drawPolyline(f),a.step(c)}},j.Route=function(a){this.origin=a.origin,this.destination=a.destination,this.waypoints=a.waypoints,this.map=a.map,this.route=a.route,this.step_count=0,this.steps=this.route.legs[0].steps,this.steps_length=this.steps.length;var b={path:new google.maps.MVCArray,strokeColor:a.strokeColor,strokeOpacity:a.strokeOpacity,strokeWeight:a.strokeWeight};a.hasOwnProperty("icons")&&(b.icons=a.icons),this.polyline=this.map.drawPolyline(b).getPath()},j.Route.prototype.getRoute=function(a){var b=this;this.map.getRoutes({origin:this.origin,destination:this.destination,travelMode:a.travelMode,waypoints:this.waypoints||[],error:a.error,callback:function(){b.route=e[0],a.callback&&a.callback.call(b)}})},j.Route.prototype.back=function(){if(this.step_count>0){this.step_count--;var a=this.route.legs[0].steps[this.step_count].path;for(var b in a)a.hasOwnProperty(b)&&this.polyline.pop()}},j.Route.prototype.forward=function(){if(this.step_count<this.steps_length){var a=this.route.legs[0].steps[this.step_count].path;for(var b in a)a.hasOwnProperty(b)&&this.polyline.push(a[b]);this.step_count++}},j.prototype.checkGeofence=function(a,b,c){return c.containsLatLng(new google.maps.LatLng(a,b))},j.prototype.checkMarkerGeofence=function(a,b){if(a.fences)for(var c,d=0;c=a.fences[d];d++){var e=a.getPosition();this.checkGeofence(e.lat(),e.lng(),c)||b(a,c)}},j.prototype.toImage=function(a){var a=a||{},b={};if(b.size=a.size||[this.el.clientWidth,this.el.clientHeight],b.lat=this.getCenter().lat(),b.lng=this.getCenter().lng(),this.markers.length>0){b.markers=[];for(var c=0;c<this.markers.length;c++)b.markers.push({lat:this.markers[c].getPosition().lat(),lng:this.markers[c].getPosition().lng()})}if(this.polylines.length>0){var d=this.polylines[0];b.polyline={},b.polyline.path=google.maps.geometry.encoding.encodePath(d.getPath()),b.polyline.strokeColor=d.strokeColor,b.polyline.strokeOpacity=d.strokeOpacity,b.polyline.strokeWeight=d.strokeWeight}return j.staticMapURL(b)},j.staticMapURL=function(a){function b(a,b){if("#"===a[0]&&(a=a.replace("#","0x"),b)){if(b=parseFloat(b),b=Math.min(1,Math.max(b,0)),0===b)return"0x00000000";b=(255*b).toString(16),1===b.length&&(b+=b),a=a.slice(0,8)+b}return a}var c,d=[],e=("file:"===location.protocol?"http:":location.protocol)+"//maps.googleapis.com/maps/api/staticmap";a.url&&(e=a.url,delete a.url),e+="?";var f=a.markers;delete a.markers,!f&&a.marker&&(f=[a.marker],delete a.marker);var g=a.styles;delete a.styles;var h=a.polyline;if(delete a.polyline,a.center)d.push("center="+a.center),delete a.center;else if(a.address)d.push("center="+a.address),delete a.address;else if(a.lat)d.push(["center=",a.lat,",",a.lng].join("")),delete a.lat,delete a.lng;else if(a.visible){var i=encodeURI(a.visible.join("|"));d.push("visible="+i)}var j=a.size;j?(j.join&&(j=j.join("x")),delete a.size):j="630x300",d.push("size="+j),a.zoom||a.zoom===!1||(a.zoom=15);var k=a.hasOwnProperty("sensor")?!!a.sensor:!0;delete a.sensor,d.push("sensor="+k);for(var l in a)a.hasOwnProperty(l)&&d.push(l+"="+a[l]);if(f)for(var m,n,o=0;c=f[o];o++){m=[],c.size&&"normal"!==c.size?(m.push("size:"+c.size),delete c.size):c.icon&&(m.push("icon:"+encodeURI(c.icon)),delete c.icon),c.color&&(m.push("color:"+c.color.replace("#","0x")),delete c.color),c.label&&(m.push("label:"+c.label[0].toUpperCase()),delete c.label),n=c.address?c.address:c.lat+","+c.lng,delete c.address,delete c.lat,delete c.lng;for(var l in c)c.hasOwnProperty(l)&&m.push(l+":"+c[l]);m.length||0===o?(m.push(n),m=m.join("|"),d.push("markers="+encodeURI(m))):(m=d.pop()+encodeURI("|"+n),d.push(m))}if(g)for(var o=0;o<g.length;o++){var p=[];g[o].featureType&&p.push("feature:"+g[o].featureType.toLowerCase()),g[o].elementType&&p.push("element:"+g[o].elementType.toLowerCase());for(var q=0;q<g[o].stylers.length;q++)for(var r in g[o].stylers[q]){var s=g[o].stylers[q][r];("hue"==r||"color"==r)&&(s="0x"+s.substring(1)),p.push(r+":"+s)}var t=p.join("|");""!=t&&d.push("style="+t)}if(h){if(c=h,h=[],c.strokeWeight&&h.push("weight:"+parseInt(c.strokeWeight,10)),c.strokeColor){var u=b(c.strokeColor,c.strokeOpacity);h.push("color:"+u)}if(c.fillColor){var v=b(c.fillColor,c.fillOpacity);h.push("fillcolor:"+v)}var w=c.path;if(w.join)for(var x,q=0;x=w[q];q++)h.push(x.join(","));else h.push("enc:"+w);h=h.join("|"),d.push("path="+encodeURI(h))}var y=window.devicePixelRatio||1;return d.push("scale="+y),d=d.join("&"),e+d},j.prototype.addMapType=function(a,b){if(!b.hasOwnProperty("getTileUrl")||"function"!=typeof b.getTileUrl)throw"'getTileUrl' function required.";b.tileSize=b.tileSize||new google.maps.Size(256,256);var c=new google.maps.ImageMapType(b);this.map.mapTypes.set(a,c)},j.prototype.addOverlayMapType=function(a){if(!a.hasOwnProperty("getTile")||"function"!=typeof a.getTile)throw"'getTile' function required.";var b=a.index;delete a.index,this.map.overlayMapTypes.insertAt(b,a)},j.prototype.removeOverlayMapType=function(a){this.map.overlayMapTypes.removeAt(a)},j.prototype.addStyle=function(a){var b=new google.maps.StyledMapType(a.styles,{name:a.styledMapName});this.map.mapTypes.set(a.mapTypeId,b)},j.prototype.setStyle=function(a){this.map.setMapTypeId(a)},j.prototype.createPanorama=function(a){return a.hasOwnProperty("lat")&&a.hasOwnProperty("lng")||(a.lat=this.getCenter().lat(),a.lng=this.getCenter().lng()),this.panorama=j.createPanorama(a),this.map.setStreetView(this.panorama),this.panorama},j.createPanorama=function(b){var c=h(b.el,b.context);b.position=new google.maps.LatLng(b.lat,b.lng),delete b.el,delete b.context,delete b.lat,delete b.lng;for(var d=["closeclick","links_changed","pano_changed","position_changed","pov_changed","resize","visible_changed"],e=a({visible:!0},b),f=0;f<d.length;f++)delete e[d[f]];for(var g=new google.maps.StreetViewPanorama(c,e),f=0;f<d.length;f++)!function(a,c){b[c]&&google.maps.event.addListener(a,c,function(){b[c].apply(this)})}(g,d[f]);return g},j.prototype.on=function(a,b){return j.on(a,this,b)},j.prototype.off=function(a){j.off(a,this)},j.prototype.once=function(a,b){return j.once(a,this,b)},j.custom_events=["marker_added","marker_removed","polyline_added","polyline_removed","polygon_added","polygon_removed","geolocated","geolocation_failed"],j.on=function(a,b,c){if(-1==j.custom_events.indexOf(a))return b instanceof j&&(b=b.map),google.maps.event.addListener(b,a,c);var d={handler:c,eventName:a};return b.registered_events[a]=b.registered_events[a]||[],b.registered_events[a].push(d),d},j.off=function(a,b){-1==j.custom_events.indexOf(a)?(b instanceof j&&(b=b.map),google.maps.event.clearListeners(b,a)):b.registered_events[a]=[]},j.once=function(a,b,c){return-1==j.custom_events.indexOf(a)?(b instanceof j&&(b=b.map),google.maps.event.addListenerOnce(b,a,c)):void 0},j.fire=function(a,b,c){if(-1==j.custom_events.indexOf(a))google.maps.event.trigger(b,a,Array.prototype.slice.apply(arguments).slice(2));else if(a in c.registered_events)for(var d=c.registered_events[a],e=0;e<d.length;e++)!function(a,b,c){a.apply(b,[c])}(d[e].handler,c,b)},j.geolocate=function(a){var b=a.always||a.complete;navigator.geolocation?navigator.geolocation.getCurrentPosition(function(c){a.success(c),b&&b()},function(c){a.error(c),b&&b()},a.options):(a.not_supported(),b&&b())},j.geocode=function(a){this.geocoder=new google.maps.Geocoder;var b=a.callback;a.hasOwnProperty("lat")&&a.hasOwnProperty("lng")&&(a.latLng=new google.maps.LatLng(a.lat,a.lng)),delete a.lat,delete a.lng,delete a.callback,this.geocoder.geocode(a,function(a,c){b(a,c)})},"object"==typeof window.google&&window.google.maps&&(google.maps.Polygon.prototype.getBounds||(google.maps.Polygon.prototype.getBounds=function(a){for(var b,c=new google.maps.LatLngBounds,d=this.getPaths(),e=0;e<d.getLength();e++){b=d.getAt(e);for(var f=0;f<b.getLength();f++)c.extend(b.getAt(f))}return c}),google.maps.Polygon.prototype.containsLatLng||(google.maps.Polygon.prototype.containsLatLng=function(a){var b=this.getBounds();if(null!==b&&!b.contains(a))return!1;for(var c=!1,d=this.getPaths().getLength(),e=0;d>e;e++)for(var f=this.getPaths().getAt(e),g=f.getLength(),h=g-1,i=0;g>i;i++){var j=f.getAt(i),k=f.getAt(h);(j.lng()<a.lng()&&k.lng()>=a.lng()||k.lng()<a.lng()&&j.lng()>=a.lng())&&j.lat()+(a.lng()-j.lng())/(k.lng()-j.lng())*(k.lat()-j.lat())<a.lat()&&(c=!c),h=i}return c}),google.maps.Circle.prototype.containsLatLng||(google.maps.Circle.prototype.containsLatLng=function(a){return google.maps.geometry?google.maps.geometry.spherical.computeDistanceBetween(this.getCenter(),a)<=this.getRadius():!0}),google.maps.Rectangle.prototype.containsLatLng=function(a){return this.getBounds().contains(a)},google.maps.LatLngBounds.prototype.containsLatLng=function(a){return this.contains(a)},google.maps.Marker.prototype.setFences=function(a){this.fences=a},google.maps.Marker.prototype.addFence=function(a){this.fences.push(a)},google.maps.Marker.prototype.getId=function(){return this.__gm_id}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){if(null==this)throw new TypeError;var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!=d?d=0:0!=d&&d!=1/0&&d!=-(1/0)&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1}),j});
|
2 |
+
//# sourceMappingURL=gmaps.min.js.map
|
public/class-auxels.php
CHANGED
@@ -54,6 +54,7 @@ class AUXELS {
|
|
54 |
|
55 |
add_action( 'init', array( $this, 'init' ) );
|
56 |
|
|
|
57 |
// Activate plugin when new blog is added
|
58 |
add_action( 'wpmu_new_blog', array( $this, 'activate_new_site' ) );
|
59 |
|
@@ -66,48 +67,83 @@ class AUXELS {
|
|
66 |
*
|
67 |
* @return [type] [description]
|
68 |
*/
|
69 |
-
|
70 |
|
71 |
-
|
72 |
-
|
|
|
|
|
|
|
73 |
|
74 |
|
75 |
-
|
76 |
-
|
77 |
|
78 |
-
// Load AJAX spesific codes on demand
|
79 |
-
if ( defined('DOING_AJAX') && DOING_AJAX ){
|
80 |
-
include( AUXELS_ADMIN_DIR . '/includes/admin-ajax.php' );
|
81 |
-
}
|
82 |
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
|
88 |
-
// Load Frontend Functionality
|
89 |
-
} else {
|
90 |
-
include 'includes/index.php';
|
91 |
}
|
92 |
|
93 |
-
}
|
94 |
|
95 |
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
|
103 |
-
// @deprecate version 5.0
|
104 |
-
global $wp_version;
|
105 |
-
if ( version_compare( $wp_version, '4.6', '<' ) ) {
|
106 |
-
// Load plugin text domain
|
107 |
-
$this->load_plugin_textdomain();
|
108 |
}
|
109 |
|
110 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
|
112 |
|
113 |
/**
|
@@ -212,6 +248,10 @@ class AUXELS {
|
|
212 |
*/
|
213 |
private static function single_activate() {
|
214 |
|
|
|
|
|
|
|
|
|
215 |
do_action( 'auxels_activated', get_current_blog_id() );
|
216 |
}
|
217 |
|
54 |
|
55 |
add_action( 'init', array( $this, 'init' ) );
|
56 |
|
57 |
+
|
58 |
// Activate plugin when new blog is added
|
59 |
add_action( 'wpmu_new_blog', array( $this, 'activate_new_site' ) );
|
60 |
|
67 |
*
|
68 |
* @return [type] [description]
|
69 |
*/
|
70 |
+
private function includes() {
|
71 |
|
72 |
+
// Auto-load classes on demand
|
73 |
+
if ( function_exists( "__autoload" ) ) {
|
74 |
+
spl_autoload_register( "__autoload" );
|
75 |
+
}
|
76 |
+
spl_autoload_register( array( $this, 'autoload' ) );
|
77 |
|
78 |
|
79 |
+
// load common functionalities
|
80 |
+
include_once( AUXELS_INC_DIR . '/index.php' );
|
81 |
|
|
|
|
|
|
|
|
|
82 |
|
83 |
+
// Dashboard and Administrative Functionality
|
84 |
+
if ( is_admin() ) {
|
85 |
+
|
86 |
+
// Load AJAX spesific codes on demand
|
87 |
+
if ( defined('DOING_AJAX') && DOING_AJAX ){
|
88 |
+
include( AUXELS_ADMIN_DIR . '/includes/admin-ajax.php' );
|
89 |
+
}
|
90 |
+
|
91 |
+
// Load admin spesific codes
|
92 |
+
else {
|
93 |
+
$this->admin = include( AUXELS_ADMIN_DIR . '/class-auxels-admin.php' );
|
94 |
+
}
|
95 |
+
|
96 |
+
// Load Frontend Functionality
|
97 |
+
} else {
|
98 |
+
include 'includes/index.php';
|
99 |
+
}
|
100 |
|
|
|
|
|
|
|
101 |
}
|
102 |
|
|
|
103 |
|
104 |
|
105 |
+
/**
|
106 |
+
* Auto-load classes on demand to reduce memory consumption
|
107 |
+
*
|
108 |
+
* @param mixed $class
|
109 |
+
* @return void
|
110 |
+
*/
|
111 |
+
public function autoload( $class ) {
|
112 |
+
$path = null;
|
113 |
+
$class = strtolower( $class );
|
114 |
+
$file = 'class-' . str_replace( '_', '-', $class ) . '.php';
|
115 |
+
|
116 |
+
// the possible pathes containing classes
|
117 |
+
$possible_pathes = array(
|
118 |
+
AUXELS_INC_DIR . '/classes/'
|
119 |
+
);
|
120 |
+
|
121 |
+
foreach ( $possible_pathes as $path ) {
|
122 |
+
if( is_readable( $path . $file ) ){
|
123 |
+
include_once( $path . $file );
|
124 |
+
return;
|
125 |
+
}
|
126 |
+
|
127 |
+
}
|
128 |
|
|
|
|
|
|
|
|
|
|
|
129 |
}
|
130 |
|
131 |
+
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Init the plugin when WordPress Initialises.
|
135 |
+
*
|
136 |
+
* @return void
|
137 |
+
*/
|
138 |
+
public function init(){
|
139 |
+
|
140 |
+
// @deprecate version 5.0
|
141 |
+
global $wp_version;
|
142 |
+
if ( version_compare( $wp_version, '4.6', '<' ) ) {
|
143 |
+
// Load plugin text domain
|
144 |
+
$this->load_plugin_textdomain();
|
145 |
+
}
|
146 |
+
}
|
147 |
|
148 |
|
149 |
/**
|
248 |
*/
|
249 |
private static function single_activate() {
|
250 |
|
251 |
+
// try to regenerate the asset files on plugin activation
|
252 |
+
auxin_add_custom_js();
|
253 |
+
auxin_add_custom_css();
|
254 |
+
|
255 |
do_action( 'auxels_activated', get_current_blog_id() );
|
256 |
}
|
257 |
|
public/includes/class-auxels-frontend-assets.php
CHANGED
@@ -20,7 +20,7 @@ class AUXELS_Frontend_Assets {
|
|
20 |
* Construct
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
-
|
24 |
}
|
25 |
|
26 |
/**
|
@@ -28,18 +28,20 @@ class AUXELS_Frontend_Assets {
|
|
28 |
*
|
29 |
* @return void
|
30 |
*/
|
31 |
-
public function
|
32 |
-
//wp_enqueue_style( AUXELS_SLUG .'-main', AUXELS_PUB_URL . '/assets/css/main.css', array(), AUXELS_VERSION );
|
33 |
-
}
|
34 |
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
//wp_enqueue_script( AUXELS_SLUG .'-main', AUXELS_PUB_URL . '/assets/js/main.js', array('jquery'), AUXELS_VERSION, true );
|
42 |
}
|
43 |
|
44 |
}
|
45 |
return new AUXELS_Frontend_Assets();
|
|
|
|
|
|
|
|
|
|
20 |
* Construct
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'load_assets' ) );
|
24 |
}
|
25 |
|
26 |
/**
|
28 |
*
|
29 |
* @return void
|
30 |
*/
|
31 |
+
public function load_assets() {
|
|
|
|
|
32 |
|
33 |
+
if( $google_map_api_key = auxin_get_option( 'auxin_google_map_api_key') ){
|
34 |
+
wp_enqueue_script( 'mapapi', esc_url( set_url_scheme( 'http://maps.googleapis.com/maps/api/js?v=3&key='. $google_map_api_key ) ) , null, null, TRUE );
|
35 |
+
}
|
36 |
+
|
37 |
+
//wp_enqueue_style( AUXELS_SLUG .'-main', AUXELS_PUB_URL . '/assets/css/main.css', array(), AUXELS_VERSION );
|
38 |
+
wp_enqueue_script( AUXELS_SLUG .'-gmaps', AUXELS_PUB_URL . '/assets/js/gmaps.min.js', array('jquery'), AUXELS_VERSION, true );
|
|
|
39 |
}
|
40 |
|
41 |
}
|
42 |
return new AUXELS_Frontend_Assets();
|
43 |
+
|
44 |
+
|
45 |
+
|
46 |
+
|
47 |
+
|
public/templates/vcomposer/vc_row.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
die( '-1' );
|
5 |
}
|
@@ -23,39 +22,52 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
23 |
* @var $parallax_speed_bg
|
24 |
* @var $parallax_speed_video
|
25 |
* @var $content - shortcode content
|
|
|
26 |
* Shortcode class
|
27 |
* @var $this WPBakeryShortCode_VC_Row
|
28 |
*/
|
29 |
-
$el_class = $full_height = $parallax_speed_bg = $parallax_speed_video = $full_width = $equal_height = $flex_row = $columns_placement = $content_placement = $parallax = $parallax_image = $css = $el_id = $video_bg = $video_bg_url = $video_bg_parallax = '';
|
|
|
30 |
$output = $after_output = '';
|
31 |
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
|
32 |
extract( $atts );
|
33 |
|
34 |
-
$aux_row_inner_wrapper_start = '';
|
35 |
-
$aux_row_inner_wrapper_end = '';
|
36 |
-
$aux_row_parent_wrapper_start = '';
|
37 |
-
$aux_row_parent_wrapper_end = '';
|
38 |
-
|
39 |
-
|
40 |
|
41 |
wp_enqueue_script( 'wpb_composer_front_js' );
|
42 |
|
43 |
-
$el_class = $this->getExtraClass( $el_class );
|
44 |
|
45 |
$css_classes = array(
|
46 |
'vc_row',
|
47 |
-
'wpb_row',
|
|
|
48 |
'vc_row-fluid',
|
49 |
$el_class,
|
50 |
vc_shortcode_custom_css_class( $css ),
|
51 |
);
|
52 |
|
53 |
-
if (
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
}
|
56 |
|
57 |
-
if (!empty($atts['gap'])) {
|
58 |
-
$css_classes[] = 'vc_column-gap-'
|
59 |
}
|
60 |
|
61 |
$wrapper_attributes = array();
|
@@ -64,24 +76,63 @@ if ( ! empty( $el_id ) ) {
|
|
64 |
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
|
65 |
}
|
66 |
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
$css_classes[] = 'vc_row-no-padding';
|
76 |
-
|
77 |
-
|
78 |
-
}
|
79 |
-
|
80 |
-
$
|
81 |
-
$
|
82 |
-
|
83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
}
|
|
|
|
|
85 |
|
86 |
if ( ! empty( $full_height ) ) {
|
87 |
$css_classes[] = 'vc_row-o-full-height';
|
@@ -131,6 +182,7 @@ if ( ! empty( $parallax ) ) {
|
|
131 |
}
|
132 |
}
|
133 |
|
|
|
134 |
if ( ! empty( $parallax_image ) ) {
|
135 |
if ( $has_video_bg ) {
|
136 |
$parallax_image_src = $parallax_image;
|
@@ -149,14 +201,13 @@ if ( ! $parallax && $has_video_bg ) {
|
|
149 |
$css_class = preg_replace( '/\s+/', ' ', apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, implode( ' ', array_filter( array_unique( $css_classes ) ) ), $this->settings['base'], $atts ) );
|
150 |
$wrapper_attributes[] = 'class="' . esc_attr( trim( $css_class ) ) . '"';
|
151 |
|
152 |
-
|
|
|
153 |
$output .= '<div ' . implode( ' ', $wrapper_attributes ) . '>';
|
154 |
-
$output .= $
|
155 |
$output .= wpb_js_remove_wpautop( $content );
|
156 |
-
$output .= $
|
157 |
$output .= '</div>';
|
158 |
-
$output .= $aux_row_parent_wrapper_end;
|
159 |
$output .= $after_output;
|
160 |
|
161 |
echo $output;
|
162 |
-
|
1 |
<?php
|
|
|
2 |
if ( ! defined( 'ABSPATH' ) ) {
|
3 |
die( '-1' );
|
4 |
}
|
22 |
* @var $parallax_speed_bg
|
23 |
* @var $parallax_speed_video
|
24 |
* @var $content - shortcode content
|
25 |
+
* @var $css_animation
|
26 |
* Shortcode class
|
27 |
* @var $this WPBakeryShortCode_VC_Row
|
28 |
*/
|
29 |
+
$el_class = $full_height = $parallax_speed_bg = $parallax_speed_video = $full_width = $equal_height = $flex_row = $columns_placement = $content_placement = $parallax = $parallax_image = $css = $el_id = $video_bg = $video_bg_url = $video_bg_parallax = $css_animation = '';
|
30 |
+
$disable_element = '';
|
31 |
$output = $after_output = '';
|
32 |
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
|
33 |
extract( $atts );
|
34 |
|
35 |
+
$aux_row_inner_wrapper_start = ''; // @auxin
|
36 |
+
$aux_row_inner_wrapper_end = ''; // @auxin
|
37 |
+
$aux_row_parent_wrapper_start = ''; // @auxin
|
38 |
+
$aux_row_parent_wrapper_end = ''; // @auxin
|
|
|
|
|
39 |
|
40 |
wp_enqueue_script( 'wpb_composer_front_js' );
|
41 |
|
42 |
+
$el_class = $this->getExtraClass( $el_class ) . $this->getCSSAnimation( $css_animation );
|
43 |
|
44 |
$css_classes = array(
|
45 |
'vc_row',
|
46 |
+
'wpb_row',
|
47 |
+
//deprecated
|
48 |
'vc_row-fluid',
|
49 |
$el_class,
|
50 |
vc_shortcode_custom_css_class( $css ),
|
51 |
);
|
52 |
|
53 |
+
if ( 'yes' === $disable_element ) {
|
54 |
+
if ( vc_is_page_editable() ) {
|
55 |
+
$css_classes[] = 'vc_hidden-lg vc_hidden-xs vc_hidden-sm vc_hidden-md';
|
56 |
+
} else {
|
57 |
+
return '';
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
if ( vc_shortcode_custom_css_has_property( $css, array(
|
62 |
+
'border',
|
63 |
+
'background',
|
64 |
+
) ) || $video_bg || $parallax
|
65 |
+
) {
|
66 |
+
$css_classes[] = 'vc_row-has-fill';
|
67 |
}
|
68 |
|
69 |
+
if ( ! empty( $atts['gap'] ) ) {
|
70 |
+
$css_classes[] = 'vc_column-gap-' . $atts['gap'];
|
71 |
}
|
72 |
|
73 |
$wrapper_attributes = array();
|
76 |
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
|
77 |
}
|
78 |
|
79 |
+
// @auxin start
|
80 |
+
/**
|
81 |
+
* Row stretch:
|
82 |
+
* - Default: $full_width = '';
|
83 |
+
* - Stretch row: $full_width = 'stretch_row';
|
84 |
+
* - Stretch row and content: $full_width = 'stretch_row_content';
|
85 |
+
* - Stretch row and content (no padding): $full_width = 'stretch_row_content_no_spaces';
|
86 |
+
*/
|
87 |
+
global $post, $auxin_content_layout;
|
88 |
+
|
89 |
+
$row_wrapper_inner_start = $row_wrapper_inner_end = '';
|
90 |
+
|
91 |
+
//$auxـwrapper_classes = array('aux-vc-row-wrapper');
|
92 |
+
|
93 |
+
// Dont let vc to stretch the row by javascript if content layout is full
|
94 |
+
if( $post && 'full' == $auxin_content_layout ){
|
95 |
+
|
96 |
+
$inner_wrapper_class = '';
|
97 |
+
|
98 |
+
// if row stretch was 'default' or 'stretch_row'
|
99 |
+
if( empty( $full_width ) || 'stretch_row' == $full_width ){
|
100 |
+
$css_classes[] = 'aux-vc-boxed-content';
|
101 |
+
$inner_wrapper_class = 'aux-fold-width';
|
102 |
+
|
103 |
+
// if row stretch was stretch row and content
|
104 |
+
} else if ( 'stretch_row_content' === $full_width ) {
|
105 |
+
$css_classes[] = 'aux-vc-stretch-content';
|
106 |
+
$css_classes[] = 'aux-vc-stretch-row';
|
107 |
+
|
108 |
+
}else if ( 'stretch_row_content_no_spaces' === $full_width ) {
|
109 |
$css_classes[] = 'vc_row-no-padding';
|
110 |
+
$css_classes[] = 'aux-vc-stretch-content';
|
111 |
+
$css_classes[] = 'aux-vc-stretch-row';
|
112 |
+
}
|
113 |
+
|
114 |
+
$row_wrapper_inner_start = '<div class="aux-vc-row-wrapper-inner '. $inner_wrapper_class .'"><div class="aux-vc-row-margin">';
|
115 |
+
$row_wrapper_inner_end = '</div></div>';
|
116 |
+
|
117 |
+
} else {
|
118 |
+
// @auxin end
|
119 |
+
|
120 |
+
if ( ! empty( $full_width ) ) {
|
121 |
+
$wrapper_attributes[] = 'data-vc-full-width="true"';
|
122 |
+
$wrapper_attributes[] = 'data-vc-full-width-init="false"';
|
123 |
+
if ( 'stretch_row_content' === $full_width ) {
|
124 |
+
$wrapper_attributes[] = 'data-vc-stretch-content="true"';
|
125 |
+
} elseif ( 'stretch_row_content_no_spaces' === $full_width ) {
|
126 |
+
$wrapper_attributes[] = 'data-vc-stretch-content="true"';
|
127 |
+
$css_classes[] = 'vc_row-no-padding';
|
128 |
+
}
|
129 |
+
$after_output .= '<div class="vc_row-full-width vc_clearfix"></div>';
|
130 |
+
}
|
131 |
+
|
132 |
+
// @auxin start
|
133 |
}
|
134 |
+
// @auxin end
|
135 |
+
|
136 |
|
137 |
if ( ! empty( $full_height ) ) {
|
138 |
$css_classes[] = 'vc_row-o-full-height';
|
182 |
}
|
183 |
}
|
184 |
|
185 |
+
|
186 |
if ( ! empty( $parallax_image ) ) {
|
187 |
if ( $has_video_bg ) {
|
188 |
$parallax_image_src = $parallax_image;
|
201 |
$css_class = preg_replace( '/\s+/', ' ', apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, implode( ' ', array_filter( array_unique( $css_classes ) ) ), $this->settings['base'], $atts ) );
|
202 |
$wrapper_attributes[] = 'class="' . esc_attr( trim( $css_class ) ) . '"';
|
203 |
|
204 |
+
|
205 |
+
|
206 |
$output .= '<div ' . implode( ' ', $wrapper_attributes ) . '>';
|
207 |
+
$output .= $row_wrapper_inner_start; // @auxin
|
208 |
$output .= wpb_js_remove_wpautop( $content );
|
209 |
+
$output .= $row_wrapper_inner_end; // @auxin
|
210 |
$output .= '</div>';
|
|
|
211 |
$output .= $after_output;
|
212 |
|
213 |
echo $output;
|
|