Instantly share code, notes, and snippets.
Web developer, mostly WordPress, JavaScript/Typescript, Svelte, React. Available for hire.
- Lombok, Indonesia
- https://dz.aziz.im
- https://profiles.wordpress.org/kucrut/
- in/dzikri-aziz
kucrut
/ Menu Item Custom Field Image
Created
September 9, 2014 13:36
This file contains 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 | |
/** | |
* Menu item custom fields example | |
* | |
* Copy this file into your wp-content/mu-plugins directory. | |
* | |
* @package Menu_Item_Custom_Fields | |
* @version 0.1.0 | |
* @author Dzikri Aziz <kvcrvt@gmail.com> | |
* |
kucrut
/ nav-menu-item-custom-fields.php
Created
September 29, 2012 15:39
— forked from westonruter/nav-menu-item-custom-fields.php
Proof of concept for how to add new fields to nav_menu_item posts in the WordPress menu editor.
This file contains 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( |
kucrut
/ bridge-walker-nav-menu.php
Last active
September 19, 2022 15:38
WordPress Nav Menu walker that returns menu items as multidimensional array (items will children)
This file contains 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 | |
/** | |
* Nav menu walker | |
*/ | |
class Bridge_Walker_Nav_Menu extends Walker_Nav_Menu { | |
/** | |
* Prepare item | |
* |
OlderNewer