/**
  * When publishing a new child page, add it to the appropriate custom menu.
  * @param string $post_id current edit post id
  * @author Romain DORR
  */
 public static function automatic_add_sub_pages($post_id)
 {
     // Theme supports custom menus?
     if (!current_theme_supports('menus')) {
         return false;
     }
     // Published page has parent?
     $post = get_post($post_id);
     if (!$post->post_parent) {
         return;
     }
     // Get all menus for this theme
     $menus = get_registered_nav_menus();
     // Get all locations
     $locations = get_nav_menu_locations();
     // Get Plugin option
     $auto_add_option = get_option('menu_aasp_options');
     // if no menus are configured
     if (empty($auto_add_option)) {
         return false;
     }
     // Loop through the menus to find page parent
     foreach ($menus as $menu_name => $menu) {
         if (!isset($locations[$menu_name])) {
             continue;
         }
         $menu = wp_get_nav_menu_object($locations[$menu_name]);
         // Test if menu is configure for auto add submenus
         if (empty($auto_add_option[$menu->term_id])) {
             continue;
         }
         $menu_parent = null;
         $menu_items = wp_get_nav_menu_items($menu->term_id, array('post_status' => 'publish,draft'));
         if (!is_array($menu_items)) {
             continue;
         }
         foreach ($menu_items as $menu_item) {
             // Item already in menu?
             if ($menu_item->object_id == $post->ID) {
                 continue 2;
             }
             if ($menu_item->object_id == $post->post_parent) {
                 $menu_parent = $menu_item;
             }
         }
         // Add new item
         if ($menu_parent) {
             wp_update_nav_menu_item($menu->term_id, 0, array('menu-item-object-id' => $post->ID, 'menu-item-object' => $post->post_type, 'menu-item-parent-id' => $menu_parent->ID, 'menu-item-type' => 'post_type', 'menu-item-status' => 'publish'));
         }
     }
 }
 function findMenu($id = null)
 {
     $locations = get_registered_nav_menus();
     $menus = wp_get_nav_menus();
     if ($id) {
         foreach ($menus as $menu) {
             if ($id == $menu->term_id) {
                 return $menu;
             }
         }
         return null;
     }
     $menu_locations = get_nav_menu_locations();
     $return = null;
     // find current menu
     foreach ($locations as $location => $description) {
         foreach ($menus as $menu) {
             if (isset($menu_locations[$location]) && $menu_locations[$location] == $menu->term_id) {
                 $return = $menu;
                 break;
             }
         }
     }
     return $return;
 }
Example #3
0
function ubermenu_integration_code_ui($config_id)
{
    $integration_code = '<div class="ubermenu-integration-code-wrap">' . ubermenu_menu_integration_code(array(), $config_id);
    $menu_select = '<h4>Integrate Specific Menu</h4>';
    $loc_select = '<h4>Integrate Specific Theme Location</h4>';
    $menus = wp_get_nav_menus(array('orderby' => 'name'));
    if (is_array($menus)) {
        foreach ($menus as $menu) {
            $integration_code .= ubermenu_menu_integration_code(array('menu' => $menu->term_id), $config_id);
        }
        $menu_select .= '<select class="ubermenu-manual-code-menu-selection">';
        $menu_select .= '<option value="_default">Default</option>';
        foreach ($menus as $menu) {
            $menu_select .= '<option value="' . $menu->term_id . '">' . $menu->name . '</option>';
        }
        $menu_select .= '</select>';
        $menu_select .= '<p class="ubermenu-sub-desc ubermenu-desc-understated">To display a specific menu, select the menu above to generate that code</p>';
    }
    $locs = get_registered_nav_menus();
    if (is_array($locs)) {
        foreach ($locs as $loc_id => $loc_name) {
            $integration_code .= ubermenu_menu_integration_code(array('theme_location' => $loc_id), $config_id);
        }
        $loc_select .= '<select class="ubermenu-manual-code-menu-selection">';
        $loc_select .= '<option value="_default">None</option>';
        foreach ($locs as $loc_id => $loc_name) {
            $loc_select .= '<option value="' . $loc_id . '">' . $loc_name . '</option>';
        }
        $loc_select .= '</select>';
        $loc_select .= '<p class="ubermenu-sub-desc ubermenu-desc-understated">To display a specific theme locaton, select the theme location above to generate that code</p>';
    }
    $integration_code .= $menu_select . $loc_select;
    $integration_code .= '</div>';
    return $integration_code;
}
 public function form($instance)
 {
     $defaults = array('title' => 'Links list', 'description' => 'Website powered by WinterJuice theme');
     $instance = wp_parse_args((array) $instance, $defaults);
     // field: Widget title
     echo '<p>';
     echo '<label for="' . $this->get_field_id('title') . '">Widget Title:</label>';
     echo '<input class="widefat" id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $instance['title'] . '" />';
     echo '</p>';
     // textarea: Description field
     echo '<p>';
     echo '<label for="' . $this->get_field_id('title') . '">Custom Text:</label>';
     echo '<input class="widefat" id="' . $this->get_field_id('description') . '" name="' . $this->get_field_name('description') . '" value="' . $instance['description'] . '" />';
     echo '</p>';
     // prepare: menu
     $menu = get_registered_nav_menus();
     if (!isset($instance['menu'])) {
         $instance['menu'] = 0;
     }
     echo '<h3>Available Menu:</h3>';
     echo '<div class="custom-socials">';
     // select: Custom menu
     echo '<p>';
     echo '<label for="' . $this->get_field_id('menu') . '">Menu:</label>';
     echo '<select class="widefat" id="' . $this->get_field_id('menu') . '" name="' . $this->get_field_name('menu') . '">';
     echo '</p>';
     foreach ($menu as $id => $name) {
         echo '<option value="' . $id . '" ' . selected($id, $instance['menu']) . '>' . $name . '</option>';
     }
     echo '</select>';
     echo '</div>';
     // render
     //echo $html;
 }
Example #5
0
 function metaboxRaw()
 {
     /* This is just in case JS is not working.  It'll only save the last checked box */
     if (isset($_POST['megaMenu-locations']) && $_POST['megaMenu-locations'] == 'Save') {
         $data = $_POST['wp-mega-menu-nav-loc'];
         $data = explode(',', $data);
         update_option(MISS_MEGAMENU_STORE, $data);
         echo 'Saved Changes';
     }
     $active = get_option(MISS_MEGAMENU_STORE, array());
     echo '<div class="megaMenu-metaBox">';
     echo '<p class="howto">' . __('Select the Menu Locations for Mega Menu. Menu must be activated for any Mega Menu Options to affect that Menu Location.', MISS_ADMIN_TEXTDOMAIN) . '</p>';
     echo '<form>';
     $locs = get_registered_nav_menus();
     foreach ($locs as $slug => $desc) {
         echo '<div>' . '<input class="menu-item-checkbox" type="checkbox" value="' . $slug . '" id="megaMenuThemeLoc-' . $slug . '" name="wp-mega-menu-nav-loc" ' . checked(in_array($slug, $active), true, false) . '/>' . '<label class="menu-item-title" for="megaMenuThemeLoc-' . $slug . '">' . $desc . '</label>' . '</div>';
     }
     echo '<p class="button-controls">' . '<img class="waiting" src="' . esc_url(admin_url('images/wpspin_light.gif')) . '" alt="" style="display:none;"/>' . '<input id="wp-mega-menu-navlocs-submit" type="submit" class="button-primary" name="megaMenu-locations" value="Save" />' . '</p>';
     echo '</form>';
     /*
     if( !$this->settings->op( 'wpmega-strict' ) ){
     	echo '<p class="howto">If more than 1 menu is being megafied in your theme, turn on Strict Mode in Appearance > IrishMiss > '.
     			'Theme Integration.</p>';
     }
     */
     echo '<p>' . __('Note you can ONLY have 1 IrishMiss menu per page.', MISS_ADMIN_TEXTDOMAIN) . '</p>';
     echo '</div>';
 }
Example #6
0
 public function __construct()
 {
     $this->cssclass = 'row-options';
     $this->description = __('Set row options and styling here.', 'spyropress');
     $this->id_base = 'spyropress_row_options';
     $this->name = __('Row Options', 'spyropress');
     $this->show_custom_css = true;
     $locations = get_registered_nav_menus();
     $menus = wp_get_nav_menus();
     $menu_options = array();
     if (isset($locations) && count($locations) > 0 && isset($menus) && count($menus) > 0) {
         foreach ($menus as $menu) {
             $menu_options[$menu->term_id] = $menu->name;
         }
     }
     // Fields
     $this->fields = array(array('id' => 'show', 'type' => 'checkbox', 'options' => array('1' => '<strong>' . __('Disable this row temporarily', 'spyropress') . '</strong>')), array('id' => 'container_skin', 'type' => 'select', 'class' => 'enable_changer section-full', 'label' => __('Style/Skin', 'spyropress'), 'options' => array('home-intro' => __('Call of Action', 'spyropress'), 'featured_section call-to-action footer' => __('Call-to-Action (Featured)', 'spyropress'), 'home-intro light' => __('Call of Action (Light)', 'spyropress'), 'home-concept' => __('Home Concept', 'spyropress'), 'featured_section' => __('Featured Section', 'spyropress'), 'highlight_section' => __('Hightlight', 'spyropress'), 'highlight_section top' => __('Hightlight (no top-margin)', 'spyropress'), 'featured_section highlight_section footer' => __('Featured Hightlight Section', 'spyropress'), 'push-top' => __('Push Top', 'spyropress'), 'parallax' => __('Parallax', 'spyropress'), 'video_section' => __('Video', 'spyropress'))), array('label' => __('Parallax Background', 'spyropress'), 'id' => 'parallax_bg', 'class' => 'parallax container_skin section-full', 'type' => 'upload'), array('label' => __('Video Poster', 'spyropress'), 'id' => 'video_poster', 'class' => 'video_section container_skin section-full', 'type' => 'upload'), array('label' => __('Video MP4', 'spyropress'), 'id' => 'video_mp4', 'class' => 'video_section container_skin section-full', 'type' => 'upload'), array('label' => __('Video OGG', 'spyropress'), 'id' => 'video_ogg', 'class' => 'video_section container_skin section-full', 'type' => 'upload'));
     if (!empty($menu_options)) {
         $this->fields[] = array('label' => __('OnePage Menu Builder', 'spyropress'), 'type' => 'sub_heading');
         $this->fields[] = array('label' => __('Select Menu', 'spyropress'), 'id' => 'menu_id', 'type' => 'select', 'options' => $menu_options);
         $this->fields[] = array('label' => __('Menu Label', 'spyropress'), 'id' => 'menu_label', 'type' => 'text');
     }
     $this->create_widget();
     add_filter('builder_save_row_css', array($this, 'compile_css'), 10, 3);
 }
