• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP get_registered_nav_menus函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_registered_nav_menus函数的典型用法代码示例。如果您正苦于以下问题:PHP get_registered_nav_menus函数的具体用法?PHP get_registered_nav_menus怎么用?PHP get_registered_nav_menus使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_registered_nav_menus函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: automatic_add_sub_pages

 /**
  * 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'));
         }
     }
 }
开发者ID:romain-d,项目名称:menu-auto-add-subpages,代码行数:56,代码来源:admin.php


示例2: findMenu

 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;
 }
开发者ID:macconsultinggroup,项目名称:WordPress,代码行数:25,代码来源:custom-menu-images.php


示例3: ubermenu_integration_code_ui

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;
}
开发者ID:WackoMako,项目名称:stonedape,代码行数:35,代码来源:settings.pro.php


示例4: form

 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;
 }
开发者ID:ashanrupasinghe,项目名称:amc-car-from-server-2015-1-14,代码行数:34,代码来源:asidemenu.php


示例5: metaboxRaw

 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>';
 }
开发者ID:schiz,项目名称:scrollax,代码行数:28,代码来源:functions.php


示例6: __construct

 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);
 }
开发者ID:rinodung,项目名称:myfreetheme,代码行数:25,代码来源:row-options.php


示例7: has_menu

function has_menu($location)
{
    $menus = get_registered_nav_menus();
    if (isset($menus[$location])) {
        return true;
    }
}
开发者ID:AcademicTechnologyCenter,项目名称:ATC-Quality-Tracking,代码行数:7,代码来源:functions.php


示例8: mega_main_menu__array_theme_options

 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
 }
开发者ID:mazykin46,项目名称:portfolio,代码行数:31,代码来源:array_theme_options.php


示例9: campaign_register_metabox

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'));
}
开发者ID:plusplusminus,项目名称:isissoftware,代码行数:31,代码来源:functions.php


示例10: shiftnav_get_theme_location_ops

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_rel_item函数代码示例发布时间:2022-05-15
下一篇:
PHP get_registered_entity_types函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap