neilgee
6/29/2015 - 12:44 AM

Menu Call Back

Menu Call Back

<tr>                            
<td><label for="my_menu"><?php esc_attr_e( 'My Menu Plugin', 'plugin_slug' ); ?></label></td>
<td>
    <select name="my_menu" id="my_menu">

        <option value="<?php echo ( ($options['my_menu'] ); ?>"><?php echo ( ($options['my_menu'] ); ?></option>

        <?php
        // Menu array
        $menus = get_terms( 'nav_menu', array( 'hide_empty' => false ) );

        // Iterating through the menu array
        foreach($menus as $menu){
        ?>
        <option value="#menu-<?php echo ($menu->slug); ?>"><?php echo $menu->name; ?></option>

        <?php
        }

        ?>
    </select>
</td>