function has_menu($location)
{
    $menus = get_registered_nav_menus();
    if (isset($menus[$location])) {
        return true;
    }
}
 function mega_main_menu__array_theme_options($constants)
 {
     foreach (get_registered_nav_menus() as $key => $value) {
         $key = str_replace(' ', '-', $key);
         $theme_menu_locations[$key] = $key;
     }
     foreach (get_nav_menu_locations() as $key => $value) {
         $key = str_replace(' ', '-', $key);
         $theme_menu_locations[$key] = $key;
     }
     $locations_options = array(array('name' => __('Below are all the locations, which are supported this theme. Toggle for change their settings.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'primary_settings', 'type' => 'caption'));
     if (isset($theme_menu_locations) && is_array($theme_menu_locations)) {
         $locations_options[] = array('name' => __('Activate Mega Main Menu in such locations:', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('Mega Main Menu and its settings will be displayed in selected locations only after the activation of this location.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'mega_menu_locations', 'type' => 'checkbox', 'values' => $theme_menu_locations, 'default' => array('mega_main_sidebar_menu'));
     } else {
         $locations_options[] = array('name' => __('Firstly, You need to create at least one menu', $constants['MM_TEXTDOMAIN_ADMIN']) . ' (<a href="' . home_url() . '/wp-admin/nav-menus.php">' . __('Theme Menu Settings', $constants['MM_TEXTDOMAIN_ADMIN']) . '</a>) ' . __('and set theme-location for him', $constants['MM_TEXTDOMAIN_ADMIN']) . ' (<a href="' . home_url() . '/wp-admin/nav-menus.php?action=locations">' . __('Theme Menu Locations', $constants['MM_TEXTDOMAIN_ADMIN']) . '</a>).', 'key' => 'no_locations', 'type' => 'caption');
     }
     foreach ($theme_menu_locations as $key => $value) {
         $original_menu_slug = $key;
         $key = str_replace(' ', '-', $key);
         $locations_options = array_merge($locations_options, array(array('name' => __('Layout Options: ', $constants['MM_TEXTDOMAIN_ADMIN']) . '&nbsp; <strong>' . $key . '</strong>', 'key' => $key . '_menu_options', 'type' => 'collapse_start'), array('name' => __('Add to Mega Main Menu:', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('You can add to the primary menu container: logo and search.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_included_components', 'type' => 'checkbox', 'values' => array(__('Company Logo (on left side)', $constants['MM_TEXTDOMAIN_ADMIN']) => 'company_logo', __('Search Box (on right side)', $constants['MM_TEXTDOMAIN_ADMIN']) => 'search_box', __('BuddyPress Bar (on right side)', $constants['MM_TEXTDOMAIN_ADMIN']) => 'buddypress', __('WooCart (on right side)', $constants['MM_TEXTDOMAIN_ADMIN']) => 'woo_cart', __('WPML switcher (on right side)', $constants['MM_TEXTDOMAIN_ADMIN']) => 'wpml_switcher'), 'default' => array('company_logo', 'search_box')), array('name' => __('Height of the first level items', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('Set the height for the initial menu container and items of the first level.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_first_level_item_height', 'type' => 'number', 'min' => 20, 'max' => 300, 'units' => 'px', 'values' => '50', 'default' => '50'), array('name' => __('Primary Style', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('Select the button style that fits the style of your site.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_primary_style', 'type' => 'radio', 'col_width' => 4, 'values' => array(__('Flat', $constants['MM_TEXTDOMAIN_ADMIN']) => 'flat', __('Buttons <small>(+1 option)</small>', $constants['MM_TEXTDOMAIN_ADMIN']) => 'buttons'), 'default' => array('flat')), array('name' => __('Buttons Height', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('Only for "Buttons" style. Specify here height of the first level buttons.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_first_level_button_height', 'type' => 'number', 'min' => 20, 'max' => 300, 'units' => 'px', 'values' => '30', 'default' => '30', 'dependency' => array('element' => 'mega_main_menu_options[' . $key . '_primary_style]', 'value' => array('buttons'))), array('name' => __('Alignment of the first level items', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('Choose how to locate menu elements of the first level.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_first_level_item_align', 'type' => 'radio', 'col_width' => 4, 'values' => array(__('Left', $constants['MM_TEXTDOMAIN_ADMIN']) => 'left', __('Center', $constants['MM_TEXTDOMAIN_ADMIN']) => 'center', __('Right', $constants['MM_TEXTDOMAIN_ADMIN']) => 'right', __('Justify (No Logo!)', $constants['MM_TEXTDOMAIN_ADMIN']) => 'justify'), 'default' => array('left')), array('name' => __('Location of icon in first level elements', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('Choose where to locate icon for first level items.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_first_level_icons_position', 'type' => 'radio', 'col_width' => 4, 'values' => array(__('Left', $constants['MM_TEXTDOMAIN_ADMIN']) => 'left', __('Above', $constants['MM_TEXTDOMAIN_ADMIN']) => 'top', __('Right', $constants['MM_TEXTDOMAIN_ADMIN']) => 'right', __('Disable Icons In First Level Items', $constants['MM_TEXTDOMAIN_ADMIN']) => 'disable_first_lvl', __('Disable Icons Globally', $constants['MM_TEXTDOMAIN_ADMIN']) => 'disable_globally'), 'default' => array('left')), array('name' => __('Separator', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('Select type of separator between the first level items of this menu.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_first_level_separator', 'type' => 'radio', 'col_width' => 4, 'values' => array(__('None', $constants['MM_TEXTDOMAIN_ADMIN']) => 'none', __('Smooth', $constants['MM_TEXTDOMAIN_ADMIN']) => 'smooth', __('Sharp', $constants['MM_TEXTDOMAIN_ADMIN']) => 'sharp'), 'default' => array('smooth')), array('name' => __('Rounded corners', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('Select the value of corners radius.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_corners_rounding', 'type' => 'number', 'min' => 0, 'max' => 100, 'units' => 'px', 'default' => 0), array('name' => __('Trigger', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('Show dropdowns by "hover" or "click"?', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_dropdowns_trigger', 'type' => 'radio', 'col_width' => 4, 'values' => array(__('Hover', $constants['MM_TEXTDOMAIN_ADMIN']) => 'hover', __('Click', $constants['MM_TEXTDOMAIN_ADMIN']) => 'click'), 'default' => array('hover')), array('name' => __('Dropdowns Animation', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('Select the type of animation to displaying dropdowns. <span style="color: #f11;">Warning:</span> Animation correctly works only in the latest versions of progressive browsers.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_dropdowns_animation', 'type' => 'select', 'values' => array(__('None', $constants['MM_TEXTDOMAIN_ADMIN']) => 'none', __('Unfold', $constants['MM_TEXTDOMAIN_ADMIN']) => 'anim_1', __('Fading', $constants['MM_TEXTDOMAIN_ADMIN']) => 'anim_2', __('Scale', $constants['MM_TEXTDOMAIN_ADMIN']) => 'anim_3', __('Down to Up', $constants['MM_TEXTDOMAIN_ADMIN']) => 'anim_4', __('Dropdown', $constants['MM_TEXTDOMAIN_ADMIN']) => 'anim_5'), 'default' => array('none')), array('name' => __('Minimized on Handheld Devices', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('If this option is activated you get the folded menu on handheld devices.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_mobile_minimized', 'type' => 'checkbox', 'values' => array(__('Enable', $constants['MM_TEXTDOMAIN_ADMIN']) => 'true'), 'default' => array('true')), array('name' => __('Label for Mobile Menu', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('Here you can specify label that will be displayed on the mobile version of the menu.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_mobile_label', 'type' => 'text', 'values' => '', 'default' => 'Menu', 'dependency' => array('element' => 'mega_main_menu_options[' . $key . '_mobile_minimized]', 'value' => array('true'))), array('name' => __('Direction', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('Here you can determine the direction of the menu. Horizontal for classic top menu bar. Vertical for sidebar menu.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_direction', 'type' => 'radio', 'col_width' => 4, 'values' => array(__('Horizontal <small>(+5 option)</small>', $constants['MM_TEXTDOMAIN_ADMIN']) => 'horizontal', __('Vertical', $constants['MM_TEXTDOMAIN_ADMIN']) => 'vertical'), 'default' => array('horizontal')), array('name' => __('Full Width Initial Container', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('If this option is enabled then the primary container will try to be the full width.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_fullwidth_container', 'type' => 'checkbox', 'values' => array(__('Enable', $constants['MM_TEXTDOMAIN_ADMIN']) => 'true'), 'dependency' => array('element' => 'mega_main_menu_options[' . $key . '_direction]', 'value' => array('horizontal'))), array('name' => __('Height of the first level items when menu is Sticky (or Mobile)', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('Set the height for the initial menu container and items of the first level.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_first_level_item_height_sticky', 'type' => 'number', 'min' => 20, 'max' => 300, 'units' => 'px', 'values' => '40', 'default' => '40', 'dependency' => array('element' => 'mega_main_menu_options[' . $key . '_direction]', 'value' => array('horizontal'))), array('name' => __('Sticky', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('Check this option to make the menu sticky. Incompatible with the "Vertical" menu. Sticky do not working on mobile devices. If the menu will be is sticky on mobile devices when you open it - you can not click on the last item, because it will always be outside the screen.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_sticky_status', 'type' => 'checkbox', 'values' => array(__('Enable', $constants['MM_TEXTDOMAIN_ADMIN']) => 'true'), 'dependency' => array('element' => 'mega_main_menu_options[' . $key . '_direction]', 'value' => array('horizontal'))), array('name' => __('Sticky scroll offset', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('Set the length of the scroll for each user to pass before the menu will stick to the top of the window.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_sticky_offset', 'type' => 'number', 'min' => 0, 'max' => 2000, 'units' => 'px', 'default' => 340, 'dependency' => array('element' => 'mega_main_menu_options[' . $key . '_direction]', 'value' => array('horizontal'))), array('name' => __('Push Content Down', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('Dropdown areas pushes the main website content down instead to dropping down over content. This option will be useful only for "Multi column" and "Full width" dropdowns.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_pushing_content', 'type' => 'checkbox', 'values' => array(__('Enable', $constants['MM_TEXTDOMAIN_ADMIN']) => 'true'), 'dependency' => array('element' => 'mega_main_menu_options[' . $key . '_direction]', 'value' => array('horizontal'))), array('name' => __('Shortcode', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('You can copy this code and use in the content of the page in order to display this menu. Do not forget to activate mega menu for this location, using option at the beginning of this page.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'shortcode_integration', 'type' => 'just_html', 'default' => '<pre>[mega_main_menu location="' . $key . '"][/mega_main_menu]</pre>'), array('name' => __('Forced PHP Integration', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('If you have knowledge of PHP you can call this function anywhere in order to display this menu. Please use it only if you professional.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'forced_integration', 'type' => 'just_html', 'default' => '<pre>&lt;?php echo wp_nav_menu( array( "theme_location" => "' . $key . '" ) ); ?&gt;</pre>'), array('name' => '', 'type' => 'collapse_end')));
     }
     $locations_options = array_merge($locations_options, array(array('name' => __('Logo Settings', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'mega_menu_logo', 'type' => 'caption'), array('name' => __('The logo file', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __("Select image to be used as logo in Main Mega Menu. It's recommended to use image with transparent background (.PNG) and sizes from 200 to 800 px.", $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'logo_src', 'type' => 'file', 'default' => $constants['MM_WARE_URL'] . 'framework/src/img/megamain-logo-120x120.png'), array('name' => __('Maximum logo height', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('Maximum logo height in terms of percentage in regard to the height of the initial container.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'logo_height', 'min' => 10, 'max' => 100, 'units' => '%', 'type' => 'number', 'default' => 90), array('name' => __('Backup of the configuration', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('You can make a backup of the plugin configuration and restore this configuration later. Notice: Options of each menu item from the section "Menu Structure" is not imported.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'backup', 'type' => 'just_html', 'default' => '<a href="' . get_admin_url() . '?' . $constants['MM_WARE_PREFIX'] . '_page=backup_file">' . __('Download backup file with current settings') . '</a><br /><br />' . __('Upload backup file and restore settings. Chose file and click "Save All Settings".') . '<br /><input class="col-xs-12 form-control input-sm" type="file" name="' . $constants['MM_OPTIONS_NAME'] . '_backup" />')));
     $skins_options = array(array('name' => __('You can change any properties for any menu location', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'mega_menu_skins', 'type' => 'caption'));
     foreach ($theme_menu_locations as $key => $value) {
         $key = str_replace(' ', '-', $key);
         $skins_options = array_merge($skins_options, array(array('name' => __('Skin Options: ', $constants['MM_TEXTDOMAIN_ADMIN']) . '&nbsp; <strong>' . $key . '</strong>', 'key' => $key . '_menu_skin', 'type' => 'collapse_start'), array('name' => __('Skin Options of the Initial Container', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'dropdowns_skin_options', 'type' => 'caption'), array('name' => __('Background Gradient (Color) of the primary container ', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_menu_bg_gradient', 'type' => 'gradient', 'default' => array('color1' => '#428bca', 'color2' => '#2a6496', 'start' => '0', 'end' => '100', 'orientation' => 'top')), array('name' => __('Background image of the primary container', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('You can choose and tune the background image for the primary container.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_menu_bg_image', 'type' => 'background_image', 'default' => ''), array('name' => __('First Level Items', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'dropdowns_skin_options', 'type' => 'caption'), array('name' => __('Font of the First Level Item', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('You can change size and weight of the font for first level items.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_menu_first_level_link_font', 'type' => 'font', 'values' => array('font_family', 'font_size', 'font_weight'), 'default' => array('font_family' => 'Inherit', 'font_size' => '13', 'font_weight' => '400')), array('name' => __('Text color of the first level item', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_menu_first_level_link_color', 'type' => 'color', 'default' => '#f8f8f8'), array('name' => __('Icons in the first level item', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_menu_first_level_icon_font', 'type' => 'number', 'col_width' => 3, 'min' => 0, 'max' => 200, 'units' => 'px', 'values' => '15', 'default' => '15'), array('name' => __('Background Gradient (Color) of the first level item', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_menu_first_level_link_bg', 'type' => 'gradient', 'default' => array('color1' => '#428bca', 'color2' => '#2a6496', 'start' => '0', 'end' => '100', 'orientation' => 'top')), array('name' => __('Text color of the active first level item', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_menu_first_level_link_color_hover', 'type' => 'color', 'default' => '#f8f8f8'), array('name' => __('Background Gradient (Color) of the active first level item', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_menu_first_level_link_bg_hover', 'type' => 'gradient', 'default' => array('color1' => '#3498db', 'color2' => '#2980b9', 'start' => '0', 'end' => '100', 'orientation' => 'top')), array('name' => __('Background color of the Search Box', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_menu_search_bg', 'type' => 'color', 'default' => '#3498db'), array('name' => __('Text and icon color of the Search Box', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_menu_search_color', 'type' => 'color', 'default' => '#f8f8f8'), array('name' => __('Dropdowns', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'dropdowns_skin_options', 'type' => 'caption'), array('name' => __('Background Gradient (Color) of the Dropdown Area', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_menu_dropdown_wrapper_gradient', 'type' => 'gradient', 'default' => array('color1' => '#ffffff', 'color2' => '#ffffff', 'start' => '0', 'end' => '100', 'orientation' => 'top')), array('name' => __('Font of the dropdown menu item', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_menu_dropdown_link_font', 'type' => 'font', 'values' => array('font_family', 'font_size', 'font_weight'), 'default' => array('font_family' => 'Inherit', 'font_size' => '12', 'font_weight' => '400')), array('name' => __('Text color of the dropdown menu item', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_menu_dropdown_link_color', 'type' => 'color', 'default' => '#428bca'), array('name' => __('Icons of the dropdown menu item', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_menu_dropdown_icon_font', 'type' => 'number', 'col_width' => 3, 'min' => 0, 'max' => 200, 'units' => 'px', 'values' => '12', 'default' => '12'), array('name' => __('Background Gradient (Color) of the dropdown menu item', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_menu_dropdown_link_bg', 'type' => 'gradient', 'default' => array('color1' => 'rgba(255,255,255,0)', 'color2' => 'rgba(255,255,255,0)', 'start' => '0', 'end' => '100', 'orientation' => 'top')), array('name' => __('Border color between dropdown menu items', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_menu_dropdown_link_border_color', 'type' => 'color', 'default' => '#f0f0f0'), array('name' => __('Text color of the dropdown active menu item', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_menu_dropdown_link_color_hover', 'type' => 'color', 'default' => '#f8f8f8'), array('name' => __('Background Gradient (Color) of the dropdown active menu item', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_menu_dropdown_link_bg_hover', 'type' => 'gradient', 'default' => array('color1' => '#3498db', 'color2' => '#2980b9', 'start' => '0', 'end' => '100', 'orientation' => 'top')), array('name' => __('Plain Text Color of the Dropdown', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => $key . '_menu_dropdown_plain_text_color', 'type' => 'color', 'default' => '#333333'), array('name' => '', 'type' => 'collapse_end')));
     }
     $skins_options = array_merge($skins_options, array(array('name' => __('Set of Installed Google Fonts', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('Select the fonts to be included on the site. Remember that a lot of fonts affect on the speed of load page. Always remove unnecessary fonts. Font faces can see on this page - ', $constants['MM_TEXTDOMAIN_ADMIN']) . '<a href="http://www.google.com/fonts" target="_blank">Google fonts</a>', 'key' => 'set_of_google_fonts', 'type' => 'multiplier', 'default' => '0', 'values' => array(array('name' => __('Font 1', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'font_item', 'type' => 'collapse_start'), array('name' => __('Fonts Faily', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'family', 'type' => 'select', 'values' => mm_datastore::get_googlefonts_list(), 'default' => 'Open Sans'), array('name' => '', 'key' => 'font_item', 'type' => 'collapse_end'))), array('name' => __('Custom Icons', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('You can add custom raster icons. After saving these settings, icons will become available in a modal window of icons selection. Recommended size 64x64 pixels.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'set_of_custom_icons', 'type' => 'multiplier', 'default' => '1', 'values' => array(array('name' => __('Custom Icon 1', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'icon_item', 'type' => 'collapse_start'), array('name' => __('Icon File', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'custom_icon', 'type' => 'file', 'default' => $constants['MM_WARE_URL'] . 'framework/src/img/megamain-logo-120x120.png'), array('name' => __('Icon File on Hover', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('Keep empty to use regular for both', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'custom_icon_hover', 'type' => 'file', 'default' => ''), array('name' => '', 'key' => 'icon_item', 'type' => 'collapse_end'))), array('name' => __('Additional Styles: ', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('Here you can add and edit highlighting styles. After that you can select these styles for menu item in "Menus -> Your Menu Item -> Style of This Item" option.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'additional_styles_presets', 'type' => 'multiplier', 'default' => '0', 'values' => array(array('name' => __('Style 1', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'additional_style_item', 'type' => 'collapse_start'), array('name' => __('Style Name', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'style_name', 'type' => 'textfield', 'default' => 'My Highlight Style'), array('name' => __('Font', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'font', 'type' => 'font', 'values' => array('font_family', 'font_size', 'font_weight'), 'default' => array('font_family' => 'Inherit', 'font_size' => '12', 'font_weight' => '400')), array('name' => __('Icon Size', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'icon', 'type' => 'font', 'values' => array('font_size'), 'default' => array('font_size' => '12')), array('name' => __('Text color', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'text_color', 'type' => 'color', 'default' => '#f8f8f8'), array('name' => __('Background Gradient (Color) ', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'bg_gradient', 'type' => 'gradient', 'default' => array('color1' => '#34495E', 'color2' => '#2C3E50', 'start' => '0', 'end' => '100', 'orientation' => 'top')), array('name' => __('Text color of the active item', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'text_color_hover', 'type' => 'color', 'default' => '#f8f8f8'), array('name' => __('Background Gradient (Color) of the active item', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'bg_gradient_hover', 'type' => 'gradient', 'default' => array('color1' => '#3d566e', 'color2' => '#354b60', 'start' => '0', 'end' => '100', 'orientation' => 'top')), array('name' => '', 'key' => 'additional_style_item', 'type' => 'collapse_end')))));
     return array(array('title' => 'General', 'key' => 'mm_general', 'icon' => 'im-icon-wrench-3', 'options' => $locations_options), array('title' => 'Skins', 'key' => 'mm_skins', 'icon' => 'im-icon-brush', 'options' => $skins_options), array('title' => 'Specific Options', 'key' => 'mm_specific_options', 'icon' => 'im-icon-hammer', 'options' => array(array('name' => __('Custom CSS', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('You can place here any necessary custom CSS properties.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'custom_css', 'type' => 'textarea', 'col_width' => 12), array('name' => __('Responsive for Handheld Devices', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('Enable responsive properties. If this option is enabled, then the menu will be transformed, if the user uses the handheld device.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'responsive_styles', 'type' => 'checkbox', 'values' => array(__('Enable', $constants['MM_TEXTDOMAIN_ADMIN']) => 'true'), 'default' => array('true')), array('name' => __('Responsive Resolution', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('Select on which screen resolution menu will be transformed for mobile devices.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'responsive_resolution', 'type' => 'radio', 'col_width' => 3, 'values' => array('480px (iPhone Landscape)' => '480', '768px (iPad Portrait)' => '768', '960px' => '960', '1024px (iPad Landscape)' => '1024'), 'default' => array('1024')), array('name' => __('Use sets of icons', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('Here you can activate different sets of icons. Remember that the larger the list of icons - require more of time to loading page.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'icon_sets', 'type' => 'checkbox', 'values' => array(__('IcoMoon (1200)', $constants['MM_TEXTDOMAIN_ADMIN']) => 'icomoon', __('FontAwesome (400)', $constants['MM_TEXTDOMAIN_ADMIN']) => 'fontawesome', __('Glyphicons (200)', $constants['MM_TEXTDOMAIN_ADMIN']) => 'glyphicons'), 'default' => array('icomoon')), array('name' => __('Use Coercive Styles', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('If this option is checked - all CSS properties for this plugin will be have "!important" priority.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'coercive_styles', 'type' => 'checkbox', 'values' => array(__('Enable', $constants['MM_TEXTDOMAIN_ADMIN']) => 'true')), array('name' => __('"Indefinite location" mode', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('<span style="color: #f11;">Warning:</span> If this option is checked - all menus will be replaced by the mega menu. This will be useful only for templates in which are not defined locations of the menu and template has only one menu.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'indefinite_location_mode', 'type' => 'checkbox', 'values' => array(__('Enable', $constants['MM_TEXTDOMAIN_ADMIN']) => 'true')), array('name' => __('Number of widget areas', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('Set here how many independent widget areas you need.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'number_of_widgets', 'type' => 'number', 'min' => 0, 'max' => 100, 'units' => 'areas', 'values' => '1', 'default' => '1'), array('name' => __('Language text direction', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('You can select direction of the text for this plugin. LTR - sites where text is read from left to right. RTL - sites where text is read from right to left.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'language_direction', 'type' => 'radio', 'values' => array(__('Left To Right', $constants['MM_TEXTDOMAIN_ADMIN']) => 'ltr', __('Right To Left', $constants['MM_TEXTDOMAIN_ADMIN']) => 'rtl'), 'default' => array('ltr')))), array('title' => 'Settings of the structure', 'key' => 'mm_structure_settings', 'icon' => 'im-icon-checkbox', 'options' => array(array('name' => __('Here you can deactivate the options that you  do not use to customize the menu structure. It helps reduce the number of options and reduce the load on the server.', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'menu_structure_settings', 'type' => 'caption'), array('name' => __('Description of the item', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'item_descr', 'type' => 'checkbox', 'values' => array(__('Disable', $constants['MM_TEXTDOMAIN_ADMIN']) => 'disable')), array('name' => __('Style of the item', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'item_style', 'type' => 'checkbox', 'values' => array(__('Disable', $constants['MM_TEXTDOMAIN_ADMIN']) => 'disable'), 'default' => array('true')), array('name' => __('Visibility Control', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'item_visibility', 'type' => 'checkbox', 'values' => array(__('Disable', $constants['MM_TEXTDOMAIN_ADMIN']) => 'disable'), 'default' => array('true')), array('name' => __('Icon of the item', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'item_icon', 'type' => 'checkbox', 'values' => array(__('Disable', $constants['MM_TEXTDOMAIN_ADMIN']) => 'disable')), array('name' => __('Hide Text of the Item', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'disable_text', 'type' => 'checkbox', 'values' => array(__('Disable', $constants['MM_TEXTDOMAIN_ADMIN']) => 'disable')), array('name' => __('Disable Link', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'disable_link', 'type' => 'checkbox', 'values' => array(__('Disable', $constants['MM_TEXTDOMAIN_ADMIN']) => 'disable')), array('name' => __('Pull to the Other Side', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'pull_to_other_side', 'type' => 'checkbox', 'values' => array(__('Disable', $constants['MM_TEXTDOMAIN_ADMIN']) => 'disable'), 'default' => array('true')), array('name' => __('Submenu Type', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'submenu_type', 'type' => 'checkbox', 'values' => array(__('Disable', $constants['MM_TEXTDOMAIN_ADMIN']) => 'disable')), array('name' => __('Side of dropdown elements', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'submenu_drops_side', 'type' => 'checkbox', 'values' => array(__('Disable', $constants['MM_TEXTDOMAIN_ADMIN']) => 'disable')), array('name' => __('Submenu Columns', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'submenu_columns', 'type' => 'checkbox', 'values' => array(__('Disable', $constants['MM_TEXTDOMAIN_ADMIN']) => 'disable')), array('name' => __('Enable Full Width Dropdown', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'submenu_enable_full_width', 'type' => 'checkbox', 'values' => array(__('Disable', $constants['MM_TEXTDOMAIN_ADMIN']) => 'disable')), array('name' => __('Dropdown Background Image', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'submenu_bg_image', 'type' => 'checkbox', 'values' => array(__('Disable', $constants['MM_TEXTDOMAIN_ADMIN']) => 'disable')))), array('title' => 'Documentation & Support', 'key' => 'support', 'icon' => 'im-icon-support', 'options' => array(array('name' => '', 'key' => 'support', 'type' => 'just_html', 'default' => '<br /><br /> <a href="http://manual.extensions.megamain.com/" target="_blank">Online documentation</a>. <br /><br /> If you need support, <br /> If you have a question or suggestion - <br /> Leave a message on our support page <br /> <a href="http://support.megamain.com/?ref=' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] . '" target="_blank">Support.MegaMain.com</a> (in new window).<br /> <br />'), array('name' => __('Purchase Code', $constants['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('Enter here the purchase code of this product. This action unlocks the automatic updates for you. "Where you can find your <a href="http://support.megamain.com/src/img/megamain-find-item-purchase-code.png" target="_blank">Purchase Code</a>".', $constants['MM_TEXTDOMAIN_ADMIN']), 'key' => 'purchase_code', 'type' => 'textfield', 'col_width' => 6, 'default' => ''))));
     // END FRIMARY ARRAY
 }
Example #9
0
function campaign_register_metabox()
{
    // Start with an underscore to hide fields from custom fields list
    $prefix = '_ppm_';
    /**
     * Sample metabox to demonstrate each field type included
     */
    $post_meta = new_cmb2_box(array('id' => $prefix . 'post_metabox', 'title' => __('Post Meta', 'cmb2'), 'object_types' => array('page'), 'show_on' => array('key' => 'child_of', 'value' => array(4)), 'context' => 'normal', 'priority' => 'high', 'show_names' => true));
    $menus = get_registered_nav_menus();
    foreach ($menus as $location => $description) {
        $options[$location] = $description;
    }
    $post_meta->add_field(array('name' => 'Menu Select', 'desc' => 'Select a menu to show', 'id' => $prefix . 'menu_select', 'type' => 'select', 'show_option_none' => true, 'default' => 'custom', 'options' => $options));
    $post_meta->add_field(array('name' => 'Section Class', 'desc' => 'Enter section class', 'id' => $prefix . 'section_class', 'type' => 'text', 'default' => 'col-md-6'));
    $post_meta->add_field(array('name' => 'View More Link', 'desc' => 'Enter view more link', 'id' => $prefix . 'section_link', 'type' => 'text'));
    $products_meta = new_cmb2_box(array('id' => $prefix . 'products_metabox', 'title' => __('Products Meta', 'cmb2'), 'object_types' => array('isis-product'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true));
    $products_meta->add_field(array('name' => 'Product Subtitle', 'desc' => 'Enter the product subtitle', 'id' => $prefix . 'product_subtitle', 'type' => 'text'));
    $industries_meta = new_cmb2_box(array('id' => $prefix . 'industries_metabox', 'title' => __('Industries Meta', 'cmb2'), 'object_types' => array('industry'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true));
    $industries_meta->add_field(array('name' => 'Industry Subtitle', 'desc' => 'Enter the industry subtitle', 'id' => $prefix . 'industry_subtitle', 'type' => 'text'));
    $support_meta = new_cmb2_box(array('id' => $prefix . 'support_metabox', 'title' => __('Support Meta', 'cmb2'), 'object_types' => array('page'), 'show_on' => array('key' => 'child_of', 'value' => array(54)), 'context' => 'normal', 'priority' => 'high', 'show_names' => true));
    $support_meta->add_field(array('name' => 'Support Resources Title', 'desc' => 'Enter section title', 'id' => $prefix . 'resource_title', 'type' => 'text'));
    $support_meta->add_field(array('name' => 'Support Resources Intro', 'desc' => 'Enter section intro', 'id' => $prefix . 'resource_intro', 'type' => 'textarea'));
    $support_meta->add_field(array('name' => 'Support Premium Resources Title', 'desc' => 'Enter section title', 'id' => $prefix . 'resource_premium_title', 'type' => 'text'));
    $support_meta->add_field(array('name' => 'Support Premium Resources Intro', 'desc' => 'Enter section intro', 'id' => $prefix . 'resource_premium_intro', 'type' => 'textarea'));
    $video_meta = new_cmb2_box(array('id' => $prefix . 'video_metabox', 'title' => __('Video Meta', 'cmb2'), 'object_types' => array('videos'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true));
    $video_meta->add_field(array('name' => 'Video Description', 'desc' => 'Enter text to introduce video', 'id' => $prefix . 'video_description', 'type' => 'textarea'));
    $video_meta->add_field(array('name' => 'Video Duration', 'desc' => 'Enter enter video duration (2:01s)', 'id' => $prefix . 'video_duration', 'type' => 'text'));
    $header_meta = new_cmb2_box(array('id' => $prefix . 'header_metabox', 'title' => __('Header Meta', 'cmb2'), 'object_types' => array('page'), 'context' => 'side', 'priority' => 'low', 'show_names' => true));
    $header_meta->add_field(array('name' => 'Button Text', 'desc' => 'Enter section class', 'id' => $prefix . 'header_text', 'type' => 'text'));
    $header_meta->add_field(array('name' => 'Button Link', 'desc' => 'Enter button link', 'id' => $prefix . 'header_link', 'type' => 'text'));
}
Example #10
0
function shiftnav_get_theme_location_ops()
{
    $locs = get_registered_nav_menus();
    $default = array('_none' => 'Select Theme Location or use Menu Setting');
    //$locs = array_unshift( $default, $locs );
    $locs = $default + $locs;
    //shiftp( $locs );
    return $locs;
}
function register_loggedin_menus()
{
    $default_menus = get_registered_nav_menus();
    $loggedin_menus = array();
    foreach ($default_menus as $slug => $name) {
        $loggedin_menus[$slug . '_dmlu_loggedin'] = $name . ' Loggedin';
    }
    register_nav_menus($loggedin_menus);
}
 /**
  * Return all themes registered for this site
  * @return array|bool
  */
 public static function list_all_theme_location_names()
 {
     $theme_locations = false;
     $themes = get_registered_nav_menus();
     foreach ($themes as $location => $menu_key) {
         $theme_locations[] = $location;
     }
     return $theme_locations;
 }
 public function get_menu()
 {
     global $json_api;
     // Make sure we have key/value query vars
     if ($json_api->query->menu_id || $json_api->query->menu_location) {
         function get_nav_items($id)
         {
             global $json_api;
             $menu_output = wp_get_nav_menu_items($id);
             $filtered_items = array_map(function ($el) {
                 $filter = array("id" => $el->ID, "parent_id" => $el->menu_item_parent, "menu_order" => $el->menu_order, "label" => $el->title, "object_type" => $el->object, "object_id" => $el->object == "custom" ? "" : $el->object_id, "url" => $el->object == "custom" ? $el->url : "");
                 return $filter;
             }, $menu_output);
             $output = $json_api->query->dev == "1" ? $menu_output : $filtered_items;
             $count = count($output);
             if ($count == "0") {
                 $json_api->error("The menu you are looking for is empty or does not exist.");
             } else {
                 return array("output" => $output, "count" => $count);
             }
         }
         if ($json_api->query->menu_id) {
             $menuid = $json_api->query->menu_id;
             $menuloc = "";
             $menu_items = get_nav_items($menuid);
         } else {
             if ($json_api->query->menu_location) {
                 $menuloc = $json_api->query->menu_location;
                 $locations = get_registered_nav_menus();
                 $menus = wp_get_nav_menus();
                 $menu_locations = get_nav_menu_locations();
                 if (isset($menu_locations[$menuloc])) {
                     foreach ($menus as $menu) {
                         // If the ID of this menu is the ID associated with the location we're searching for
                         if ($menu->term_id == $menu_locations[$menuloc]) {
                             // This is the correct menu
                             $menuid = $menu->slug;
                             var_dump($menu->slug);
                             // Get the items for this menu
                             $menu_items = get_nav_items($menuid);
                             break;
                         }
                         //else if ($menu->term_id != $menu_locations[ $menuloc ]) {
                         //	$json_api->error("There are no menus set for this location.");
                         //}
                     }
                 } else {
                     $json_api->error("Menu location: '" . $menuloc . "' does not exist");
                 }
             }
         }
         return array("count" => $menu_items["count"], "menu_location" => $menuloc, "menu_id" => $menuid, "menu" => $menu_items["output"]);
     } else {
         $json_api->error("Include the parameter 'menu_id' with an appropriate string value.");
     }
 }
 function tc_alter_wp_customizer_settings($wp_customize)
 {
     //CHANGE BLOGNAME AND BLOGDESCRIPTION TRANSPORT
     $wp_customize->get_setting('blogname')->transport = 'postMessage';
     $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
     //IF WP VERSION >= 4.3 AND SITE_ICON SETTING EXISTS
     //=> REMOVE CUSTOMIZR FAV ICON CONTROL
     //=> CHANGE SITE ICON DEFAULT WP SECTION TO CUSTOMIZR LOGO SECTION
     global $wp_version;
     if (version_compare($wp_version, '4.3', '>=') && is_object($wp_customize->get_control('site_icon'))) {
         $tc_option_group = TC___::$tc_option_group;
         $wp_customize->remove_control("{$tc_option_group}[tc_fav_upload]");
         //note : the setting is kept because used in the customizer js api to handle the transition between Customizr favicon to WP site icon.
         $wp_customize->get_control('site_icon')->section = 'logo_sec';
         //add a favicon title after the logo upload
         add_action('__after_setting_control', array($this, 'tc_add_favicon_title'));
     }
     //end ALTER SITE ICON
     //CHANGE MENUS PROPERTIES
     $locations = get_registered_nav_menus();
     $menus = wp_get_nav_menus();
     $choices = array('' => __('&mdash; Select &mdash;', 'customizr'));
     foreach ($menus as $menu) {
         $choices[$menu->term_id] = wp_html_excerpt($menu->name, 40, '&hellip;');
     }
     $_priorities = array('main' => 10, 'secondary' => 20);
     //WP only adds the menu(s) settings and controls if the user has created at least one menu.
     //1) if no menus yet, we still want to display the menu picker + add a notice with a link to the admin menu creation panel
     //=> add_setting and add_control for each menu location. Check if they are set first by security
     //2) if user has already created a menu, the settings are already created, we just need to update the controls.
     $_priority = 0;
     //assign new priorities to the menus controls
     foreach ($locations as $location => $description) {
         $menu_setting_id = "nav_menu_locations[{$location}]";
         //create the settings if they don't exist
         //=> in the condition, make sure that the setting has really not been created yet (maybe over secured)
         if (!$menus && !is_object($wp_customize->get_setting($menu_setting_id))) {
             $wp_customize->add_setting($menu_setting_id, array('sanitize_callback' => 'absint', 'theme_supports' => 'menus'));
         }
         //remove the controls if they exists
         if (is_object($wp_customize->get_control($menu_setting_id))) {
             $wp_customize->remove_control($menu_setting_id);
         }
         //replace the controls by our custom controls
         $_control_properties = array('label' => $description, 'section' => 'nav', 'title' => "main" == $location ? __('Assign menus to locations', 'customizr') : false, 'type' => 'select', 'choices' => $choices, 'priority' => isset($_priorities[$location]) ? $_priorities[$location] : $_priority);
         //add a notice property if no menu created yet.
         if (!$menus) {
             //adapt the nav section description for v4.3 (menu in the customizer from now on)
             $_create_menu_link = version_compare($GLOBALS['wp_version'], '4.3', '<') ? admin_url('nav-menus.php') : "javascript:wp.customize.section('nav').container.find('.customize-section-back').trigger('click'); wp.customize.panel('nav_menus').focus();";
             $_control_properties['notice'] = sprintf(__("You haven't created any menu yet. %s or check the %s to learn more about menus.", "customizr"), sprintf('<strong><a href="%1$s" title="%2$s">%2$s</a></strong>', $_create_menu_link, __("Create a new menu now", "customizr")), sprintf('<a href="%1$s" title="%2$s" target="_blank">%2$s</a>', esc_url('codex.wordpress.org/WordPress_Menu_User_Guide'), __("WordPress documentation", "customizr")));
         }
         $wp_customize->add_control(new TC_controls($wp_customize, $menu_setting_id, $_control_properties));
         $_priority = $_priority + 10;
     }
     //foreach
 }
 /**
  * Add mega menu options
  *
  * @since  1.0.0
  *
  * @param  array  $sections  default sections array
  * @return array             filtered sections array
  */
 public function add_options($sections)
 {
     // Get menus
     $menus = get_registered_nav_menus();
     $options_menus = array('0' => __('Select main theme menu', 'cherry-mega-menu'));
     $options_menus = array_merge($options_menus, $menus);
     $menu_options = array('mega-menu-location' => array('type' => 'select', 'title' => __('Main theme menu location', 'cherry-mega-menu'), 'label' => __('Select the menu location for your main menu', 'cherry-mega-menu'), 'decsription' => '', 'hint' => array('type' => 'text', 'content' => __('Select menu location for main theme menu. Mega menu will be applied to this location.', 'cherry-mega-menu')), 'multiple' => true, 'value' => array('primary'), 'class' => 'cherry-multi-select', 'options' => $options_menus), 'mega-menu-enabled' => array('type' => 'switcher', 'title' => __('Mega menu enabled', 'cherry-mega-menu'), 'label' => __('Enable / Disable', 'cherry-mega-menu'), 'decsription' => '', 'hint' => array('type' => 'text', 'content' => __('This applies only to main site menu', 'cherry-mega-menu')), 'value' => 'true', 'default_value' => 'true'), 'mega-menu-mobile-trigger' => array('type' => 'slider', 'title' => __('Mobile starts from', 'cherry-mega-menu'), 'label' => __('Select the window dimensions for mobile menu layout switching.', 'cherry-mega-menu'), 'decsription' => '', 'hint' => array('type' => 'text', 'content' => __('Select the window dimensions for mobile menu layout switching.', 'cherry-mega-menu')), 'max_value' => 1200, 'min_value' => 480, 'value' => 768), 'mega-menu-mobile-label' => array('type' => 'text', 'title' => __('Mobile nav label', 'cherry-mega-menu'), 'label' => __('Enter the mobile navigation label ', 'cherry-mega-menu'), 'decsription' => '', 'hint' => array('type' => 'text', 'content' => __('Enter the mobile navigation label ', 'cherry-mega-menu')), 'value' => __('Menu', 'cherry-mega-menu'), 'default_value' => __('Menu', 'cherry-mega-menu')), 'mega-menu-direction' => array('type' => 'select', 'title' => __('Menu direction', 'cherry-mega-menu'), 'label' => __('Select your direction: vertical or horizontal', 'cherry-mega-menu'), 'decsription' => '', 'hint' => array('type' => 'text', 'content' => __('Select your direction: vertical or horizontal', 'cherry-mega-menu')), 'value' => 'horizontal', 'class' => 'width-full', 'options' => array('horizontal' => __('Horizontal', 'cherry-mega-menu'), 'vertical' => __('Vertical', 'cherry-mega-menu'))), 'mega-menu-effect' => array('type' => 'select', 'title' => __('Animation effect', 'cherry-mega-menu'), 'label' => __('Animation effects for the dropdown menu', 'cherry-mega-menu'), 'decsription' => '', 'hint' => array('type' => 'text', 'content' => __('Animation effects for the dropdown menu', 'cherry-mega-menu')), 'value' => 'slide-top', 'class' => 'width-full', 'options' => array('fade-in' => __('Fade In', 'cherry-mega-menu'), 'slide-top' => __('Slide from top', 'cherry-mega-menu'), 'slide-bottom' => __('Slide from bottom', 'cherry-mega-menu'), 'slide-left' => __('Slide from left', 'cherry-mega-menu'), 'slide-right' => __('Slide from right', 'cherry-mega-menu'))), 'mega-menu-event' => array('type' => 'select', 'title' => __('Event', 'cherry-mega-menu'), 'label' => __('Select an activation event', 'cherry-mega-menu'), 'decsription' => '', 'hint' => array('type' => 'text', 'content' => __('Select an activation event', 'cherry-mega-menu')), 'value' => 'hover', 'class' => 'width-full', 'options' => array('hover' => __('Hover', 'cherry-mega-menu'), 'click' => __('Click', 'cherry-mega-menu'))), 'mega-menu-parent-container' => array('type' => 'text', 'title' => __('Menu parent container CSS selector', 'cherry-mega-menu'), 'label' => __('Enter CSS selector name for mega menu parent container (if needed)', 'cherry-mega-menu'), 'decsription' => '', 'hint' => array('type' => 'text', 'content' => __('Enter CSS class name for mega menu parent container (if needed)', 'cherry-mega-menu')), 'value' => apply_filters('cherry_mega_menu_default_parent', '.cherry-mega-menu')));
     $menu_options = apply_filters('cherry_mega_menu_options', $menu_options);
     $sections['mega-menu-options-section'] = array('name' => 'Megamenu', 'icon' => 'dashicons dashicons-arrow-right', 'parent' => 'navigation-section', 'priority' => 41, 'options-list' => $menu_options);
     return $sections;
 }
/**
 * Get all registered menus
 * @return array List of menus with slug and description
 */
function wp_api_v2_menus_get_all_menus()
{
    $menus = [];
    foreach (get_registered_nav_menus() as $slug => $description) {
        $obj = new stdClass();
        $obj->slug = $slug;
        $obj->description = $description;
        $menus[] = $obj;
    }
    return $menus;
}
Example #17
0
function toolbar_link_to_mypage($wp_admin_bar)
{
    $locations = get_registered_nav_menus();
    $menus = wp_get_nav_menus();
    $menu_locations = get_nav_menu_locations();
    $location_id = 'mf-admin-bayarea-register-menu';
    if (isset($menu_locations[$location_id])) {
        foreach ($menus as $menu) {
            // If the ID of this menu is the ID associated with the location we're searching for
            if ($menu->term_id == $menu_locations[$location_id]) {
                // This is the correct menu
                $menu_items = wp_get_nav_menu_items($menu);
                $args = array('id' => 'mf_admin_parent', 'title' => 'MF Admin', 'meta' => array('class' => 'my-toolbar-page'));
                $wp_admin_bar->add_node($args);
                buildFaireDrop($wp_admin_bar);
                foreach ((array) $menu_items as $key => $menu_item) {
                    $args = array('id' => $menu_item->object_id, 'title' => $menu_item->title, 'href' => $menu_item->url, 'meta' => array('class' => 'my-toolbar-page'), 'parent' => 'mf_admin_parent_BA15');
                    $wp_admin_bar->add_node($args);
                }
            }
        }
    }
    //new york
    $location_id = 'mf-admin-newyork-register-menu';
    if (isset($menu_locations[$location_id])) {
        foreach ($menus as $menu) {
            // If the ID of this menu is the ID associated with the location we're searching for
            if ($menu->term_id == $menu_locations[$location_id]) {
                // This is the correct menu
                $menu_items = wp_get_nav_menu_items($menu);
                $wp_admin_bar->add_node($args);
                foreach ((array) $menu_items as $key => $menu_item) {
                    $args = array('id' => $menu_item->object_id, 'title' => $menu_item->title, 'href' => $menu_item->url, 'meta' => array('class' => 'my-toolbar-page'), 'parent' => 'mf_admin_parent_NY15');
                    $wp_admin_bar->add_node($args);
                }
            }
        }
    }
    //faire setup
    $location_id = 'mf-admin-fairesetup-register-menu';
    if (isset($menu_locations[$location_id])) {
        foreach ($menus as $menu) {
            // If the ID of this menu is the ID associated with the location we're searching for
            if ($menu->term_id == $menu_locations[$location_id]) {
                // This is the correct menu
                $menu_items = wp_get_nav_menu_items($menu);
                foreach ((array) $menu_items as $key => $menu_item) {
                    $args = array('id' => $menu_item->object_id, 'title' => $menu_item->title, 'href' => $menu_item->url, 'meta' => array('class' => 'my-toolbar-page'), 'parent' => 'mf_admin_parent_fairesetup');
                    $wp_admin_bar->add_node($args);
                }
            }
        }
    }
}
Example #18
0
/**
 * Check if a custom menu location is registered
 * @since 0.1.0
 */
function tamatebako_is_menu_registered($location)
{
    /* Get registered nav menu */
    $menus = get_registered_nav_menus();
    if (empty($menus)) {
        return false;
    } elseif (isset($menus[$location])) {
        return true;
    }
    return false;
}
 /**
  * Get all registered menus.
  *
  * @return WP_Error|WP_JSON_ResponseInterface
  */
 public function get_menus()
 {
     $menus = get_registered_nav_menus();
     if ($menus) {
         $response = json_ensure_response($menus);
         $response->set_status(201);
         $response->header('Location', json_url('jpwp/menus/'));
         return $response;
     } else {
         return new WP_Error('jwp_api_error' . __FUNCTION__, __('Menus could not be returned.', 'jpwp-api'));
     }
 }
function has_nav_menu($location)
{
    $has_nav_menu = false;
    $registered_nav_menus = get_registered_nav_menus();
    if (isset($registered_nav_menus[$location])) {
        // $locations = get_nav_menu_locations();
        $has_nav_menu = $location;
    }
    // pr($registered_nav_menus);pr($locations);pr($location);die('has_nav_menu');
    // pr(apply_filters( 'has_nav_menu', $has_nav_menu, $location ));die;
    return apply_filters('has_nav_menu', $has_nav_menu, $location);
}
Example #21
0
 public function get_menu_locations()
 {
     global $wpdb;
     #CREATE LOCATION OBJECT
     $location_object = array('locations' => array());
     $menus_locations = get_registered_nav_menus();
     foreach ($menus_locations as $location => $description) {
         array_push($location_object['locations'], array('location' => $location));
     }
     echo json_encode($location_object);
     exit;
 }
 /**
  * Get menu locations.
  *
  * @since 1.2.0
  * @param  $request
  * @return array All registered menus locations
  */
 public function get_items($request)
 {
     $rest_url = get_rest_url() . $this->namespace . '/' . $this->base;
     $locations = get_nav_menu_locations();
     $registered_menus = get_registered_nav_menus();
     $rest_menus = array();
     if ($locations && $registered_menus) {
         foreach ($registered_menus as $slug => $label) {
             $rest_menus[] = array($slug => array('ID' => $locations[$slug], 'label' => $label, 'meta' => array('links' => array('collection' => $rest_url, 'self' => $rest_url . '/' . $slug)), 'tree' => $this->get_menu_tree($slug)));
         }
     }
     return $rest_menus;
 }
Example #23
0
 /**
  * validation form fields
  * @param $values
  * @return mixed
  */
 public function validation_tab_filter($values)
 {
     $locations = get_registered_nav_menus();
     foreach ($values as $field => $menu) {
         foreach (array_keys($locations) as $location) {
             if ($this->real_field_name($field) == HW_Validation::valid_apf_slug($location)) {
                 HW_NAVMENU::set_menu_location($location, $menu);
                 break;
             }
         }
     }
     return $values;
 }
    /**
     * Render the control to be displayed in the Customizer.
     */
    public function render_content()
    {
        $all_menu_locations = get_registered_nav_menus();
        ?>

    <label>
      <?php 
        if (!empty($this->label)) {
            ?>
        <span class="customize-control-title"><?php 
            echo esc_html($this->label);
            ?>
</span>
      <?php 
        }
        if (!empty($this->description)) {
            ?>
        <span class="description customize-control-description"><?php 
            echo $this->description;
            ?>
</span>
      <?php 
        }
        ?>
      <select <?php 
        echo $this->link();
        ?>
>
         <?php 
        printf('<option value="%s" %s>%s</option>', '', selected($this->value(), '', false), ' ');
        ?>
         <?php 
        if (!empty($all_menu_locations)) {
            ?>
           <?php 
            foreach ($all_menu_locations as $key => $location) {
                ?>
             <?php 
                printf('<option value="%s" %s>%s</option>', esc_attr($key), selected($this->value(), $key, false), esc_html($location));
                ?>
           <?php 
            }
            ?>
        <?php 
        }
        ?>
      </select>
    </label>

    <?php 
    }
/**
 * function for theme location settings.
 *
 * @since 1.0.0
 * @package GeoDirectory
 */
function geodir_theme_location_setting_fun()
{
    $post_type_arr = array();
    $geodir_all_nav_locations = get_registered_nav_menus();
    $geodir_active_nav_locations = get_nav_menu_locations();
    if (!empty($geodir_active_nav_locations) && is_array($geodir_active_nav_locations)) {
        foreach ($geodir_active_nav_locations as $key => $theme_location) {
            if (!empty($geodir_all_nav_locations) && is_array($geodir_all_nav_locations) && array_key_exists($key, $geodir_all_nav_locations)) {
                $post_type_arr[$key] = $geodir_all_nav_locations[$key];
            }
        }
    }
    return $post_type_arr;
}
Example #26
0
 function options()
 {
     $locs = get_registered_nav_menus();
     $loc_choices = array();
     $loc_choices[] = array('label' => __('Choose Navigation', 'live-composer-page-builder'), 'value' => 'not_set');
     if (!empty($locs)) {
         foreach ($locs as $loc_ID => $loc_label) {
             $loc_choices[] = array('label' => $loc_label, 'value' => $loc_ID);
         }
     }
     $dslc_options = array(array('label' => __('Show On', 'live-composer-page-builder'), 'id' => 'css_show_on', 'std' => 'desktop tablet phone', 'type' => 'checkbox', 'choices' => array(array('label' => __('Desktop', 'live-composer-page-builder'), 'value' => 'desktop'), array('label' => __('Tablet', 'live-composer-page-builder'), 'value' => 'tablet'), array('label' => __('Phone', 'live-composer-page-builder'), 'value' => 'phone'))), array('label' => __('Navigation', 'live-composer-page-builder'), 'id' => 'location', 'std' => 'not_set', 'type' => 'select', 'choices' => $loc_choices, 'help' => __('The locations from the theme will be shown here but you can register your own in <br>WP Admin > Live Composer > Navigation.', 'live-composer-page-builder')), array('label' => __('Align', 'live-composer-page-builder'), 'id' => 'css_main_align', 'std' => 'right', 'type' => 'text_align', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation', 'affect_on_change_rule' => 'text-align', 'section' => 'styling'), array('label' => __('BG Color', 'live-composer-page-builder'), 'id' => 'css_main_bg_color', 'std' => '', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation-inner', 'affect_on_change_rule' => 'background-color', 'section' => 'styling'), array('label' => __('BG Image', 'live-composer-page-builder'), 'id' => 'css_main_bg_img', 'std' => '', 'type' => 'image', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation-inner', 'affect_on_change_rule' => 'background-image', 'section' => 'styling'), array('label' => __('BG Image Repeat', 'live-composer-page-builder'), 'id' => 'css_main_bg_img_repeat', 'std' => 'repeat', 'type' => 'select', 'choices' => array(array('label' => __('Repeat', 'live-composer-page-builder'), 'value' => 'repeat'), array('label' => __('Repeat Horizontal', 'live-composer-page-builder'), 'value' => 'repeat-x'), array('label' => __('Repeat Vertical', 'live-composer-page-builder'), 'value' => 'repeat-y'), array('label' => __('Do NOT Repeat', 'live-composer-page-builder'), 'value' => 'no-repeat')), 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation-inner', 'affect_on_change_rule' => 'background-repeat', 'section' => 'styling'), array('label' => __('BG Image Attachment', 'live-composer-page-builder'), 'id' => 'css_main_bg_img_attch', 'std' => 'scroll', 'type' => 'select', 'choices' => array(array('label' => __('Scroll', 'live-composer-page-builder'), 'value' => 'scroll'), array('label' => __('Fixed', 'live-composer-page-builder'), 'value' => 'fixed')), 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation-inner', 'affect_on_change_rule' => 'background-attachment', 'section' => 'styling'), array('label' => __('BG Image Position', 'live-composer-page-builder'), 'id' => 'css_main_bg_img_pos', 'std' => 'top left', 'type' => 'select', 'choices' => array(array('label' => __('Top Left', 'live-composer-page-builder'), 'value' => 'left top'), array('label' => __('Top Right', 'live-composer-page-builder'), 'value' => 'right top'), array('label' => __('Top Center', 'live-composer-page-builder'), 'value' => 'Center Top'), array('label' => __('Center Left', 'live-composer-page-builder'), 'value' => 'left center'), array('label' => __('Center Right', 'live-composer-page-builder'), 'value' => 'right center'), array('label' => __('Center', 'live-composer-page-builder'), 'value' => 'center center'), array('label' => __('Bottom Left', 'live-composer-page-builder'), 'value' => 'left bottom'), array('label' => __('Bottom Right', 'live-composer-page-builder'), 'value' => 'right bottom'), array('label' => __('Bottom Center', 'live-composer-page-builder'), 'value' => 'center bottom')), 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation-inner', 'affect_on_change_rule' => 'background-position', 'section' => 'styling'), array('label' => __('Border Color', 'live-composer-page-builder'), 'id' => 'css_main_border_color', 'std' => '', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation-inner', 'affect_on_change_rule' => 'border-color', 'section' => 'styling'), array('label' => __('Border Width', 'live-composer-page-builder'), 'id' => 'css_main_border_width', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation-inner', 'affect_on_change_rule' => 'border-width', 'section' => 'styling', 'ext' => 'px'), array('label' => __('Borders', 'live-composer-page-builder'), 'id' => 'css_main_border_trbl', 'std' => 'top right bottom left', 'type' => 'checkbox', 'choices' => array(array('label' => __('Top', 'live-composer-page-builder'), 'value' => 'top'), array('label' => __('Right', 'live-composer-page-builder'), 'value' => 'right'), array('label' => __('Bottom', 'live-composer-page-builder'), 'value' => 'bottom'), array('label' => __('Left', 'live-composer-page-builder'), 'value' => 'left')), 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation-inner', 'affect_on_change_rule' => 'border-style', 'section' => 'styling'), array('label' => __('Border Radius - Top', 'live-composer-page-builder'), 'id' => 'css_main_border_radius_top', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation-inner', 'affect_on_change_rule' => 'border-top-left-radius,border-top-right-radius', 'section' => 'styling', 'ext' => 'px'), array('label' => __('Border Radius - Bottom', 'live-composer-page-builder'), 'id' => 'css_main_border_radius_bottom', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation-inner', 'affect_on_change_rule' => 'border-bottom-left-radius,border-bottom-right-radius', 'section' => 'styling', 'ext' => 'px'), array('label' => __('Margin Bottom', 'live-composer-page-builder'), 'id' => 'css_margin_bottom', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation-inner', 'affect_on_change_rule' => 'margin-bottom', 'section' => 'styling', 'ext' => 'px'), array('label' => __('Minimum Height', 'live-composer-page-builder'), 'id' => 'css_min_height', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation-inner', 'affect_on_change_rule' => 'min-height', 'section' => 'styling', 'ext' => 'px', 'min' => 0, 'max' => 1000, 'increment' => 5), array('label' => __('Orientation', 'live-composer-page-builder'), 'id' => 'nav_orientation', 'std' => 'horizontal', 'type' => 'select', 'choices' => array(array('label' => __('Horizontal', 'live-composer-page-builder'), 'value' => 'horizontal'), array('label' => __('Vertical', 'live-composer-page-builder'), 'value' => 'vertical')), 'section' => 'styling'), array('label' => __('Padding Vertical', 'live-composer-page-builder'), 'id' => 'css_main_padding_vertical', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation-inner', 'affect_on_change_rule' => 'padding-top,padding-bottom', 'section' => 'styling', 'ext' => 'px'), array('label' => __('Padding Horizontal', 'live-composer-page-builder'), 'id' => 'css_main_padding_horizontal', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation-inner', 'affect_on_change_rule' => 'padding-left,padding-right', 'section' => 'styling', 'ext' => 'px'), array('label' => __('BG Color', 'live-composer-page-builder'), 'id' => 'css_item_bg_color', 'std' => '', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu > li > a', 'affect_on_change_rule' => 'background-color', 'section' => 'styling', 'tab' => __('item', 'live-composer-page-builder')), array('label' => __('BG Color - Hover', 'live-composer-page-builder'), 'id' => 'css_item_bg_color_hover', 'std' => '', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu > li > a:hover', 'affect_on_change_rule' => 'background-color', 'section' => 'styling', 'tab' => __('item', 'live-composer-page-builder')), array('label' => __('BG Color - Active', 'live-composer-page-builder'), 'id' => 'css_item_bg_color_active', 'std' => '', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu > li.current-menu-item > a', 'affect_on_change_rule' => 'background-color', 'section' => 'styling', 'tab' => __('item', 'live-composer-page-builder')), array('label' => __('Border Color', 'live-composer-page-builder'), 'id' => 'css_item_border_color', 'std' => '', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu > li > a', 'affect_on_change_rule' => 'border-color', 'section' => 'styling', 'tab' => __('item', 'live-composer-page-builder')), array('label' => __('Border Color - Hover', 'live-composer-page-builder'), 'id' => 'css_item_border_color_hover', 'std' => '', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu > li > a:hover', 'affect_on_change_rule' => 'border-color', 'section' => 'styling', 'tab' => __('item', 'live-composer-page-builder')), array('label' => __('Border Color - Active', 'live-composer-page-builder'), 'id' => 'css_item_border_color_active', 'std' => '', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu > li.current-menu-item > a', 'affect_on_change_rule' => 'border-color', 'section' => 'styling', 'tab' => __('item', 'live-composer-page-builder')), array('label' => __('Border Width', 'live-composer-page-builder'), 'id' => 'css_item_border_width', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu > li > a', 'affect_on_change_rule' => 'border-width', 'section' => 'styling', 'ext' => 'px', 'tab' => __('item', 'live-composer-page-builder')), array('label' => __('Borders', 'live-composer-page-builder'), 'id' => 'css_item_border_trbl', 'std' => 'top right bottom left', 'type' => 'checkbox', 'choices' => array(array('label' => __('Top', 'live-composer-page-builder'), 'value' => 'top'), array('label' => __('Right', 'live-composer-page-builder'), 'value' => 'right'), array('label' => __('Bottom', 'live-composer-page-builder'), 'value' => 'bottom'), array('label' => __('Left', 'live-composer-page-builder'), 'value' => 'left')), 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu > li > a', 'affect_on_change_rule' => 'border-style', 'section' => 'styling', 'tab' => __('item', 'live-composer-page-builder')), array('label' => __('Border Radius - Top', 'live-composer-page-builder'), 'id' => 'css_item_border_radius_top', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu > li > a', 'affect_on_change_rule' => 'border-top-left-radius,border-top-right-radius', 'section' => 'styling', 'ext' => 'px', 'tab' => __('item', 'live-composer-page-builder')), array('label' => __('Border Radius - Bottom', 'live-composer-page-builder'), 'id' => 'css_item_border_radius_bottom', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu > li > a', 'affect_on_change_rule' => 'border-bottom-left-radius,border-bottom-right-radius', 'section' => 'styling', 'ext' => 'px', 'tab' => __('item', 'live-composer-page-builder')), array('label' => __('Color', 'live-composer-page-builder'), 'id' => 'css_item_color', 'std' => '#555555', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu > li > a', 'affect_on_change_rule' => 'color', 'section' => 'styling', 'tab' => __('item', 'live-composer-page-builder')), array('label' => __('Color - Hover', 'live-composer-page-builder'), 'id' => 'css_item_color_hover', 'std' => '#fd4970', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu > li > a:hover', 'affect_on_change_rule' => 'color', 'section' => 'styling', 'tab' => __('item', 'live-composer-page-builder')), array('label' => __('Color - Active', 'live-composer-page-builder'), 'id' => 'css_item_color_active', 'std' => '#fd4970', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu > li.current-menu-item > a', 'affect_on_change_rule' => 'color', 'section' => 'styling', 'tab' => __('item', 'live-composer-page-builder')), array('label' => __('Font Size', 'live-composer-page-builder'), 'id' => 'css_item_font_size', 'std' => '14', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu > li > a', 'affect_on_change_rule' => 'font-size', 'section' => 'styling', 'tab' => __('item', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Font Weight', 'live-composer-page-builder'), 'id' => 'css_item_font_weight', 'std' => '700', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu > li > a', 'affect_on_change_rule' => 'font-weight', 'section' => 'styling', 'tab' => __('item', 'live-composer-page-builder'), 'ext' => '', 'min' => 100, 'max' => 900, 'increment' => 100), array('label' => __('Font Family', 'live-composer-page-builder'), 'id' => 'css_item_font_family', 'std' => 'Montserrat', 'type' => 'font', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu > li > a', 'affect_on_change_rule' => 'font-family', 'section' => 'styling', 'tab' => __('item', 'live-composer-page-builder')), array('label' => __('Letter Spacing', 'live-composer-page-builder'), 'id' => 'css_item_letter_spacing', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu > li > a', 'affect_on_change_rule' => 'letter-spacing', 'section' => 'styling', 'tab' => __('item', 'live-composer-page-builder'), 'ext' => 'px', 'min' => -50, 'max' => 50), array('label' => __('Line Height', 'live-composer-page-builder'), 'id' => 'css_item_line_height', 'std' => '22', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu > li > a', 'affect_on_change_rule' => 'line-height', 'section' => 'styling', 'tab' => __('item', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Padding Vertical', 'live-composer-page-builder'), 'id' => 'css_item_padding_vertical', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu > li > a', 'affect_on_change_rule' => 'padding-top,padding-bottom', 'section' => 'styling', 'ext' => 'px', 'tab' => __('item', 'live-composer-page-builder')), array('label' => __('Padding Horizontal', 'live-composer-page-builder'), 'id' => 'css_item_padding_horizontal', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu > li > a', 'affect_on_change_rule' => 'padding-left,padding-right', 'section' => 'styling', 'ext' => 'px', 'tab' => __('item', 'live-composer-page-builder')), array('label' => __('Text Transform', 'live-composer-page-builder'), 'id' => 'css_item_text_transform', 'std' => 'none', 'type' => 'select', 'choices' => array(array('label' => __('None', 'live-composer-page-builder'), 'value' => 'none'), array('label' => __('Capitalize', 'live-composer-page-builder'), 'value' => 'capitalize'), array('label' => __('Uppercase', 'live-composer-page-builder'), 'value' => 'uppercase'), array('label' => __('Lowercase', 'live-composer-page-builder'), 'value' => 'lowercase')), 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu > li > a', 'affect_on_change_rule' => 'text-transform', 'section' => 'styling', 'tab' => __('item', 'live-composer-page-builder')), array('label' => __('Spacing', 'live-composer-page-builder'), 'id' => 'css_item_spacing', 'std' => '40', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu > li', 'affect_on_change_rule' => 'margin-left,margin-top', 'section' => 'styling', 'ext' => 'px', 'tab' => __('item', 'live-composer-page-builder')), array('label' => __('Chevron - Enable/Disable', 'live-composer-page-builder'), 'id' => 'css_item_chevron_display', 'std' => 'none', 'type' => 'select', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation-arrow', 'affect_on_change_rule' => 'display', 'section' => 'styling', 'tab' => __('item', 'live-composer-page-builder'), 'choices' => array(array('label' => __('Enabled', 'live-composer-page-builder'), 'value' => 'inline-block'), array('label' => __('Disabled', 'live-composer-page-builder'), 'value' => 'none'))), array('label' => __('Chevron - Color', 'live-composer-page-builder'), 'id' => 'css_item_chevron_color', 'std' => '#555555', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation-arrow', 'affect_on_change_rule' => 'color', 'section' => 'styling', 'tab' => __('item', 'live-composer-page-builder')), array('label' => __('Chevron - Size', 'live-composer-page-builder'), 'id' => 'css_item_chevron_size', 'std' => '10', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation-arrow', 'affect_on_change_rule' => 'font-size', 'section' => 'styling', 'tab' => __('item', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Chevron - Spacing', 'live-composer-page-builder'), 'id' => 'css_item_chevron_spacing', 'std' => '10', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation-arrow', 'affect_on_change_rule' => 'margin-left', 'section' => 'styling', 'tab' => __('item', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Align', 'live-composer-page-builder'), 'id' => 'css_subnav_align', 'std' => 'left', 'type' => 'text_align', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul', 'affect_on_change_rule' => 'text-align', 'section' => 'styling', 'tab' => __('subnav', 'live-composer-page-builder')), array('label' => __('BG Color', 'live-composer-page-builder'), 'id' => 'css_subnav_bg_color', 'std' => '#fff', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul', 'affect_on_change_rule' => 'background-color', 'section' => 'styling', 'tab' => __('subnav', 'live-composer-page-builder')), array('label' => __('BG Image', 'live-composer-page-builder'), 'id' => 'css_subnav_bg_img', 'std' => '', 'type' => 'image', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul', 'affect_on_change_rule' => 'background-image', 'section' => 'styling', 'tab' => __('subnav', 'live-composer-page-builder')), array('label' => __('BG Image Repeat', 'live-composer-page-builder'), 'id' => 'css_subnav_bg_img_repeat', 'std' => 'repeat', 'type' => 'select', 'choices' => array(array('label' => __('Repeat', 'live-composer-page-builder'), 'value' => 'repeat'), array('label' => __('Repeat Horizontal', 'live-composer-page-builder'), 'value' => 'repeat-x'), array('label' => __('Repeat Vertical', 'live-composer-page-builder'), 'value' => 'repeat-y'), array('label' => __('Do NOT Repeat', 'live-composer-page-builder'), 'value' => 'no-repeat')), 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul', 'affect_on_change_rule' => 'background-repeat', 'section' => 'styling', 'tab' => __('subnav', 'live-composer-page-builder')), array('label' => __('BG Image Attachment', 'live-composer-page-builder'), 'id' => 'css_subnav_bg_img_attch', 'std' => 'scroll', 'type' => 'select', 'choices' => array(array('label' => __('Scroll', 'live-composer-page-builder'), 'value' => 'scroll'), array('label' => __('Fixed', 'live-composer-page-builder'), 'value' => 'fixed')), 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul', 'affect_on_change_rule' => 'background-attachment', 'section' => 'styling', 'tab' => __('subnav', 'live-composer-page-builder')), array('label' => __('BG Image Position', 'live-composer-page-builder'), 'id' => 'css_subnav_bg_img_pos', 'std' => 'top left', 'type' => 'select', 'choices' => array(array('label' => __('Top Left', 'live-composer-page-builder'), 'value' => 'left top'), array('label' => __('Top Right', 'live-composer-page-builder'), 'value' => 'right top'), array('label' => __('Top Center', 'live-composer-page-builder'), 'value' => 'Center Top'), array('label' => __('Center Left', 'live-composer-page-builder'), 'value' => 'left center'), array('label' => __('Center Right', 'live-composer-page-builder'), 'value' => 'right center'), array('label' => __('Center', 'live-composer-page-builder'), 'value' => 'center center'), array('label' => __('Bottom Left', 'live-composer-page-builder'), 'value' => 'left bottom'), array('label' => __('Bottom Right', 'live-composer-page-builder'), 'value' => 'right bottom'), array('label' => __('Bottom Center', 'live-composer-page-builder'), 'value' => 'center bottom')), 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul', 'affect_on_change_rule' => 'background-position', 'section' => 'styling', 'tab' => __('subnav', 'live-composer-page-builder')), array('label' => __('Border Color', 'live-composer-page-builder'), 'id' => 'css_subnav_border_color', 'std' => '#ededed', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul', 'affect_on_change_rule' => 'border-color', 'section' => 'styling', 'tab' => __('subnav', 'live-composer-page-builder')), array('label' => __('Border Width', 'live-composer-page-builder'), 'id' => 'css_subnav_border_width', 'std' => '1', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul', 'affect_on_change_rule' => 'border-width', 'section' => 'styling', 'ext' => 'px', 'tab' => __('subnav', 'live-composer-page-builder')), array('label' => __('Borders', 'live-composer-page-builder'), 'id' => 'css_subnav_border_trbl', 'std' => 'top right bottom left', 'type' => 'checkbox', 'choices' => array(array('label' => __('Top', 'live-composer-page-builder'), 'value' => 'top'), array('label' => __('Right', 'live-composer-page-builder'), 'value' => 'right'), array('label' => __('Bottom', 'live-composer-page-builder'), 'value' => 'bottom'), array('label' => __('Left', 'live-composer-page-builder'), 'value' => 'left')), 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul', 'affect_on_change_rule' => 'border-style', 'section' => 'styling', 'tab' => __('subnav', 'live-composer-page-builder')), array('label' => __('Border Radius - Top', 'live-composer-page-builder'), 'id' => 'css_subnav_border_radius_top', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul', 'affect_on_change_rule' => 'border-top-left-radius,border-top-right-radius', 'section' => 'styling', 'ext' => 'px', 'tab' => __('subnav', 'live-composer-page-builder')), array('label' => __('Border Radius - Bottom', 'live-composer-page-builder'), 'id' => 'css_subnav_border_radius_bottom', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul', 'affect_on_change_rule' => 'border-bottom-left-radius,border-bottom-right-radius', 'section' => 'styling', 'ext' => 'px', 'tab' => __('subnav', 'live-composer-page-builder')), array('label' => __('Padding Vertical', 'live-composer-page-builder'), 'id' => 'css_subnav_padding_vertical', 'std' => '10', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul', 'affect_on_change_rule' => 'padding-top,padding-bottom', 'section' => 'styling', 'ext' => 'px', 'tab' => __('subnav', 'live-composer-page-builder')), array('label' => __('Padding Horizontal', 'live-composer-page-builder'), 'id' => 'css_subnav_padding_horizontal', 'std' => '25', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul', 'affect_on_change_rule' => 'padding-left,padding-right', 'section' => 'styling', 'ext' => 'px', 'tab' => __('subnav', 'live-composer-page-builder')), array('label' => __('BG Color', 'live-composer-page-builder'), 'id' => 'css_subnav_item_bg_color', 'std' => '', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul li a', 'affect_on_change_rule' => 'background-color', 'section' => 'styling', 'tab' => __('subnav item', 'live-composer-page-builder')), array('label' => __('BG Color - Hover', 'live-composer-page-builder'), 'id' => 'css_subnav_item_bg_color_hover', 'std' => '', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul li a:hover', 'affect_on_change_rule' => 'background-color', 'section' => 'styling', 'tab' => __('subnav item', 'live-composer-page-builder')), array('label' => __('BG Color - Active', 'live-composer-page-builder'), 'id' => 'css_subnav_item_bg_color_active', 'std' => '', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul li.current-menu-item > a', 'affect_on_change_rule' => 'background-color', 'section' => 'styling', 'tab' => __('subnav item', 'live-composer-page-builder')), array('label' => __('Border Color', 'live-composer-page-builder'), 'id' => 'css_subnav_item_border_color', 'std' => '#ededed', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul li a', 'affect_on_change_rule' => 'border-color', 'section' => 'styling', 'tab' => __('subnav item', 'live-composer-page-builder')), array('label' => __('Border Color - Hover', 'live-composer-page-builder'), 'id' => 'css_subnav_item_border_color_hover', 'std' => '#ededed', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul li > a:hover', 'affect_on_change_rule' => 'border-color', 'section' => 'styling', 'tab' => __('subnav item', 'live-composer-page-builder')), array('label' => __('Border Color - Active', 'live-composer-page-builder'), 'id' => 'css_subnav_item_border_color_active', 'std' => '#ededed', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul li.current-menu-item > a', 'affect_on_change_rule' => 'border-color', 'section' => 'styling', 'tab' => __('subnav item', 'live-composer-page-builder')), array('label' => __('Border Width', 'live-composer-page-builder'), 'id' => 'css_subnav_item_border_width', 'std' => '1', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul li a', 'affect_on_change_rule' => 'border-width', 'section' => 'styling', 'ext' => 'px', 'tab' => __('subnav item', 'live-composer-page-builder')), array('label' => __('Borders', 'live-composer-page-builder'), 'id' => 'css_subnav_item_border_trbl', 'std' => 'bottom', 'type' => 'checkbox', 'choices' => array(array('label' => __('Top', 'live-composer-page-builder'), 'value' => 'top'), array('label' => __('Right', 'live-composer-page-builder'), 'value' => 'right'), array('label' => __('Bottom', 'live-composer-page-builder'), 'value' => 'bottom'), array('label' => __('Left', 'live-composer-page-builder'), 'value' => 'left')), 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul li a', 'affect_on_change_rule' => 'border-style', 'section' => 'styling', 'tab' => __('subnav item', 'live-composer-page-builder')), array('label' => __('Border Radius - Top', 'live-composer-page-builder'), 'id' => 'css_subnav_item_border_radius_top', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul li a', 'affect_on_change_rule' => 'border-top-left-radius,border-top-right-radius', 'section' => 'styling', 'ext' => 'px', 'tab' => __('subnav item', 'live-composer-page-builder')), array('label' => __('Border Radius - Bottom', 'live-composer-page-builder'), 'id' => 'css_subnav_item_border_radius_bottom', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul li a', 'affect_on_change_rule' => 'border-bottom-left-radius,border-bottom-right-radius', 'section' => 'styling', 'ext' => 'px', 'tab' => __('subnav item', 'live-composer-page-builder')), array('label' => __('Color', 'live-composer-page-builder'), 'id' => 'css_subnav_item_color', 'std' => '#555555', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul li a', 'affect_on_change_rule' => 'color', 'section' => 'styling', 'tab' => __('subnav item', 'live-composer-page-builder')), array('label' => __('Color - Hover', 'live-composer-page-builder'), 'id' => 'css_subnav_item_color_hover', 'std' => '#fd4970', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul li a:hover', 'affect_on_change_rule' => 'color', 'section' => 'styling', 'tab' => __('subnav item', 'live-composer-page-builder')), array('label' => __('Color - Active', 'live-composer-page-builder'), 'id' => 'css_subnav_item_color_active', 'std' => '#fd4970', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul li.current-menu-item > a', 'affect_on_change_rule' => 'color', 'section' => 'styling', 'tab' => __('subnav item', 'live-composer-page-builder')), array('label' => __('Font Size', 'live-composer-page-builder'), 'id' => 'css_subnav_item_font_size', 'std' => '13', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul li a', 'affect_on_change_rule' => 'font-size', 'section' => 'styling', 'tab' => __('subnav item', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Font Weight', 'live-composer-page-builder'), 'id' => 'css_subnav_item_font_weight', 'std' => '700', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul li a', 'affect_on_change_rule' => 'font-weight', 'section' => 'styling', 'tab' => __('subnav item', 'live-composer-page-builder'), 'ext' => '', 'min' => 100, 'max' => 900, 'increment' => 100), array('label' => __('Font Family', 'live-composer-page-builder'), 'id' => 'css_subnav_item_font_family', 'std' => 'Montserrat', 'type' => 'font', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul li a', 'affect_on_change_rule' => 'font-family', 'section' => 'styling', 'tab' => __('subnav item', 'live-composer-page-builder')), array('label' => __('Letter Spacing', 'live-composer-page-builder'), 'id' => 'css_subnav_item_letter_spacing', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul li a', 'affect_on_change_rule' => 'letter-spacing', 'section' => 'styling', 'tab' => __('subnav item', 'live-composer-page-builder'), 'ext' => 'px', 'min' => -50, 'max' => 50), array('label' => __('Line Height', 'live-composer-page-builder'), 'id' => 'css_subnav_item_line_height', 'std' => '13', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul li a', 'affect_on_change_rule' => 'line-height', 'section' => 'styling', 'tab' => __('subnav item', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Padding Vertical', 'live-composer-page-builder'), 'id' => 'css_subnav_item_padding_vertical', 'std' => '17', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul li a', 'affect_on_change_rule' => 'padding-top,padding-bottom', 'section' => 'styling', 'ext' => 'px', 'tab' => __('subnav item', 'live-composer-page-builder')), array('label' => __('Padding Horizontal', 'live-composer-page-builder'), 'id' => 'css_subnav_item_padding_horizontal', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul li a', 'affect_on_change_rule' => 'padding-left,padding-right', 'section' => 'styling', 'ext' => 'px', 'tab' => __('subnav item', 'live-composer-page-builder')), array('label' => __('Text Transform', 'live-composer-page-builder'), 'id' => 'css_subnav_item_text_transform', 'std' => 'none', 'type' => 'select', 'choices' => array(array('label' => __('None', 'live-composer-page-builder'), 'value' => 'none'), array('label' => __('Capitalize', 'live-composer-page-builder'), 'value' => 'capitalize'), array('label' => __('Uppercase', 'live-composer-page-builder'), 'value' => 'uppercase'), array('label' => __('Lowercase', 'live-composer-page-builder'), 'value' => 'lowercase')), 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-navigation .menu ul li a', 'affect_on_change_rule' => 'text-transform', 'section' => 'styling', 'tab' => __('subnav item', 'live-composer-page-builder')), array('label' => __('Responsive Styling', 'live-composer-page-builder'), 'id' => 'css_res_t', 'std' => 'disabled', 'type' => 'select', 'choices' => array(array('label' => __('Disabled', 'live-composer-page-builder'), 'value' => 'disabled'), array('label' => __('Enabled', 'live-composer-page-builder'), 'value' => 'enabled')), 'section' => 'responsive', 'tab' => __('tablet', 'live-composer-page-builder')), array('label' => __('Align', 'live-composer-page-builder'), 'id' => 'css_res_t_align', 'std' => 'right', 'type' => 'text_align', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-mobile-navigation', 'affect_on_change_rule' => 'text-align', 'section' => 'responsive', 'tab' => __('tablet', 'live-composer-page-builder')), array('label' => __('Color', 'live-composer-page-builder'), 'id' => 'css_res_t_color', 'std' => '#555', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-mobile-navigation-hook', 'affect_on_change_rule' => 'color', 'section' => 'responsive', 'tab' => __('tablet', 'live-composer-page-builder')), array('label' => __('Margin Top', 'live-composer-page-builder'), 'id' => 'css_res_t_margin_top', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-mobile-navigation', 'affect_on_change_rule' => 'margin-top', 'section' => 'responsive', 'tab' => __('tablet', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Size', 'live-composer-page-builder'), 'id' => 'css_res_t_size', 'std' => '24', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-mobile-navigation-hook', 'affect_on_change_rule' => 'font-size, line-height', 'section' => 'responsive', 'tab' => __('tablet', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Responsive Styling', 'live-composer-page-builder'), 'id' => 'css_res_p', 'std' => 'disabled', 'type' => 'select', 'choices' => array(array('label' => __('Disabled', 'live-composer-page-builder'), 'value' => 'disabled'), array('label' => __('Enabled', 'live-composer-page-builder'), 'value' => 'enabled')), 'section' => 'responsive', 'tab' => __('phone', 'live-composer-page-builder')), array('label' => __('Align', 'live-composer-page-builder'), 'id' => 'css_res_p_align', 'std' => 'right', 'type' => 'text_align', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-mobile-navigation', 'affect_on_change_rule' => 'text-align', 'section' => 'responsive', 'tab' => __('phone', 'live-composer-page-builder')), array('label' => __('Color', 'live-composer-page-builder'), 'id' => 'css_res_p_color', 'std' => '#555', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-mobile-navigation-hook', 'affect_on_change_rule' => 'color', 'section' => 'responsive', 'tab' => __('phone', 'live-composer-page-builder')), array('label' => __('Margin Top', 'live-composer-page-builder'), 'id' => 'css_res_p_margin_top', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-mobile-navigation', 'affect_on_change_rule' => 'margin-top', 'section' => 'responsive', 'tab' => __('phone', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Size', 'live-composer-page-builder'), 'id' => 'css_res_p_size', 'std' => '24', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-mobile-navigation-hook', 'affect_on_change_rule' => 'font-size, line-height', 'section' => 'responsive', 'tab' => __('phone', 'live-composer-page-builder'), 'ext' => 'px'));
     $dslc_options = array_merge($dslc_options, $this->presets_options());
     return apply_filters('dslc_module_options', $dslc_options, $this->module_id);
 }
function create_nav_menu_location_table()
{
    global $wpdb;
    global $locations;
    $mytable_loc = $wpdb->prefix . "mylocation";
    if ($wpdb->get_var("show tables like '{$mytable_loc}'") != $mytable_loc) {
        $sql1 = "CREATE TABLE IF NOT EXISTS {$mytable_loc} (\n                id int(5) NOT NULL AUTO_INCREMENT,\n                menu_locations varchar(128) NOT NULL,\n                value int(5) NOT NULL DEFAULT '1',\n                created_date date NOT NULL,\n                modified_date date  NULL,\n                PRIMARY KEY (id)\n\t           ) COLLATE utf8_general_ci;";
        require_once ABSPATH . 'wp-admin/includes/upgrade.php';
        dbDelta($sql1);
        $locations = get_registered_nav_menus();
        foreach ($locations as $key => $location) {
            $wpdb->insert($mytable_loc, array('menu_locations' => $key, 'value' => '1', 'created_date' => current_time('mysql'), 'modified_date' => ''));
        }
    }
}
Example #28
0
function wheels_register_meta_boxes($meta_boxes)
{
    $meta_boxes = array();
    $prefix = 'wheels_';
    //	if ( wheels_is_page_template( 'page-home.php' ) ) {
    //
    //		// 1st meta box
    //		$meta_boxes[] = array(
    //			'id'       => 'personal',
    //			'title'    => 'Personal Information',
    //			'pages'    => array( 'post', 'page' ),
    //			'context'  => 'normal',
    //			'priority' => 'high',
    //			'fields'   => array(
    //				array(
    //					'name'  => 'Full name',
    //					'desc'  => 'Format: First Last',
    //					'id'    => $prefix . 'fname',
    //					'type'  => 'text',
    //					'std'   => 'Anh Tran',
    //					'class' => 'custom-class',
    //					'clone' => true,
    //				),
    //			)
    //		);
    //
    //	}
    // $meta_boxes[] = array(
    // 	'title'  => 'Course Custom Fields',
    // 	'pages'  => array( 'course' ), // can be used on multiple CPTs
    // 	'fields' => array(
    // 		array(
    // 			'id'   => $prefix . 'sidebar_text',
    // 			'type' => 'wysiwyg',
    // 			'name' => __( 'Sidebar Text', 'wheels' ),
    // 			'desc' => sprintf( __( 'Link to all lined icons available %s. Just copy the class name.', 'wheels' ), '<a target="_blank" href="' . get_template_directory_uri() . '/assets/iconsmind-doc/demo.html' . '" title="' . __( 'Iconsmind', 'wheels' ) . '">' . __( 'Iconsmind', 'wheels' ) . '</a>' ),
    // 		),
    // 	)
    // );
    $menus = get_registered_nav_menus();
    $menus_array = array();
    foreach ($menus as $location => $description) {
        $menus_array[$location] = $description;
    }
    $meta_boxes[] = array('title' => 'Page Settings', 'pages' => array('page'), 'fields' => array(array('id' => $prefix . 'use_one_page_menu', 'type' => 'checkbox', 'name' => __('Use One Page Menu', 'wheels'), 'desc' => __('When using one page menu functionality you need to add an extra class on each vc row you want to link to a menu item. Also you need to create a menu in Appearance/Menus and create custom links where each link url has the same name as the row class prefixed with # sign', 'wheels')), array('id' => $prefix . 'one_page_menu_location', 'type' => 'select', 'name' => __('Select One Page Menu Location', 'wheels'), 'desc' => __('Used only if Use One Page Menu is checked.', 'wheels'), 'options' => $menus_array, 'placeholder' => 'Select Menu Location')));
    return $meta_boxes;
}
function hippo_setup_imported_menus()
{
    $registared_menus = get_registered_nav_menus();
    $menu_locations = get_theme_mod('nav_menu_locations');
    foreach ($registared_menus as $location => $title) {
        $get_menus = wp_get_nav_menu_object($title);
        $menu_locations[$location] = $get_menus->term_id;
    }
    set_theme_mod('nav_menu_locations', $menu_locations);
    // Set Home Page
    $home = get_page_by_title('Home');
    update_option('page_on_front', $home->ID);
    // Set the blog page
    $blog = get_page_by_title('Blog');
    update_option('page_for_posts', $blog->ID);
    update_option('show_on_front', 'page');
}
 function render_field($args)
 {
     $all_menus = get_registered_nav_menus();
     if (!empty($all_menus)) {
         echo '<select name="' . $args['field_name'] . '" id="' . $args['field_id'] . '">';
         if (isset($args['field']['allow_null']) && true == $args['field']['allow_null']) {
             echo '<option value="">Select</option>';
         }
         foreach ($all_menus as $k => $m) {
             echo '<option value="' . esc_attr($k) . '" ';
             selected($k, $args['field_value'], true);
             echo '>' . esc_attr($m) . '</option>';
         }
         echo '</select>';
     } else {
         echo 'No nav menu registered';
     }
 }