Instantly share code, notes, and snippets.
westonruter
/ nav-menu-item-custom-fields.php
Created
September 28, 2012 22:47
Proof of concept for how to add new fields to nav_menu_item posts in the WordPress menu editor.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Proof of concept for how to add new fields to nav_menu_item posts in the WordPress menu editor. | |
* @author Weston Ruter (@westonruter), X-Team | |
*/ | |
add_action( 'init', array( 'XTeam_Nav_Menu_Item_Custom_Fields', 'setup' ) ); | |
class XTeam_Nav_Menu_Item_Custom_Fields { | |
static $options = array( |
Anydog
/ nav-menu-item-custom-fields.php
Last active
December 25, 2015 02:09
— forked from westonruter/nav-menu-item-custom-fields.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Proof of concept for how to add new fields to nav_menu_item posts in the WordPress menu editor. | |
* @author Weston Ruter (@westonruter), X-Team | |
* | |
* forked: Anydog, Aligator Studio | |
*/ | |
add_action( 'init', array( 'XTeam_Nav_Menu_Item_Custom_Fields', 'setup' ) ); |