function ubermenu_get_settings_fields()
{
    $prefix = UBERMENU_PREFIX;
    $settings_fields = _UBERMENU()->get_settings_fields();
    if ($settings_fields) {
        return $settings_fields;
    }
    $main_assigned = '';
    if (!has_nav_menu('ubermenu')) {
        $main_assigned = 'No Menu Assigned';
    } else {
        $menus = get_nav_menu_locations();
        $menu_title = wp_get_nav_menu_object($menus['ubermenu'])->name;
        $main_assigned = $menu_title;
    }
    $main_assigned = '<span class="ubermenu-main-assigned">' . $main_assigned . '</span>  <p class="ubermenu-desc-understated">The menu assigned to the <strong>UberMenu [Main]</strong> theme location will be displayed.  <a href="' . admin_url('nav-menus.php?action=locations') . '">Assign a menu</a></p>';
    $config_id = 'main';
    $fields = array($prefix . $config_id => ubermenu_get_settings_fields_instance($config_id));
    $fields = apply_filters('ubermenu_settings_panel_fields', $fields);
    //Allow ordering
    foreach ($fields as $section_id => $section_fields) {
        ksort($fields[$section_id]);
        $fields[$section_id] = array_values($fields[$section_id]);
    }
    _UBERMENU()->set_settings_fields($fields);
    // up( $fields , 2 );
    //up( $fields );
    return $fields;
}
예제 #2
0
function ubermenu_settings_panel_fields_instances($fields = array())
{
    //Add options for each additional Instance
    $menus = ubermenu_get_menu_instances();
    foreach ($menus as $menu) {
        $fields[UBERMENU_PREFIX . $menu] = ubermenu_get_settings_fields_instance($menu);
    }
    return $fields;
}