PluginProbe ʕ •ᴥ•ʔ
Menu Icons by Themeisle – Add Icons to Navigation Menus / 0.13.24
Menu Icons by Themeisle – Add Icons to Navigation Menus v0.13.24
0.13.24 trunk 0.1.0 0.1.1 0.1.2 0.1.3 0.1.4 0.1.5 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.11.2 0.11.3 0.11.4 0.11.5 0.12.0 0.12.1 0.12.10 0.12.11 0.12.12 0.12.2 0.12.3 0.12.4 0.12.5 0.12.6 0.12.7 0.12.8 0.12.9 0.13.0 0.13.1 0.13.10 0.13.11 0.13.12 0.13.13 0.13.14 0.13.15 0.13.16 0.13.17 0.13.18 0.13.19 0.13.2 0.13.20 0.13.21 0.13.22 0.13.23 0.13.3 0.13.4 0.13.5 0.13.6 0.13.7 0.13.8 0.13.9 0.2.0 0.2.1 0.2.2 0.2.3 0.3.0 0.3.1 0.3.2 0.4.0 0.5.0 0.5.1 0.6.0 0.7.0 0.8.0 0.8.1 0.9.0 0.9.2
menu-icons / vendor / codeinwp / menu-item-custom-fields / menu-item-custom-fields.php
menu-icons / vendor / codeinwp / menu-item-custom-fields Last commit date
doc 7 years ago LICENSE 7 years ago menu-item-custom-fields.php 5 years ago readme.txt 7 years ago walker-nav-menu-edit.php 7 years ago
menu-item-custom-fields.php
62 lines
1 <?php
2
3 /**
4 * Menu Item Custom Fields
5 *
6 * @package Menu_Item_Custom_Fields
7 * @version 1.0.0
8 * @author Dzikri Aziz <kvcrvt@gmail.com>
9 *
10 * Plugin name: Menu Item Custom Fields
11 * Plugin URI: https://github.com/kucrut/wp-menu-item-custom-fields
12 * Description: Easily add custom fields to nav menu items.
13 * Version: 1.0.0
14 * Author: Dzikri Aziz
15 * Author URI: https://kucrut.org/
16 * License: GPLv2
17 * Text Domain: menu-item-custom-fields
18 */
19
20 if ( ! class_exists( 'Menu_Item_Custom_Fields' ) && ( function_exists('get_bloginfo') && ! version_compare( get_bloginfo( 'version' ), '5.4', '>=' ) ) ) :
21 /**
22 * Menu Item Custom Fields Loader
23 */
24 class Menu_Item_Custom_Fields {
25
26 /**
27 * Add filter
28 *
29 * @wp_hook action wp_loaded
30 */
31 public static function load() {
32 add_filter( 'wp_edit_nav_menu_walker', array( __CLASS__, '_filter_walker' ), 99 );
33 }
34
35
36 /**
37 * Replace default menu editor walker with ours
38 *
39 * We don't actually replace the default walker. We're still using it and
40 * only injecting some HTMLs.
41 *
42 * @since 0.1.0
43 * @access private
44 * @wp_hook filter wp_edit_nav_menu_walker
45 * @param string $walker Walker class name
46 * @return string Walker class name
47 */
48 public static function _filter_walker( $walker ) {
49 $walker = 'Menu_Item_Custom_Fields_Walker';
50 if ( ! class_exists( $walker ) ) {
51 require_once dirname( __FILE__ ) . '/walker-nav-menu-edit.php';
52 }
53
54 return $walker;
55 }
56 }
57 add_action( 'wp_loaded', array( 'Menu_Item_Custom_Fields', 'load' ), 9 );
58 endif; // class_exists( 'Menu_Item_Custom_Fields' )
59
60 // Uncomment the following line to test this plugin
61 #require_once dirname( __FILE__ ) . '/doc/menu-item-custom-fields-example.php';
62