Menu Image - Version 3.0.7

Version Description

Download this release

Release Info

Developer takanakui
Plugin Icon 128x128 Menu Image
Version 3.0.7
Comparing to
See all releases

Code changes from version 3.0.6 to 3.0.7

Files changed (3) hide show
  1. includes/js/menu-image-admin.js +1 -0
  2. menu-image.php +30 -18
  3. readme.txt +4 -1
includes/js/menu-image-admin.js CHANGED
@@ -230,6 +230,7 @@
230
  menu_item_image_title_position: title_position,
231
  menu_item_image_type: item_image_type,
232
  menu_item_image_size: item_image_size,
 
233
  }
234
 
235
  if ( $( '.menu-item-icon-selected' ).length > 0 ) {
230
  menu_item_image_title_position: title_position,
231
  menu_item_image_type: item_image_type,
232
  menu_item_image_size: item_image_size,
233
+ menu_item_nonce: menuImage.settings.nonce,
234
  }
235
 
236
  if ( $( '.menu-item-icon-selected' ).length > 0 ) {
menu-image.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Plugin Name: Menu Image
5
  * Description: Improve your navigation menu items with images, logos, icons, buttons.
6
- * Version: 3.0.6
7
  * Plugin URI: https://www.freshlightlab.com/menu-image-wordpress-plugin/?utm_source=wprepo-menu-image&utm_medium=wprepo_readme&utm_campaign=Plugin+URI
8
  * Author: Freshlight Lab
9
  * Author URI: https://www.freshlightlab.com/?utm_source=wprepo-menu-image&utm_medium=wprepo_readme&utm_campaign=Author+URI
@@ -15,7 +15,7 @@
15
  if ( !defined( 'ABSPATH' ) ) {
16
  die;
17
  }
18
- define( 'MENU_IMAGE_VERSION', '3.0.6' );
19
  define( 'MENU_IMAGE_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
20
  define( 'MENU_IMAGE_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
21
  /**
@@ -634,26 +634,38 @@ class WP_Menu_Image
634
  */
635
  public function menu_image_save_post_action( $post_id )
636
  {
637
- $menu_image_settings = array(
638
- 'menu_item_image_title_position',
639
- 'menu_item_image_size',
640
- 'menu_item_image_button',
641
- 'menu_image_icon',
642
- 'menu_item_image_type',
643
- 'menu_item_image_notification'
644
- );
645
 
646
- if ( isset( $_POST['menu_item_id'] ) ) {
647
- $post_id = $_POST['menu_item_id'];
 
 
 
 
 
 
648
  } else {
649
- return '';
650
- }
651
-
652
- foreach ( $menu_image_settings as $setting_name ) {
653
- if ( isset( $_POST[$setting_name] ) ) {
654
- update_post_meta( $post_id, "_{$setting_name}", esc_sql( $_POST[$setting_name] ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
655
  }
656
  }
 
657
  }
658
 
659
  /**
3
  /**
4
  * Plugin Name: Menu Image
5
  * Description: Improve your navigation menu items with images, logos, icons, buttons.
6
+ * Version: 3.0.7
7
  * Plugin URI: https://www.freshlightlab.com/menu-image-wordpress-plugin/?utm_source=wprepo-menu-image&utm_medium=wprepo_readme&utm_campaign=Plugin+URI
8
  * Author: Freshlight Lab
9
  * Author URI: https://www.freshlightlab.com/?utm_source=wprepo-menu-image&utm_medium=wprepo_readme&utm_campaign=Author+URI
15
  if ( !defined( 'ABSPATH' ) ) {
16
  die;
17
  }
18
+ define( 'MENU_IMAGE_VERSION', '3.0.7' );
19
  define( 'MENU_IMAGE_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
20
  define( 'MENU_IMAGE_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
21
  /**
634
  */
635
  public function menu_image_save_post_action( $post_id )
636
  {
 
 
 
 
 
 
 
 
637
 
638
+ if ( !isset( $_POST['menu_item_nonce'] ) || !wp_verify_nonce( $_POST['menu_item_nonce'], 'update-menu-item' ) ) {
639
+ ?>
640
+ <div class="error">
641
+ <p><?php
642
+ _e( 'Sorry, your nonce was not correct. Please try again.', 'menu-image' );
643
+ ?></p>
644
+ </div>
645
+ <?php
646
  } else {
647
+ $menu_image_settings = array(
648
+ 'menu_item_image_title_position',
649
+ 'menu_item_image_size',
650
+ 'menu_item_image_button',
651
+ 'menu_image_icon',
652
+ 'menu_item_image_type',
653
+ 'menu_item_image_notification'
654
+ );
655
+
656
+ if ( isset( $_POST['menu_item_id'] ) ) {
657
+ $post_id = $_POST['menu_item_id'];
658
+ } else {
659
+ return '';
660
+ }
661
+
662
+ foreach ( $menu_image_settings as $setting_name ) {
663
+ if ( isset( $_POST[$setting_name] ) ) {
664
+ update_post_meta( $post_id, "_{$setting_name}", esc_sql( $_POST[$setting_name] ) );
665
+ }
666
  }
667
  }
668
+
669
  }
670
 
671
  /**
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: menu, navigation, image, icons, nav menu
4
  Donate link: https://www.freshlightlab.com/?utm_source=wprepo-menu-image&utm_medium=wprepo_readme&utm_campaign=Donate+Link
5
  Requires at least: 4.4.0
6
  Tested up to: 5.9
7
- Stable tag: 3.0.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -117,6 +117,9 @@ Check this article in the following [link](https://www.freshlightlab.com/documen
117
 
118
 
119
 
 
 
 
120
  ### 3.0.6 ###
121
  * Fix - Security Fix
122
 
4
  Donate link: https://www.freshlightlab.com/?utm_source=wprepo-menu-image&utm_medium=wprepo_readme&utm_campaign=Donate+Link
5
  Requires at least: 4.4.0
6
  Tested up to: 5.9
7
+ Stable tag: 3.0.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
117
 
118
 
119
 
120
+ ### 3.0.7 ###
121
+ * Fix - Security Fix
122
+
123
  ### 3.0.6 ###
124
  * Fix - Security Fix
125