• Resolved JeanPaul1

    (@jeanpaul1)


    Image Appearance Menu Screen

    On the Appearance Menu Screen there is a left column, Add menu items.
    I have been searching for a code example or explanation on how to add your custom menu item in this location. Any idea where I can find reference on how to do this?
    Thanks for the help.
    Link is to an image of the

Viewing 4 replies - 1 through 4 (of 4 total)
  • This adds a custom meta box:

    if ( !class_exists('DM_Custom_MetaBox')) {
        class DM_Custom_MetaBox {
            public function add_nav_menu_meta_boxes() {
            	add_meta_box(
            		'custom-meta-box',
            		'Custom Meta Box',
            		array( $this, 'nav_menu_link'),
            		'nav-menus',
            		'side',
            		'low'
            	);
            }
            
            public function nav_menu_link() {
            	echo 'Custom Meta Box';
            }
        }
    }
    
    $custom_meta_box = new DM_Custom_MetaBox;
    
    add_action('admin_init', array($custom_meta_box, 'add_nav_menu_meta_boxes'));
    
    Thread Starter JeanPaul1

    (@jeanpaul1)

    Thank you for your code example. Did not get it to work, but it helped. I did not realize that it was just another meta_box. I saw that you use ‘nav-menus’ so I was able to get a working start.
    Thanks

    Did you add it to your functions.php file? It should have created a new meta box with “Custom Meta Box” as text inside of it.

    Thread Starter JeanPaul1

    (@jeanpaul1)

    Thanks Deviant, I use Snippets to insert the code. Got it to work. I used a new snippet and now it shows up. Great, thanks again. Works perfect now.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘add new menu item to appearance Menus page’ is closed to new replies.