Ejemplo n.º 1
0
 /**
  * Initialize custom panel with its definitions
  * Custom panel definitions are located in admin/post-type-TYPE.php
  * @since 1.0.7
  */
 function themify_theme_init_types()
 {
     // Load required files for post, page and custom post types where it applies
     foreach (array('post', 'page', 'highlight', 'team', 'portfolio', 'section', 'timeline', 'testimonial') as $type) {
         require_once "admin/post-type-{$type}.php";
     }
     /**
      * Navigation menus used in page custom panel to specify a custom menu for the page.
      * @var array
      * @since 1.2.7
      */
     $nav_menus = array(array('name' => '', 'value' => '', 'selected' => true));
     foreach (get_terms('nav_menu') as $menu) {
         $nav_menus[] = array('name' => $menu->name, 'value' => $menu->slug);
     }
     themify_build_write_panels(apply_filters('themify_theme_meta_boxes', array(array('name' => __('Post Options', 'themify'), 'id' => 'post-options', 'options' => themify_theme_post_meta_box(), 'pages' => 'post'), array('name' => __('Page Options', 'themify'), 'id' => 'page-options', 'options' => themify_theme_page_meta_box(array('nav_menus' => $nav_menus)), 'pages' => 'page'), array("name" => __('Query Posts', 'themify'), 'id' => 'query-posts', "options" => themify_theme_query_post_meta_box(), "pages" => "page"), array("name" => __('Query Sections', 'themify'), 'id' => 'query-section', "options" => themify_theme_query_section_meta_box(), "pages" => "page"), array("name" => __('Query Portfolios', 'themify'), 'id' => 'query-portfolio', "options" => themify_theme_query_portfolio_meta_box(), "pages" => "page"), array('name' => __('Section Options', 'themify'), 'id' => 'section-options', 'options' => themify_theme_section_meta_box(), 'pages' => 'section'), array('name' => __('Portfolio Options', 'themify'), 'id' => 'portfolio-options', 'options' => themify_theme_portfolio_meta_box(), 'pages' => 'portfolio'), array('name' => __('Team Options', 'themify'), 'id' => 'team-options', 'options' => themify_theme_team_meta_box(), 'pages' => 'team'), array('name' => __('Highlight Options', 'themify'), 'id' => 'highlight-options', 'options' => themify_theme_highlight_meta_box(), 'pages' => 'highlight'), array('name' => __('Testimonial Options', 'themify'), 'id' => 'testimonial-options', 'options' => themify_theme_testimonial_meta_box(), 'pages' => 'testimonial'), array('name' => __('Timeline Options', 'themify'), 'id' => 'timeline-options', 'options' => themify_theme_timeline_meta_box(), 'pages' => 'timeline'))));
 }
 /**
  * Initialize custom panel with its definitions
  * Custom panel definitions are located in admin/post-type-TYPE.php
  * @since 1.0.0
  */
 function themify_theme_init_types()
 {
     // Load required files for post, page and custom post types where it applies
     foreach (array('post', 'page', 'portfolio') as $type) {
         require_once "admin/post-type-{$type}.php";
     }
     /**
      * Navigation menus used in page custom panel to specify a custom menu for the page.
      * @since 1.0.0
      * @var array
      */
     $nav_menus = array(array('name' => '', 'value' => '', 'selected' => true));
     foreach (get_terms('nav_menu') as $menu) {
         $nav_menus[] = array('name' => $menu->name, 'value' => $menu->slug);
     }
     /**
      * Options for header design
      * @since 1.0.0
      * @var array
      */
     $header_design_options = themify_theme_header_design_options();
     /**
      * Options for footer design
      * @since 1.0.0
      * @var array
      */
     $footer_design_options = themify_theme_footer_design_options();
     /**
      * Options for font design
      * @since 1.0.0
      * @var array
      */
     $font_design_options = themify_theme_font_design_options();
     /**
      * Options for color design
      * @since 1.0.0
      * @var array
      */
     $color_design_options = themify_theme_color_design_options();
     $entry_id = isset($_GET['post']) ? $_GET['post'] : null;
     $background_slider = false;
     if ($entry_id) {
         $background_slider = get_post_meta($entry_id, 'header_wrap', true) == '' && get_post_meta($entry_id, 'background_gallery', true) != '';
     }
     themify_build_write_panels(apply_filters('themify_theme_meta_boxes', array(array('name' => __('Post Options', 'themify'), 'id' => 'post-options', 'options' => themify_theme_post_meta_box(array('nav_menus' => $nav_menus)), 'pages' => 'post'), array('name' => __('Theme Appearance', 'themify'), 'id' => 'post-theme-design', 'options' => themify_theme_post_theme_design_meta_box(array('header_design_options' => $header_design_options, 'footer_design_options' => $footer_design_options, 'font_design_options' => $font_design_options, 'color_design_options' => $color_design_options, 'background_slider' => $background_slider)), 'pages' => 'post'), array('name' => __('Page Options', 'themify'), 'id' => 'page-options', 'options' => themify_theme_page_meta_box(array('nav_menus' => $nav_menus, 'header_design_options' => $header_design_options, 'footer_design_options' => $footer_design_options, 'font_design_options' => $font_design_options, 'color_design_options' => $color_design_options)), 'pages' => 'page'), array('name' => __('Theme Appearance', 'themify'), 'id' => 'page-theme-design', 'options' => themify_theme_page_theme_design_meta_box(array('header_design_options' => $header_design_options, 'footer_design_options' => $footer_design_options, 'font_design_options' => $font_design_options, 'color_design_options' => $color_design_options, 'background_slider' => $background_slider)), 'pages' => 'page'), array('name' => __('Portfolio Options', 'themify'), 'id' => 'portfolio-options', 'options' => themify_theme_portfolio_meta_box(array('nav_menus' => $nav_menus, 'header_design_options' => $header_design_options, 'footer_design_options' => $footer_design_options, 'font_design_options' => $font_design_options, 'color_design_options' => $color_design_options)), 'pages' => 'portfolio'), array('name' => __('Theme Appearance', 'themify'), 'id' => 'portfolio-theme-design', 'options' => themify_theme_portfolio_theme_design_meta_box(array('header_design_options' => $header_design_options, 'footer_design_options' => $footer_design_options, 'font_design_options' => $font_design_options, 'color_design_options' => $color_design_options, 'background_slider' => $background_slider)), 'pages' => 'portfolio'), array('name' => __('Query Posts', 'themify'), 'id' => 'query-posts', 'options' => themify_theme_query_post_meta_box(), 'pages' => 'page'), array('name' => __('Query Portfolios', 'themify'), 'id' => 'query-portfolio', 'options' => themify_theme_query_portfolio_meta_box(), 'pages' => 'page'))));
 }