Version Description
Download this release
Release Info
Developer | sagarseth9 |
Plugin | WP Responsive Menu |
Version | 3.1.7 |
Comparing to | |
See all releases |
Code changes from version 3.1.6 to 3.1.7
- inc/class-wp-responsive-menu.php +22 -13
- inc/includes/class-options-framework-admin.php +0 -429
- inc/js/options-custom.js +3 -0
- inc/templates/menu-elements.php +6 -6
- inc/wprmclass.php +3 -3
- inc/wprmenu-loader.php +1 -1
- inc/wprmenu-options.php +1 -1
- readme.txt +9 -3
- wp-responsive-menu.php +1 -1
inc/class-wp-responsive-menu.php
CHANGED
@@ -47,7 +47,7 @@ class WP_Responsive_Menu {
|
|
47 |
}
|
48 |
|
49 |
|
50 |
-
add_action( 'wpr_optionsframework_after_validate', array( $this, 'save_options_notice' ) );
|
51 |
|
52 |
add_action( 'wp_ajax_wpr_live_update', array( $this, 'wpr_live_update' ) );
|
53 |
|
@@ -205,6 +205,7 @@ class WP_Responsive_Menu {
|
|
205 |
'parent_click' => ( $this->option('parent_click') == 'yes' || $this->option('parent_click') == '1' ) ? 'yes' : '',
|
206 |
'swipe' => $this->option( 'swipe' ),
|
207 |
'enable_overlay' => $this->option( 'enable_overlay' ),
|
|
|
208 |
);
|
209 |
|
210 |
//Localize necessary variables
|
@@ -343,8 +344,13 @@ class WP_Responsive_Menu {
|
|
343 |
* @return array
|
344 |
*/
|
345 |
public function wpr_live_update() {
|
|
|
|
|
|
|
|
|
|
|
346 |
if ( isset( $_POST['wprmenu_options'] ) ) {
|
347 |
-
set_transient('wpr_live_settings', $_POST['wprmenu_options'], 60 * 60 * 24);
|
348 |
}
|
349 |
wp_die();
|
350 |
}
|
@@ -359,6 +365,10 @@ class WP_Responsive_Menu {
|
|
359 |
*/
|
360 |
public function wprmenu_import_data() {
|
361 |
|
|
|
|
|
|
|
|
|
362 |
$response = 'error';
|
363 |
$menu = '';
|
364 |
|
@@ -367,10 +377,10 @@ class WP_Responsive_Menu {
|
|
367 |
}
|
368 |
|
369 |
if ( isset($_POST) ) {
|
370 |
-
$settings_id = isset($_POST['settings_id']) ? $_POST['settings_id'] : '';
|
371 |
-
$demo_type = isset($_POST['demo_type']) ? $_POST['demo_type'] : '';
|
372 |
|
373 |
-
$demo_id = isset($_POST['demo_id']) ? $_POST['demo_id'] : '';
|
374 |
|
375 |
if ( $settings_id !== ''
|
376 |
&& $demo_type !== ''
|
@@ -437,17 +447,11 @@ class WP_Responsive_Menu {
|
|
437 |
*/
|
438 |
public function save_options_notice() {
|
439 |
|
440 |
-
$menus =
|
441 |
-
|
442 |
-
if ( empty( $menus ) ) {
|
443 |
-
$admin_menu_url = admin_url( 'nav-menus.php' );
|
444 |
-
|
445 |
-
add_settings_error( 'wprmenu-framework', 'save_options', __( 'It seems that still you haven\'t created any menu. Please create menu from <a href="'.$admin_menu_url.'" target="_blank">here</a>', 'wprmenu' ), 'error fade in' );
|
446 |
-
}
|
447 |
|
448 |
if ( !empty($menus) ) {
|
449 |
if ( !isset($_POST['wprmenu_options']['menu']) ) {
|
450 |
-
add_settings_error( 'wprmenu-framework', 'save_options', __( 'You have not set any menu in the menu settings. Please
|
451 |
}
|
452 |
}
|
453 |
|
@@ -462,6 +466,11 @@ class WP_Responsive_Menu {
|
|
462 |
* @return json object
|
463 |
*/
|
464 |
public function wpr_get_transient_from_data() {
|
|
|
|
|
|
|
|
|
|
|
465 |
$response = 'error';
|
466 |
$check_transient = get_transient( 'wpr_live_settings' );
|
467 |
|
47 |
}
|
48 |
|
49 |
|
50 |
+
// add_action( 'wpr_optionsframework_after_validate', array( $this, 'save_options_notice' ) );
|
51 |
|
52 |
add_action( 'wp_ajax_wpr_live_update', array( $this, 'wpr_live_update' ) );
|
53 |
|
205 |
'parent_click' => ( $this->option('parent_click') == 'yes' || $this->option('parent_click') == '1' ) ? 'yes' : '',
|
206 |
'swipe' => $this->option( 'swipe' ),
|
207 |
'enable_overlay' => $this->option( 'enable_overlay' ),
|
208 |
+
'nonce' => wp_create_nonce( 'wprmenu-nonce' ),
|
209 |
);
|
210 |
|
211 |
//Localize necessary variables
|
344 |
* @return array
|
345 |
*/
|
346 |
public function wpr_live_update() {
|
347 |
+
|
348 |
+
if ( ! wp_verify_nonce( $_POST['nonce'], 'wprmenu-nonce' ) ) {
|
349 |
+
die ( __( 'Error while verifying your request! Try again.', 'wprmenu' ) );
|
350 |
+
}
|
351 |
+
|
352 |
if ( isset( $_POST['wprmenu_options'] ) ) {
|
353 |
+
set_transient('wpr_live_settings', sanitize_text_field( $_POST['wprmenu_options'] ), 60 * 60 * 24);
|
354 |
}
|
355 |
wp_die();
|
356 |
}
|
365 |
*/
|
366 |
public function wprmenu_import_data() {
|
367 |
|
368 |
+
if ( ! wp_verify_nonce( $_POST['nonce'], 'wprmenu-nonce' ) ) {
|
369 |
+
die ( __( 'Error while verifying your request! Try again.', 'wprmenu' ) );
|
370 |
+
}
|
371 |
+
|
372 |
$response = 'error';
|
373 |
$menu = '';
|
374 |
|
377 |
}
|
378 |
|
379 |
if ( isset($_POST) ) {
|
380 |
+
$settings_id = isset($_POST['settings_id']) ? sanitize_text_field( $_POST['settings_id'] ) : '';
|
381 |
+
$demo_type = isset($_POST['demo_type']) ? sanitize_text_field( $_POST['demo_type'] ) : '';
|
382 |
|
383 |
+
$demo_id = isset($_POST['demo_id']) ? sanitize_text_field( $_POST['demo_id'] ) : '';
|
384 |
|
385 |
if ( $settings_id !== ''
|
386 |
&& $demo_type !== ''
|
447 |
*/
|
448 |
public function save_options_notice() {
|
449 |
|
450 |
+
$menus = wpr_get_menus();
|
|
|
|
|
|
|
|
|
|
|
|
|
451 |
|
452 |
if ( !empty($menus) ) {
|
453 |
if ( !isset($_POST['wprmenu_options']['menu']) ) {
|
454 |
+
add_settings_error( 'wprmenu-framework', 'save_options', __( 'You have not set any menu in the menu settings. Please select a menu from General settings tab', 'wprmenu' ), 'error fade in' );
|
455 |
}
|
456 |
}
|
457 |
|
466 |
* @return json object
|
467 |
*/
|
468 |
public function wpr_get_transient_from_data() {
|
469 |
+
|
470 |
+
if ( ! wp_verify_nonce( $_POST['nonce'], 'wprmenu-nonce' ) ) {
|
471 |
+
die ( __( 'Error while verifying your request! Try again.', 'wprmenu' ) );
|
472 |
+
}
|
473 |
+
|
474 |
$response = 'error';
|
475 |
$check_transient = get_transient( 'wpr_live_settings' );
|
476 |
|
inc/includes/class-options-framework-admin.php
DELETED
@@ -1,429 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Wpr_Options_Framework
|
4 |
-
* @author Devin Price <devin@wptheming.com>
|
5 |
-
* @license GPL-2.0+
|
6 |
-
* @link http://wptheming.com
|
7 |
-
* @copyright 2010-2014 WP Theming
|
8 |
-
*/
|
9 |
-
|
10 |
-
class Wpr_Options_Framework_Admin {
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Page hook for the options screen
|
14 |
-
*
|
15 |
-
* @since 1.7.0
|
16 |
-
* @type string
|
17 |
-
*/
|
18 |
-
protected $options_screen = null;
|
19 |
-
|
20 |
-
/**
|
21 |
-
* Hook in the scripts and styles
|
22 |
-
*
|
23 |
-
* @since 1.7.0
|
24 |
-
*/
|
25 |
-
public function init() {
|
26 |
-
|
27 |
-
// Gets options to load
|
28 |
-
$options = & Wpr_Options_Framework::_wpr_optionsframework_options();
|
29 |
-
|
30 |
-
// Checks if options are available
|
31 |
-
if ( $options ) {
|
32 |
-
|
33 |
-
// Add the options page and menu item.
|
34 |
-
add_action( 'admin_menu', array( $this, 'add_custom_options_page' ) );
|
35 |
-
|
36 |
-
// Add the required scripts and styles
|
37 |
-
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_styles' ) );
|
38 |
-
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) );
|
39 |
-
|
40 |
-
// Settings need to be registered after admin_init
|
41 |
-
add_action( 'admin_init', array( $this, 'settings_init' ) );
|
42 |
-
|
43 |
-
// Adds options menu to the admin bar
|
44 |
-
add_action( 'wp_before_admin_bar_render', array( $this, 'wpr_optionsframework_admin_bar' ) );
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
}
|
49 |
-
|
50 |
-
}
|
51 |
-
|
52 |
-
/**
|
53 |
-
* Registers the settings
|
54 |
-
*
|
55 |
-
* @since 1.7.0
|
56 |
-
*/
|
57 |
-
function settings_init() {
|
58 |
-
|
59 |
-
// Load Options Framework Settings
|
60 |
-
$wpr_optionsframework_settings = get_option( 'wpr_optionsframework' );
|
61 |
-
|
62 |
-
// Registers the settings fields and callback
|
63 |
-
register_setting( 'wpr_optionsframework', $wpr_optionsframework_settings['id'], array ( $this, 'validate_options' ) );
|
64 |
-
|
65 |
-
// Displays notice after options save
|
66 |
-
add_action( 'wpr_optionsframework_after_validate', array( $this, 'save_options_notice' ) );
|
67 |
-
|
68 |
-
}
|
69 |
-
|
70 |
-
/*
|
71 |
-
* Define menu options
|
72 |
-
*
|
73 |
-
* Examples usage:
|
74 |
-
*
|
75 |
-
* add_filter( 'wpr_optionsframework_menu', function( $menu ) {
|
76 |
-
* $menu['page_title'] = 'The Options';
|
77 |
-
* $menu['menu_title'] = 'The Options';
|
78 |
-
* return $menu;
|
79 |
-
* });
|
80 |
-
*
|
81 |
-
* @since 1.7.0
|
82 |
-
*
|
83 |
-
*/
|
84 |
-
static function menu_settings() {
|
85 |
-
|
86 |
-
$menu = array(
|
87 |
-
|
88 |
-
// Modes: submenu, menu
|
89 |
-
'mode' => 'menu',
|
90 |
-
|
91 |
-
// Submenu default settings
|
92 |
-
'page_title' => __( 'Theme Options', 'textdomain'),
|
93 |
-
'menu_title' => __('Theme Options', 'textdomain'),
|
94 |
-
'capability' => 'edit_theme_options',
|
95 |
-
'menu_slug' => 'options-framework',
|
96 |
-
'parent_slug' => 'themes.php',
|
97 |
-
|
98 |
-
// Menu default settings
|
99 |
-
'icon_url' => 'dashicons-menu',
|
100 |
-
'position' => '61'
|
101 |
-
|
102 |
-
);
|
103 |
-
|
104 |
-
return apply_filters( 'wpr_optionsframework_menu', $menu );
|
105 |
-
}
|
106 |
-
|
107 |
-
/**
|
108 |
-
* Add a subpage called "Theme Options" to the appearance menu.
|
109 |
-
*
|
110 |
-
* @since 1.7.0
|
111 |
-
*/
|
112 |
-
function add_custom_options_page() {
|
113 |
-
|
114 |
-
$menu = $this->menu_settings();
|
115 |
-
|
116 |
-
switch( $menu['mode'] ) {
|
117 |
-
|
118 |
-
case 'menu':
|
119 |
-
// http://codex.wordpress.org/Function_Reference/add_menu_page
|
120 |
-
$this->options_screen = add_menu_page(
|
121 |
-
$menu['page_title'],
|
122 |
-
$menu['menu_title'],
|
123 |
-
$menu['capability'],
|
124 |
-
$menu['menu_slug'],
|
125 |
-
array( $this, 'options_page' ),
|
126 |
-
$menu['icon_url'],
|
127 |
-
$menu['position']
|
128 |
-
);
|
129 |
-
break;
|
130 |
-
|
131 |
-
default:
|
132 |
-
// http://codex.wordpress.org/Function_Reference/add_submenu_page
|
133 |
-
$this->options_screen = add_submenu_page(
|
134 |
-
$menu['parent_slug'],
|
135 |
-
$menu['page_title'],
|
136 |
-
$menu['menu_title'],
|
137 |
-
$menu['capability'],
|
138 |
-
$menu['menu_slug'],
|
139 |
-
array( $this, 'options_page' ) );
|
140 |
-
break;
|
141 |
-
}
|
142 |
-
|
143 |
-
}
|
144 |
-
|
145 |
-
/**
|
146 |
-
* Loads the required stylesheets
|
147 |
-
*
|
148 |
-
* @since 1.7.0
|
149 |
-
*/
|
150 |
-
|
151 |
-
function enqueue_admin_styles( $hook ) {
|
152 |
-
|
153 |
-
if ( $this->options_screen != $hook )
|
154 |
-
return;
|
155 |
-
|
156 |
-
wp_enqueue_style( 'wpr_optionsframework', WPR_OPTIONS_FRAMEWORK_DIRECTORY . 'css/wpr_optionsframework.css', array(), Wpr_Options_Framework::VERSION );
|
157 |
-
wp_enqueue_style( 'wpr_icons', WPR_OPTIONS_FRAMEWORK_DIRECTORY . 'icons/style.css', array(), Wpr_Options_Framework::VERSION );
|
158 |
-
|
159 |
-
wp_enqueue_style( 'wpr_iconpicker', WPR_OPTIONS_FRAMEWORK_DIRECTORY . 'css/jquery.fonticonpicker.min.css', array(), Wpr_Options_Framework::VERSION );
|
160 |
-
|
161 |
-
wp_enqueue_style( 'select2-style', WPR_OPTIONS_FRAMEWORK_DIRECTORY . 'css/select2.min.css', Wpr_Options_Framework::VERSION );
|
162 |
-
|
163 |
-
// Enqueue custom option panel JS
|
164 |
-
wp_enqueue_script( 'Select2-js', WPR_OPTIONS_FRAMEWORK_DIRECTORY . 'js/select2.full.js', array( 'jquery'), Wpr_Options_Framework::VERSION );
|
165 |
-
|
166 |
-
|
167 |
-
wp_enqueue_style( 'wpr_bootflat', WPR_OPTIONS_FRAMEWORK_DIRECTORY . 'css/site.min.css', array(), Wpr_Options_Framework::VERSION );
|
168 |
-
wp_enqueue_style( 'wp-color-picker' );
|
169 |
-
}
|
170 |
-
|
171 |
-
/**
|
172 |
-
* Loads the required javascript
|
173 |
-
*
|
174 |
-
* @since 1.7.0
|
175 |
-
*/
|
176 |
-
function enqueue_admin_scripts( $hook ) {
|
177 |
-
|
178 |
-
if ( $this->options_screen != $hook )
|
179 |
-
return;
|
180 |
-
|
181 |
-
wp_enqueue_script( 'wpr-bootstrap', 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js', array( 'jquery'), Wpr_Options_Framework::VERSION );
|
182 |
-
|
183 |
-
//Ace js
|
184 |
-
wp_enqueue_script( 'wpr-ace', WPR_OPTIONS_FRAMEWORK_DIRECTORY . 'js/ace-min-noconflict/ace.js', array( 'jquery' ), Wpr_Options_Framework::VERSION );
|
185 |
-
|
186 |
-
wp_enqueue_script( 'wpr-ace-theme-chrome', WPR_OPTIONS_FRAMEWORK_DIRECTORY . 'js/ace-min-noconflict/theme-chrome.js', array( 'jquery' ), Wpr_Options_Framework::VERSION );
|
187 |
-
|
188 |
-
wp_enqueue_script( 'wpr-ace-mode-css', WPR_OPTIONS_FRAMEWORK_DIRECTORY . 'js/ace-min-noconflict/mode-css.js', array( 'jquery' ), Wpr_Options_Framework::VERSION );
|
189 |
-
|
190 |
-
// Enqueue icon-picker js
|
191 |
-
wp_enqueue_script( 'icon-picker', WPR_OPTIONS_FRAMEWORK_DIRECTORY . 'js/jquery.fonticonpicker.min.js', array( 'jquery' ), Wpr_Options_Framework::VERSION );
|
192 |
-
|
193 |
-
//Exit Intent
|
194 |
-
wp_enqueue_script( 'wpr-exit-intent', WPR_OPTIONS_FRAMEWORK_DIRECTORY . 'js/wpr-exit-intent.js', array( 'jquery' ), Wpr_Options_Framework::VERSION );
|
195 |
-
|
196 |
-
// Enqueue SweetAlert2 Style
|
197 |
-
wp_enqueue_style( 'Sweetalert2-css', WPR_OPTIONS_FRAMEWORK_DIRECTORY . 'css/sweetalert2.min.css', Wpr_Options_Framework::VERSION );
|
198 |
-
|
199 |
-
// Enqueue SweetAlert2 JS
|
200 |
-
wp_enqueue_script( 'Sweetalert2-js', WPR_OPTIONS_FRAMEWORK_DIRECTORY . 'js/sweetalert2.all.min.js', array( 'jquery'), Wpr_Options_Framework::VERSION );
|
201 |
-
|
202 |
-
// Enqueue custom option panel JS
|
203 |
-
wp_enqueue_script( 'options-custom', WPR_OPTIONS_FRAMEWORK_DIRECTORY . 'js/options-custom.js', array( 'jquery','wp-color-picker', 'Select2-js', 'wpr-ace', 'wpr-exit-intent', 'Sweetalert2-js' ), Wpr_Options_Framework::VERSION );
|
204 |
-
|
205 |
-
$option_var = array(
|
206 |
-
'options_path' => WPR_OPTIONS_FRAMEWORK_DIRECTORY,
|
207 |
-
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
208 |
-
'view_demo' => __('View Demo', 'wprmenu'),
|
209 |
-
'preview_done' => __('Preview Done', 'wprmenu'),
|
210 |
-
'loading_preview' => __('Loading Preview', 'wprmenu'),
|
211 |
-
'import_demo' => __('Import Demo', 'wprmenu'),
|
212 |
-
'import_error' => __('Something went wrong', 'wprmenu'),
|
213 |
-
'please_wait' => __('Please Wait !', 'wprmenu'),
|
214 |
-
'please_reload' => __('Please reload the page by doing click the button below', 'wprmenu'),
|
215 |
-
'reload' => __('Reload', 'wprmenu'),
|
216 |
-
'import_error_title' => __('Oops...', 'wprmenu'),
|
217 |
-
'import_error' => __('Something went wrong', 'wprmenu'),
|
218 |
-
'import_done' => __('Import Done', 'wprmenu'),
|
219 |
-
'update_license_key' => __('Please Update Your License Key To Import Demo', 'wprmenu'),
|
220 |
-
'pro_message' => __('Import requires PRO version', 'wprmenu'),
|
221 |
-
'site_url' => get_site_url(),
|
222 |
-
'please_reload' => __('Please reload the page by doing click the button below', 'wprmenu'),
|
223 |
-
'reload' => __('Reload', 'wprmenu'),
|
224 |
-
'navigating_away' => __('Seems like navigating away', 'wprmenu'),
|
225 |
-
'confirm_message' => __('Are you sure to navigate away? Please save all the changes otherwise the recent changes will be reverted back', 'wprmenu'),
|
226 |
-
'pro_version_text' => __('Pro Version', 'wprmenu'),
|
227 |
-
'pro_version_upgrade_error' => __('This demo requires pro version to be activated', 'wprmenu'),
|
228 |
-
);
|
229 |
-
wp_localize_script( 'options-custom', 'wprOption' , $option_var );
|
230 |
-
|
231 |
-
// Inline scripts from options-interface.php
|
232 |
-
add_action( 'admin_head', array( $this, 'wpr_of_admin_head' ) );
|
233 |
-
}
|
234 |
-
|
235 |
-
function wpr_of_admin_head() {
|
236 |
-
// Hook to add custom scripts
|
237 |
-
do_action( 'wpr_optionsframework_custom_scripts' );
|
238 |
-
}
|
239 |
-
|
240 |
-
/**
|
241 |
-
* Builds out the options panel.
|
242 |
-
*
|
243 |
-
* If we were using the Settings API as it was intended we would use
|
244 |
-
* do_settings_sections here. But as we don't want the settings wrapped in a table,
|
245 |
-
* we'll call our own custom wpr_optionsframework_fields. See options-interface.php
|
246 |
-
* for specifics on how each individual field is generated.
|
247 |
-
*
|
248 |
-
* Nonces are provided using the settings_fields()
|
249 |
-
*
|
250 |
-
* @since 1.7.0
|
251 |
-
*/
|
252 |
-
function options_page() { ?>
|
253 |
-
|
254 |
-
<div id="wpr_optionsframework-wrap" class="wrap">
|
255 |
-
|
256 |
-
<?php $menu = $this->menu_settings(); ?>
|
257 |
-
<h2><?php echo esc_html( $menu['page_title'] ); ?></h2>
|
258 |
-
|
259 |
-
<h2 class="nav-tab-wrapper">
|
260 |
-
<?php echo Wpr_Options_Framework_Interface::wpr_optionsframework_tabs(); ?>
|
261 |
-
</h2>
|
262 |
-
|
263 |
-
<?php settings_errors( 'options-framework' ); ?>
|
264 |
-
|
265 |
-
<div id="wpr_optionsframework-metabox" class="metabox-holder">
|
266 |
-
<div id="wpr_optionsframework" class="postbox">
|
267 |
-
<form action="options.php" method="post">
|
268 |
-
<?php settings_fields( 'wpr_optionsframework' ); ?>
|
269 |
-
<?php Wpr_Options_Framework_Interface::wpr_optionsframework_fields(); /* Settings */ ?>
|
270 |
-
<div id="wpr_optionsframework-submit">
|
271 |
-
<input type="submit" class="button-primary" name="update" value="<?php esc_attr_e( 'Save Options', 'textdomain' ); ?>" />
|
272 |
-
<input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e( 'Restore Defaults', 'textdomain' ); ?>" onclick="return confirm( '<?php print esc_js( __( 'Click OK to reset. Any theme settings will be lost!', 'textdomain' ) ); ?>' );" />
|
273 |
-
<div class="clear"></div>
|
274 |
-
</div>
|
275 |
-
</form>
|
276 |
-
</div> <!-- / #container -->
|
277 |
-
</div>
|
278 |
-
<?php do_action( 'wpr_optionsframework_after' ); ?>
|
279 |
-
</div> <!-- / .wrap -->
|
280 |
-
|
281 |
-
<?php
|
282 |
-
}
|
283 |
-
|
284 |
-
/**
|
285 |
-
* Validate Options.
|
286 |
-
*
|
287 |
-
* This runs after the submit/reset button has been clicked and
|
288 |
-
* validates the inputs.
|
289 |
-
*
|
290 |
-
* @uses $_POST['reset'] to restore default options
|
291 |
-
*/
|
292 |
-
function validate_options( $input ) {
|
293 |
-
|
294 |
-
/*
|
295 |
-
* Restore Defaults.
|
296 |
-
*
|
297 |
-
* In the event that the user clicked the "Restore Defaults"
|
298 |
-
* button, the options defined in the theme's options.php
|
299 |
-
* file will be added to the option for the active theme.
|
300 |
-
*/
|
301 |
-
|
302 |
-
if ( isset( $_POST['reset'] ) ) {
|
303 |
-
add_settings_error( 'options-framework', 'restore_defaults', __( 'Default options restored.', 'textdomain' ), 'updated fade' );
|
304 |
-
return $this->get_default_values();
|
305 |
-
}
|
306 |
-
|
307 |
-
/*
|
308 |
-
* Update Settings
|
309 |
-
*
|
310 |
-
* This used to check for $_POST['update'], but has been updated
|
311 |
-
* to be compatible with the theme customizer introduced in WordPress 3.4
|
312 |
-
*/
|
313 |
-
|
314 |
-
$clean = array();
|
315 |
-
$options = & Wpr_Options_Framework::_wpr_optionsframework_options();
|
316 |
-
foreach ( $options as $option ) {
|
317 |
-
|
318 |
-
if ( ! isset( $option['id'] ) ) {
|
319 |
-
continue;
|
320 |
-
}
|
321 |
-
|
322 |
-
if ( ! isset( $option['type'] ) ) {
|
323 |
-
continue;
|
324 |
-
}
|
325 |
-
|
326 |
-
$id = preg_replace( '/[^a-zA-Z0-9._\-]/', '', strtolower( $option['id'] ) );
|
327 |
-
|
328 |
-
// Set checkbox to false if it wasn't sent in the $_POST
|
329 |
-
if ( 'checkbox' == $option['type'] && ! isset( $input[$id] ) ) {
|
330 |
-
$input[$id] = false;
|
331 |
-
}
|
332 |
-
|
333 |
-
// Set each item in the multicheck to false if it wasn't sent in the $_POST
|
334 |
-
if ( 'multicheck' == $option['type'] && ! isset( $input[$id] ) ) {
|
335 |
-
foreach ( $option['options'] as $key => $value ) {
|
336 |
-
$input[$id][$key] = false;
|
337 |
-
}
|
338 |
-
}
|
339 |
-
|
340 |
-
// For a value to be submitted to database it must pass through a sanitization filter
|
341 |
-
if ( has_filter( 'wpr_of_sanitize_' . $option['type'] ) ) {
|
342 |
-
$clean[$id] = apply_filters( 'wpr_of_sanitize_' . $option['type'], $input[$id], $option );
|
343 |
-
}
|
344 |
-
}
|
345 |
-
|
346 |
-
// Hook to run after validation
|
347 |
-
do_action( 'wpr_optionsframework_after_validate', $clean );
|
348 |
-
|
349 |
-
if (isset($_COOKIE['wprmenu_live_preview']) && $_COOKIE['wprmenu_live_preview'] == 'yes' ) {
|
350 |
-
unset($_COOKIE['wprmenu_live_preview']);
|
351 |
-
setcookie('wprmenu_live_preview', null, -1, '/');
|
352 |
-
}
|
353 |
-
|
354 |
-
|
355 |
-
return $clean;
|
356 |
-
}
|
357 |
-
|
358 |
-
/**
|
359 |
-
* Display message when options have been saved
|
360 |
-
*/
|
361 |
-
|
362 |
-
function save_options_notice() {
|
363 |
-
add_settings_error( 'options-framework', 'save_options', __( 'WP Responsive Menu Options Saved.', 'textdomain' ), 'updated fade in' );
|
364 |
-
}
|
365 |
-
|
366 |
-
/**
|
367 |
-
* Get the default values for all the theme options
|
368 |
-
*
|
369 |
-
* Get an array of all default values as set in
|
370 |
-
* options.php. The 'id','std' and 'type' keys need
|
371 |
-
* to be defined in the configuration array. In the
|
372 |
-
* event that these keys are not present the option
|
373 |
-
* will not be included in this function's output.
|
374 |
-
*
|
375 |
-
* @return array Re-keyed options configuration array.
|
376 |
-
*
|
377 |
-
*/
|
378 |
-
|
379 |
-
function get_default_values() {
|
380 |
-
$output = array();
|
381 |
-
$config = & Wpr_Options_Framework::_wpr_optionsframework_options();
|
382 |
-
foreach ( (array) $config as $option ) {
|
383 |
-
if ( ! isset( $option['id'] ) ) {
|
384 |
-
continue;
|
385 |
-
}
|
386 |
-
if ( ! isset( $option['std'] ) ) {
|
387 |
-
continue;
|
388 |
-
}
|
389 |
-
if ( ! isset( $option['type'] ) ) {
|
390 |
-
continue;
|
391 |
-
}
|
392 |
-
if ( has_filter( 'wpr_of_sanitize_' . $option['type'] ) ) {
|
393 |
-
$output[$option['id']] = apply_filters( 'wpr_of_sanitize_' . $option['type'], $option['std'], $option );
|
394 |
-
}
|
395 |
-
}
|
396 |
-
return $output;
|
397 |
-
}
|
398 |
-
|
399 |
-
/**
|
400 |
-
* Add options menu item to admin bar
|
401 |
-
*/
|
402 |
-
|
403 |
-
function wpr_optionsframework_admin_bar() {
|
404 |
-
|
405 |
-
$menu = $this->menu_settings();
|
406 |
-
|
407 |
-
global $wp_admin_bar;
|
408 |
-
|
409 |
-
if ( 'menu' == $menu['mode'] ) {
|
410 |
-
$href = admin_url( 'admin.php?page=' . $menu['menu_slug'] );
|
411 |
-
} else {
|
412 |
-
$href = admin_url( 'themes.php?page=' . $menu['menu_slug'] );
|
413 |
-
}
|
414 |
-
|
415 |
-
$args = array(
|
416 |
-
'parent' => 'appearance',
|
417 |
-
'id' => 'wpr_of_theme_options',
|
418 |
-
'title' => $menu['menu_title'],
|
419 |
-
'href' => $href
|
420 |
-
);
|
421 |
-
|
422 |
-
$wp_admin_bar->add_menu( apply_filters( 'wpr_optionsframework_admin_bar', $args ) );
|
423 |
-
}
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inc/js/options-custom.js
CHANGED
@@ -197,6 +197,7 @@ jQuery( document ).ready( function( $ ) {
|
|
197 |
$.ajax({
|
198 |
type : 'POST',
|
199 |
url : wprOption.ajax_url,
|
|
|
200 |
data : 'settings_id='+ SettingsId + '&demo_id=' + DemoId + '&demo_type=' + DemoType + '&action=wprmenu_import_data',
|
201 |
success : function(response) {
|
202 |
response = $.parseJSON(response);
|
@@ -246,6 +247,7 @@ jQuery( document ).ready( function( $ ) {
|
|
246 |
$.ajax({
|
247 |
type : 'POST',
|
248 |
url : wprOption.ajax_url,
|
|
|
249 |
data : wpr_data + '&action=wpr_live_update',
|
250 |
success : function(response) {
|
251 |
|
@@ -376,6 +378,7 @@ jQuery( document ).ready( function( $ ) {
|
|
376 |
$.ajax({
|
377 |
type : 'POST',
|
378 |
url : wprOption.ajax_url,
|
|
|
379 |
data : 'action=wpr_get_transient_from_data',
|
380 |
success : function(response) {
|
381 |
response = $.parseJSON(response);
|
197 |
$.ajax({
|
198 |
type : 'POST',
|
199 |
url : wprOption.ajax_url,
|
200 |
+
nonce : wprOption.nonce,
|
201 |
data : 'settings_id='+ SettingsId + '&demo_id=' + DemoId + '&demo_type=' + DemoType + '&action=wprmenu_import_data',
|
202 |
success : function(response) {
|
203 |
response = $.parseJSON(response);
|
247 |
$.ajax({
|
248 |
type : 'POST',
|
249 |
url : wprOption.ajax_url,
|
250 |
+
nonce : wprOption.nonce,
|
251 |
data : wpr_data + '&action=wpr_live_update',
|
252 |
success : function(response) {
|
253 |
|
378 |
$.ajax({
|
379 |
type : 'POST',
|
380 |
url : wprOption.ajax_url,
|
381 |
+
nonce : wprOption.nonce,
|
382 |
data : 'action=wpr_get_transient_from_data',
|
383 |
success : function(response) {
|
384 |
response = $.parseJSON(response);
|
inc/templates/menu-elements.php
CHANGED
@@ -12,7 +12,7 @@ defined( 'ABSPATH' ) || exit;
|
|
12 |
if ( $this->option( 'content_before_menu_element' ) !== '' ) :
|
13 |
$content_before_menu_elements = preg_replace( '/\\\\/', '', $this->option( 'content_before_menu_element' ) );
|
14 |
?>
|
15 |
-
<li class="wprm_before_menu_content"><?php echo $
|
16 |
<?php endif; ?>
|
17 |
|
18 |
<?php
|
@@ -24,14 +24,14 @@ defined( 'ABSPATH' ) || exit;
|
|
24 |
if ( $menu_element == 'Menu' ) :
|
25 |
$menus = get_terms( 'nav_menu', array( 'hide_empty'=>false ) );
|
26 |
|
27 |
-
if ( $menus ) :
|
28 |
foreach( $menus as $m ) :
|
29 |
if ( $m->term_id == $this->option( 'menu' ) )
|
30 |
$menu = $m;
|
31 |
-
endforeach;
|
32 |
endif;
|
33 |
-
|
34 |
-
if ( is_object( $menu ) ) :
|
35 |
wp_nav_menu( array( 'menu' => $menu->name, 'container' => false, 'items_wrap' => '%3$s' ) );
|
36 |
endif;
|
37 |
|
@@ -56,6 +56,6 @@ defined( 'ABSPATH' ) || exit;
|
|
56 |
if ( $this->option( 'content_after_menu_element' ) !== '' ) :
|
57 |
$content_after_menu_element = preg_replace( '/\\\\/', '', $this->option( 'content_after_menu_element' ) );
|
58 |
?>
|
59 |
-
<li class="wprm_after_menu_content"><?php echo $content_after_menu_element; ?></li>
|
60 |
<?php endif; ?>
|
61 |
</ul>
|
12 |
if ( $this->option( 'content_before_menu_element' ) !== '' ) :
|
13 |
$content_before_menu_elements = preg_replace( '/\\\\/', '', $this->option( 'content_before_menu_element' ) );
|
14 |
?>
|
15 |
+
<li class="wprm_before_menu_content"><?php echo apply_filters( 'wpr_content_before_menu_element', $content_before_menu_element ); ?></li>
|
16 |
<?php endif; ?>
|
17 |
|
18 |
<?php
|
24 |
if ( $menu_element == 'Menu' ) :
|
25 |
$menus = get_terms( 'nav_menu', array( 'hide_empty'=>false ) );
|
26 |
|
27 |
+
if ( !empty( $menus ) ) :
|
28 |
foreach( $menus as $m ) :
|
29 |
if ( $m->term_id == $this->option( 'menu' ) )
|
30 |
$menu = $m;
|
31 |
+
endforeach;
|
32 |
endif;
|
33 |
+
//Display the selected menu
|
34 |
+
if ( !empty( $menu ) && is_object( $menu ) ) :
|
35 |
wp_nav_menu( array( 'menu' => $menu->name, 'container' => false, 'items_wrap' => '%3$s' ) );
|
36 |
endif;
|
37 |
|
56 |
if ( $this->option( 'content_after_menu_element' ) !== '' ) :
|
57 |
$content_after_menu_element = preg_replace( '/\\\\/', '', $this->option( 'content_after_menu_element' ) );
|
58 |
?>
|
59 |
+
<li class="wprm_after_menu_content"><?php echo apply_filters( 'wpr_content_after_menu_element', $content_after_menu_element ); ?></li>
|
60 |
<?php endif; ?>
|
61 |
</ul>
|
inc/wprmclass.php
CHANGED
@@ -4,9 +4,9 @@ class WP_Responsive_Menu {
|
|
4 |
protected $options = '';
|
5 |
|
6 |
public $translatables = array(
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
|
11 |
/**
|
12 |
* Bootstraps the class and hooks required actions & filters.
|
4 |
protected $options = '';
|
5 |
|
6 |
public $translatables = array(
|
7 |
+
'search_box_text',
|
8 |
+
'bar_title'
|
9 |
+
);
|
10 |
|
11 |
/**
|
12 |
* Bootstraps the class and hooks required actions & filters.
|
inc/wprmenu-loader.php
CHANGED
@@ -19,7 +19,7 @@ final class WPR_Menu_Loader {
|
|
19 |
*
|
20 |
* @var string
|
21 |
*/
|
22 |
-
public $version = '3.1.
|
23 |
|
24 |
|
25 |
/**
|
19 |
*
|
20 |
* @var string
|
21 |
*/
|
22 |
+
public $version = '3.1.7';
|
23 |
|
24 |
|
25 |
/**
|
inc/wprmenu-options.php
CHANGED
@@ -72,7 +72,7 @@ function wpr_menu_admin_notice__error() {
|
|
72 |
if( empty( $menus ) ) {
|
73 |
$class = 'notice notice-error';
|
74 |
$menu_link = admin_url( 'nav-menus.php?action=edit&menu=0');
|
75 |
-
$message = __( 'It
|
76 |
|
77 |
printf( '<div class="%1$s"><p>%2$s</p></div>', esc_attr( $class ), $message );
|
78 |
}
|
72 |
if( empty( $menus ) ) {
|
73 |
$class = 'notice notice-error';
|
74 |
$menu_link = admin_url( 'nav-menus.php?action=edit&menu=0');
|
75 |
+
$message = __( 'It looks like you haven\'t created any menu yet. Please create menu from <a href="'.$menu_link.'"> here </a> to use it as your responsive menu.', 'wprmenu' );
|
76 |
|
77 |
printf( '<div class="%1$s"><p>%2$s</p></div>', esc_attr( $class ), $message );
|
78 |
}
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: sagarseth9,magnigenie,kshirod-patel
|
|
3 |
Tags: WordPress Responsive Menu, Genesis responsive menu, Genesis Mobile Menu, Thesis Mobile Menu, Thesis Responsive Menu, Mobile Menu, Responsive Menu Plugin, WP Responsive Menu, WordPress mobile menu
|
4 |
Requires at least: 3.0
|
5 |
Requires PHP: 5.4
|
6 |
-
Tested up to: 5.
|
7 |
-
Stable tag: 3.1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -86,6 +86,12 @@ If you have any suggestions for a new plugin, feel free to email us at info@mag
|
|
86 |
|
87 |
== ChangeLog ==
|
88 |
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
= Version 3.1.6 =
|
90 |
|
91 |
* Removed unused files
|
@@ -224,6 +230,6 @@ If you have any suggestions for a new plugin, feel free to email us at info@mag
|
|
224 |
|
225 |
== Upgrade Notice ==
|
226 |
|
227 |
-
= Version 3.1.
|
228 |
|
229 |
* New update is available.
|
3 |
Tags: WordPress Responsive Menu, Genesis responsive menu, Genesis Mobile Menu, Thesis Mobile Menu, Thesis Responsive Menu, Mobile Menu, Responsive Menu Plugin, WP Responsive Menu, WordPress mobile menu
|
4 |
Requires at least: 3.0
|
5 |
Requires PHP: 5.4
|
6 |
+
Tested up to: 5.9
|
7 |
+
Stable tag: 3.1.7
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
86 |
|
87 |
== ChangeLog ==
|
88 |
|
89 |
+
= Version 3.1.7 =
|
90 |
+
|
91 |
+
* Fixed security issues.
|
92 |
+
* Tested with latest WordPress and fixed required things.
|
93 |
+
* Added filters for before and after menu content.
|
94 |
+
|
95 |
= Version 3.1.6 =
|
96 |
|
97 |
* Removed unused files
|
230 |
|
231 |
== Upgrade Notice ==
|
232 |
|
233 |
+
= Version 3.1.7 =
|
234 |
|
235 |
* New update is available.
|
wp-responsive-menu.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Description: WP Responsive Menu is mobile menu plugin that lets you add a highly customizable responsive menu to any WordPress site in no time.
|
5 |
* Plugin URI: http://magnigenie.com/wp-responsive-menu-mobile-menu-plugin-wordpress?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash
|
6 |
* Author: MagniGenie
|
7 |
-
* Version: 3.1.
|
8 |
* Author URI: http://magnigenie.com/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
|
9 |
* Text Domain: wprmenu
|
10 |
* Domain Path: /languages/
|
4 |
* Description: WP Responsive Menu is mobile menu plugin that lets you add a highly customizable responsive menu to any WordPress site in no time.
|
5 |
* Plugin URI: http://magnigenie.com/wp-responsive-menu-mobile-menu-plugin-wordpress?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash
|
6 |
* Author: MagniGenie
|
7 |
+
* Version: 3.1.7
|
8 |
* Author URI: http://magnigenie.com/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
|
9 |
* Text Domain: wprmenu
|
10 |
* Domain Path: /languages/
|