Get Adobe Flash player

Wordpress - Metabox in der Menü Admin Oberfläche

Um Eine eigene Metabox in der Menuadmin Oberfläche zu bekommen sollte folgender Code, nach dem Ihr ihn für eure bedürfnisse angepasst hab, reichen:

 

 

/**
     * Metabox in der Menüadmin oberfläche hinzufügen
     */
    if ( !class_exists('Custom_Nav')) {            
        class Custom_Nav {
            public function add_nav_menu_meta_boxes() {
                add_meta_box(
                'wl_login_nav_link',
                __('Meine eigene Box'),
                array( $this, 'nav_menu_link'),
                'nav-menus',
                'side',
                'low'
                        );
            }
    
    
            public function nav_menu_link() {
                ?>
        <div id="my-box" class="posttypediv">
            <div id="tabs-panel-wishlist-login" class="tabs-panel tabs-panel-active" style="max-height: 400px;">
                <ul id ="wishlist-login-checklist" class="categorychecklist form-no-clear">
                    
                    
                    <li>
                        <label class="menu-item-title">
                        <input type="checkbox" class="menu-item-checkbox" name="menu-item[-1][menu-item-object-id]" value="-1">Mein-Checkbox-Menu
                        </label>
                        <input type="hidden" class="menu-item-type" name="menu-item[-1][menu-item-type]" value="custom">
                        <input type="hidden" class="menu-item-title" name="menu-item[-1][menu-item-title]" value="Mein-Checkbox-Menu">
                        <input type="hidden" class="menu-item-url" name="menu-item[-1][menu-item-url]" value="<?php print home_url(); ?>">
                        <input type="hidden" class="menu-item-classes" name="menu-item[-1][menu-item-classes]" value="my-box-pop">
                    </li>
                </ul>
            </div>
            <p class="button-controls">
                <span class="list-controls">
                    <a href="<?php print home_url(); ?>/wp-admin/nav-menus.php?page-tab=all&amp;selectall=1#posttype-page" class="select-all">Alle auswählen</a>
                </span>
                <span class="add-to-menu">
                    <input type="submit" class="button-secondary submit-add-to-menu right" value="Zum Menü hinzufügen" name="add-post-type-menu-item" id="submit-my-box">
                    <span class="spinner"></span>
                </span>
            </p>
        </div>
        <?php }
    }
}
     
$custom_nav = new Custom_Nav;
     
add_action('admin_init', array($custom_nav, 'add_nav_menu_meta_boxes'));