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 @@
|
|