Menu Icons by ThemeIsle - Version 0.1.4

Version Description

  • Fix menu saving
Download this release

Release Info

Developer kucrut
Plugin Icon 128x128 Menu Icons by ThemeIsle
Version 0.1.4
Comparing to
See all releases

Code changes from version 0.1.3 to 0.1.4

Files changed (3) hide show
  1. includes/admin.php +17 -2
  2. menu-icons.php +9 -4
  3. readme.txt +6 -5
includes/admin.php CHANGED
@@ -2,7 +2,7 @@
2
/**
3
* Menu editor handler
4
* @package Menu_Icons
5
- * @version 0.1.1
6
* @author Dzikri Aziz <kvcrvt@gmail.com>
7
*/
8
@@ -10,18 +10,33 @@
10
/**
11
* Menu item metadata
12
*
13
- * @since 0.1.0
14
*/
15
class Menu_Icons_Admin_Nav_Menus {
16
17
/**
18
* Initialize class
19
*/
20
public static function init() {
21
add_action( 'admin_enqueue_scripts', array( __CLASS__, '_scripts_styles' ) );
22
add_action( 'menu_item_custom_fields', array( __CLASS__, '_fields' ), 10, 3 );
23
add_filter( 'manage_nav-menus_columns', array( __CLASS__, '_columns' ), 99 );
24
add_action( 'wp_update_nav_menu_item', array( __CLASS__, '_save' ), 10, 3 );
25
}
26
27
2
/**
3
* Menu editor handler
4
* @package Menu_Icons
5
+ * @version 0.1.2
6
* @author Dzikri Aziz <kvcrvt@gmail.com>
7
*/
8
10
/**
11
* Menu item metadata
12
*
13
+ * @version 0.1.1
14
*/
15
class Menu_Icons_Admin_Nav_Menus {
16
17
+ /**
18
+ * Holds status
19
+ *
20
+ * @since 0.1.1
21
+ * @var bool
22
+ */
23
+ private static $loaded = false;
24
+
25
+
26
/**
27
* Initialize class
28
*/
29
public static function init() {
30
+ if ( true === self::$loaded ) {
31
+ return;
32
+ }
33
+
34
add_action( 'admin_enqueue_scripts', array( __CLASS__, '_scripts_styles' ) );
35
add_action( 'menu_item_custom_fields', array( __CLASS__, '_fields' ), 10, 3 );
36
add_filter( 'manage_nav-menus_columns', array( __CLASS__, '_columns' ), 99 );
37
add_action( 'wp_update_nav_menu_item', array( __CLASS__, '_save' ), 10, 3 );
38
+
39
+ self:$loaded = true;
40
}
41
42
menu-icons.php CHANGED
@@ -4,14 +4,14 @@
4
* Menu Icons
5
*
6
* @package Menu_Icons
7
- * @version 0.1.3
8
* @author Dzikri Aziz <kvcrvt@gmail.com>
9
*
10
*
11
* Plugin name: Menu Icons
12
* Plugin URI: http://kucrut.org/
13
* Description: Easily add icons to your navigation menu items
14
- * Version: 0.1.3
15
* Author: Dzikri Aziz
16
* Author URI: http://kucrut.org/
17
* License: GPLv2
@@ -22,11 +22,11 @@
22
/**
23
* Main plugin class
24
*
25
- * @version 0.1.3
26
*/
27
final class Menu_Icons {
28
29
- const VERSION = '0.1.3';
30
31
/**
32
* Holds plugin data
@@ -80,6 +80,7 @@ final class Menu_Icons {
80
);
81
82
add_action( 'wp_loaded', array( __CLASS__, 'init' ), 9 );
83
add_filter( 'wp_edit_nav_menu_walker', array( __CLASS__, '_load_nav_menus' ), 1 );
84
}
85
@@ -159,9 +160,13 @@ final class Menu_Icons {
159
* It's because we want our walker to always be used whether it's editing the current
160
* menu items, or adding new ones (via ajax).
161
*
162
* @since 0.1.3
163
* @access protected
164
* @wp_hook filter wp_edit_nav_menu_walker/10/1
165
*/
166
public static function _load_nav_menus( $walker ) {
167
// Load menu item custom fields plugin
4
* Menu Icons
5
*
6
* @package Menu_Icons
7
+ * @version 0.1.4
8
* @author Dzikri Aziz <kvcrvt@gmail.com>
9
*
10
*
11
* Plugin name: Menu Icons
12
* Plugin URI: http://kucrut.org/
13
* Description: Easily add icons to your navigation menu items
14
+ * Version: 0.1.4
15
* Author: Dzikri Aziz
16
* Author URI: http://kucrut.org/
17
* License: GPLv2
22
/**
23
* Main plugin class
24
*
25
+ * @version 0.1.4
26
*/
27
final class Menu_Icons {
28
29
+ const VERSION = '0.1.4';
30
31
/**
32
* Holds plugin data
80
);
81
82
add_action( 'wp_loaded', array( __CLASS__, 'init' ), 9 );
83
+ add_filter( 'load-nav-menus.php', array( __CLASS__, '_load_nav_menus' ) );
84
add_filter( 'wp_edit_nav_menu_walker', array( __CLASS__, '_load_nav_menus' ), 1 );
85
}
86
160
* It's because we want our walker to always be used whether it's editing the current
161
* menu items, or adding new ones (via ajax).
162
*
163
+ * This method is also hooked into 'load-nav-menus.php'.
164
+ *
165
* @since 0.1.3
166
* @access protected
167
+ * @wp_hook action load-nav-menus.php/10/1
168
* @wp_hook filter wp_edit_nav_menu_walker/10/1
169
+ * @link http://codex.wordpress.org/Plugin_API/Action_Reference/load-%28page%29
170
*/
171
public static function _load_nav_menus( $walker ) {
172
// Load menu item custom fields plugin
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate Link: http://kucrut.org/#coffee
4
Tags: menu, nav-menu, icons, navigation
5
Requires at least: 3.8
6
Tested up to: 3.8.1
7
- Stable tag: 0.1.3
8
License: GPLv2
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
@@ -59,9 +59,7 @@ If you're comfortable with editing your theme stylesheet, then you can override
59
Otherwise, I recommend you to use the [Simple Custom CSS plugin](http://wordpress.org/plugins/simple-custom-css/)
60
61
= Is this plugin extendable? =
62
- **Certainly!**
63
-
64
- Here's how you can remove an icon type from your plugin/theme:
65
`
66
function myplugin_remove_menu_icons_type( $types ) {
67
unset( $types['genericon'] );
@@ -76,13 +74,16 @@ To add a new icon type, take a look at the `type-*.php` files inside the `includ
76
Let me know via [GitHub issues](https://github.com/kucrut/wp-menu-icons/issues) and I'll see what I can do.
77
78
= Can I disable the extra stylesheet loaded by this plugin? =
79
- YES! Simply add the following to your plugin/theme:
80
`
81
add_filter( 'menu_icons_load_extra_style', '__return_false' );
82
`
83
84
85
== Changelog ==
86
= 0.1.3 =
87
* Provide icon selection fields on newly added menu items
88
4
Tags: menu, nav-menu, icons, navigation
5
Requires at least: 3.8
6
Tested up to: 3.8.1
7
+ Stable tag: 0.1.4
8
License: GPLv2
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
59
Otherwise, I recommend you to use the [Simple Custom CSS plugin](http://wordpress.org/plugins/simple-custom-css/)
60
61
= Is this plugin extendable? =
62
+ **Certainly!** Here's how you can remove an icon type from your plugin/theme:
63
`
64
function myplugin_remove_menu_icons_type( $types ) {
65
unset( $types['genericon'] );
74
Let me know via [GitHub issues](https://github.com/kucrut/wp-menu-icons/issues) and I'll see what I can do.
75
76
= Can I disable the extra stylesheet loaded by this plugin? =
77
+ **YES!** Simply add the following to your plugin/theme:
78
`
79
add_filter( 'menu_icons_load_extra_style', '__return_false' );
80
`
81
82
83
== Changelog ==
84
+ = 0.1.4 =
85
+ * Fix menu saving
86
+
87
= 0.1.3 =
88
* Provide icon selection fields on newly added menu items
89