コード例 #1
0
ファイル: page-init.php プロジェクト: rinodung/myfreetheme
 function register()
 {
     // Init Post Type
     $post = new SpyropressCustomPostType('Page');
     $menus = wp_get_nav_menus();
     $menu_options = array();
     if (isset($menus) && count($menus) > 0) {
         foreach ($menus as $menu) {
             $menu_options[$menu->term_id] = $menu->name;
         }
     }
     // Add Meta Boxes
     $meta_fields['options'] = array(array('label' => __('Slider', 'spyropress'), 'type' => 'heading', 'slug' => 'options'), array('label' => __('OnePage Navigation Menu', 'spyropress'), 'id' => 'onepage_menu', 'type' => 'select', 'class' => 'page_template one-page-php', 'options' => $menu_options), array('label' => __('Slider', 'spyropress'), 'type' => 'sub_heading'), array('label' => __('Slider Type', 'spyropress'), 'id' => 'slider', 'type' => 'select', 'class' => 'enable_changer', 'options' => array('nivo' => __('Nivo Slider', 'spyropress'), 'rev' => __('Revolution Slider', 'spyropress'))), array('label' => __('Nivo Slider', 'spyropress'), 'id' => 'nivo_slider', 'type' => 'select', 'class' => 'slider nivo', 'options' => spyropress_get_sliders()));
     if (class_exists('RevSlider')) {
         $slider = new RevSlider();
         $arrSliders = $slider->getArrSlidersShort();
         $meta_fields['options'][] = array('label' => __('Revolution Slider', 'spyropress'), 'id' => 'rev_slider', 'type' => 'select', 'class' => 'slider rev', 'options' => $arrSliders);
         $meta_fields['options'][] = array('label' => __('Revolution Slider Skin', 'spyropress'), 'id' => 'rev_slider_skin', 'type' => 'select', 'class' => 'slider rev', 'options' => array('dark' => __('Dark', 'spyropress'), 'light' => __('Light', 'spyropress'), 'full' => __('FullScreen', 'spyropress'), 'dark dark-video' => __('Video - Dark', 'spyropress'), 'light dark-light' => __('Video - Light', 'spyropress')), 'std' => 'dark');
     }
     $meta_fields['options'][] = array('label' => __('Header', 'spyropress'), 'type' => 'sub_heading');
     $meta_fields['options'][] = array('label' => __('Header Type', 'spyropress'), 'id' => 'top_header', 'type' => 'select', 'class' => 'enable_changer', 'options' => array('none' => __('None', 'spyropress'), 'default' => __('Default', 'spyropress'), 'custom' => __('Custom Header', 'spyropress')), 'std' => 'default');
     $meta_fields['options'][] = array('label' => __('Custom Header Bucket', 'spyropress'), 'id' => 'bucket', 'type' => 'select', 'class' => 'top_header custom', 'desc' => __('Either use Bucket or Content', 'spyropress'), 'options' => spyropress_get_buckets());
     $meta_fields['options'][] = array('label' => __('Custom Header Content', 'spyropress'), 'id' => 'header_content', 'type' => 'editor', 'desc' => __('Either use Bucket or Content', 'spyropress'), 'class' => 'top_header custom');
     $meta_fields['options'][] = array('label' => __('Custom Header Background', 'spyropress'), 'id' => 'background', 'type' => 'background', 'class' => 'top_header custom');
     $meta_fields['options'][] = array('label' => __('Top Border color', 'spyropress'), 'id' => 'border_top', 'type' => 'colorpicker', 'class' => 'top_header custom');
     $meta_fields['options'][] = array('label' => __('Bottom Border color', 'spyropress'), 'id' => 'border_bottom', 'type' => 'colorpicker', 'class' => 'top_header custom');
     $meta_fields['options'][] = array('label' => __('Layout', 'spyropress'), 'type' => 'sub_heading');
     $meta_fields['options'][] = array('label' => __('Layout Type', 'spyropress'), 'id' => 'layout_type', 'type' => 'select', 'options' => array('full' => __('Full Width', 'spyropress'), 'left' => __('Left Sidebar', 'spyropress'), 'right' => __('Right Sidebar', 'spyropress')), 'std' => 'full');
     $post->add_meta_box('page_options', __('Page Options', 'spyropress'), $meta_fields, '_page_options', false, 'normal', 'high');
 }
コード例 #2
0
ファイル: slider-init.php プロジェクト: rinodung/myfreetheme
 /**
  * Register Post Type and Add Meta Boxes
  */
 function register()
 {
     // Init Post Type
     $args = array('public' => false, 'show_in_admin_bar' => true, 'supports' => array('title', 'thumbnail'), 'has_archive' => false, 'query_var' => false);
     $post_type = new SpyropressCustomPostType(__('Slider', 'spyropress'), '', $args);
     // Slider Selection
     $instructions = '<p>' . __('You can place this slider anywhere into your posts, pages, custom post types or widgets by using the shortcode below:', 'spyropress') . '</p>';
     $instructions .= '<p><code>[slider id="{post_id}"]</code></p>';
     $slider_meta_fields['slider_type'] = array(array('label' => __('Start Here', 'spyropress'), 'type' => 'heading', 'slug' => 'slider_type'), array('label' => __('Select slider type', 'spyropress'), 'id' => 'slider_type', 'type' => 'select', 'class' => 'section-full', 'options' => $this->sliders, 'desc' => __('Select a slider type and hit [Publish] to start building your slider.', 'spyropress')), array('id' => 'instruction_info', 'type' => 'raw_info', 'function' => array($this, 'set_post_id'), 'desc' => $instructions));
     $post_type->add_meta_box('slider_type', __('Start Here', 'spyropress'), $slider_meta_fields, '', false, 'side');
     $post_ID = $slider_type = '';
     // getting post_id
     if (isset($_GET['post'])) {
         $post_ID = $_GET['post'];
     } elseif (isset($_POST['post_ID'])) {
         $post_ID = $_POST['post_ID'];
     }
     // get slider type
     if (!empty($post_ID)) {
         $slider_type = get_post_meta($post_ID, 'slider_type', true);
     }
     // check for no slider type
     if (empty($slider_type)) {
         return;
     }
     // slides
     $post_type->add_meta_box('slider_slides', __('Slides', 'spyropress'), $this->get_slides_settings($slider_type), 'slider_slides', false);
     // setting
     $slider_settings = $this->get_slider_settings($slider_type);
     if (!empty($slider_settings[$slider_type])) {
         $post_type->add_meta_box('slider_settings', __('Settings', 'spyropress'), $slider_settings, 'slider_settings', false);
     }
 }
コード例 #3
0
ファイル: post.php プロジェクト: rinodung/myfreetheme
 function register()
 {
     // Init Post Type
     $post = new SpyropressCustomPostType('Post');
     // Add Meta Boxes
     $meta_fields['options'] = array(array('label' => __('Post Option', 'spyropress'), 'type' => 'heading', 'slug' => 'post'), array('desc' => __('Select post format to have some options.<br><br>', 'spyropress'), 'id' => '_format_none', 'type' => 'raw_info'), array('label' => __('Gallery', 'spyropress'), 'desc' => __('Click to upload images', 'spyropress'), 'class' => 'section-full post_format gallery', 'id' => '_format_gallery_embed', 'type' => 'gallery'), array('label' => __('Video', 'spyropress'), 'desc' => __('Enter the video link you want to embed', 'spyropress'), 'class' => 'section-full post_format video', 'id' => '_format_video_embed', 'type' => 'text'), array('label' => __('Audio', 'spyropress'), 'desc' => __('Enter the audio link you want to embed', 'spyropress'), 'class' => 'section-full post_format audio', 'id' => '_format_audio_embed', 'type' => 'text'), array('label' => __('Quote Source Name', 'spyropress'), 'desc' => __('Enter the quote source name here', 'spyropress'), 'class' => 'section-full post_format quote', 'id' => '_format_quote_source_name', 'type' => 'text'));
     $post->add_meta_box('post_options', __('Post Options', 'spyropress'), $meta_fields, false, false, 'normal', 'high');
 }
コード例 #4
0
ファイル: faqs-init.php プロジェクト: rinodung/myfreetheme
 function register()
 {
     // Init Post Type
     $args = array('supports' => array('title', 'editor'), 'title' => __('Enter question here', 'spyropress'), 'has_archive' => false, 'exclude_from_search' => true);
     $post = new SpyropressCustomPostType(__('FAQ', 'spyropress'), 'faq', $args);
     // Add Taxonomy
     $post->add_taxonomy(__('FAQ Category', 'spyropress'), 'faq_category', __('Categories', 'spyropress'), array('hierarchical' => true));
 }
コード例 #5
0
ファイル: staff-init.php プロジェクト: rinodung/myfreetheme
 function register()
 {
     // Init Post Type
     $args = array('title' => __('Enter name here..', 'spyropress'), 'public' => false, 'supports' => array('title', 'thumbnail'), 'menu_icon' => 'dashicons-admin-users');
     $post = new SpyropressCustomPostType(__('Staff', 'spyropress'), 'staff', $args);
     $post->add_taxonomy(__('Designation', 'spyropress'), '', '', array('hierarchical' => true));
     // Add Meta Boxes
     $meta_fields['staff'] = array(array('label' => __('Staffs', 'spyropress'), 'type' => 'heading', 'slug' => 'staff'), array('label' => __('About', 'spyropress'), 'id' => 'about', 'type' => 'editor', 'rows' => 6), array('label' => __('Social', 'spyropress'), 'type' => 'repeater', 'id' => 'socials', 'item_title' => 'network', 'fields' => array(array('label' => __('Network', 'spyropress'), 'id' => 'network', 'type' => 'select', 'options' => spyropress_get_options_social()), array('label' => __('URL', 'spyropress'), 'id' => 'url', 'type' => 'text'))), array('label' => __('Link to Page', 'spyropress'), 'id' => 'link_page', 'type' => 'page'));
     $post->add_meta_box('staff_info', __('Mate Information', 'spyropress'), $meta_fields, '_mate_info', false);
 }
コード例 #6
0
 function register()
 {
     // Init Post Type
     $args = array('supports' => array('title', 'thumbnail'), 'title' => __('Enter name here..', 'spyropress'), 'has_archive' => false, 'exclude_from_search' => true);
     $post = new SpyropressCustomPostType(__('Testimonial', 'spyropress'), 'testimonial', $args);
     // Add Taxonomy
     $post->add_taxonomy(__('Testimonial Category', 'spyropress'), '', __('Categories', 'spyropress'), array('hierarchical' => true));
     // Add Meta Boxes
     $meta_fields['testimonial'] = array(array('label' => __('Testimonial', 'spyropress'), 'type' => 'heading', 'slug' => 'testimonial'), array('label' => __('Testimonial', 'spyropress'), 'id' => 'testimonial', 'type' => 'editor'), array('label' => __('Designation', 'spyropress'), 'id' => 'designation', 'type' => 'text'), array('label' => __('Company', 'spyropress'), 'id' => 'website', 'type' => 'text'));
     $post->add_meta_box('testimonial_info', __('Testimonial', 'spyropress'), $meta_fields, '_testimonial', false, 'normal', 'high');
 }
コード例 #7
0
ファイル: bucket-init.php プロジェクト: rinodung/myfreetheme
 function register()
 {
     // Init Post Type
     $args = array('supports' => array('title', 'editor'), 'menu_icon' => 'dashicons-admin-site');
     $post_type = new SpyropressCustomPostType(__('Bucket', 'spyropress'), '', $args);
     global $pagenow;
     // Shortcode Meta Box
     $instructions = '<p>' . __('Display bucket anywhere into your posts, pages, custom post types or widgets by using the shortcode below:', 'spyropress') . '</p>';
     $instructions .= '<p><code>[bucket id={post_id}]</code></p>';
     $sc_fields['shortcode'] = array(array('label' => __('Shortcode', 'spyropress'), 'type' => 'heading', 'slug' => 'shortcode'), array('id' => 'instruction_info', 'type' => 'raw_info', 'function' => array($this, 'set_post_id'), 'desc' => $instructions));
     $post_type->add_meta_box('shortcode', __('Shortcode', 'spyropress'), $sc_fields, false, false, 'side');
 }
コード例 #8
0
 function register()
 {
     // Init Post Type
     $args = array('supports' => array('title', 'editor', 'thumbnail'), 'has_archive' => false, 'exclude_from_search' => false, 'rewrite' => array('slug' => get_setting('portfolio-slug', 'portfolio')), 'menu_icon' => 'dashicons-portfolio');
     $post = new SpyropressCustomPostType(__('Portfolio', 'spyropress'), '', $args);
     // Add Taxonomy
     $post->add_taxonomy(__('Category', 'spyropress'), 'portfolio_category', __('Portfolio Categories', 'spyropress'), array('hierarchical' => true));
     $post->add_taxonomy(__('Services', 'spyropress'), 'portfolio_service', __('Services', 'spyropress'), array('hierarchical' => false));
     // Add Meta Boxes
     $meta_fields['portfolio'] = array(array('label' => __('Portfolio', 'spyropress'), 'type' => 'heading', 'slug' => 'portfolio'), array('label' => __('Project URL', 'spyropress'), 'id' => 'project_url', 'type' => 'text'), array('label' => __('Client', 'spyropress'), 'id' => 'project_client', 'type' => 'text'), array('label' => __('Client Testimonial', 'spyropress'), 'id' => 'project_testimonial', 'type' => 'textarea', 'rows' => 7), array('label' => __('Showcase Type', 'spyropress'), 'id' => 'p_type', 'type' => 'select', 'options' => array('gallery' => __('Gallery', 'spyropress'), 'video' => __('Video', 'spyropress')), 'class' => 'enable_changer'), array('label' => __('Gallery', 'spyropress'), 'desc' => __('Click to upload images', 'spyropress'), 'id' => 'gallery', 'type' => 'gallery', 'class' => 'p_type gallery'), array('label' => __('Video', 'spyropress'), 'id' => 'video', 'type' => 'textarea', 'rows' => 5, 'class' => 'p_type video'));
     $post->add_meta_box('portfolio', __('Portfolio Details', 'spyropress'), $meta_fields, false, false, 'normal', 'high');
 }
コード例 #9
0
 function register()
 {
     // Init Post Type
     $args = array('public' => false, 'show_in_admin_bar' => true, 'supports' => array('title'), 'has_archive' => false, 'query_var' => false, 'menu_icon' => 'dashicons-media-spreadsheet');
     $post_type = new SpyropressCustomPostType(__('Pricing Table', 'spyropress'), 'pricingtable', $args);
     // Shortcode Meta Box
     $instructions = '<p>' . __('Display price table anywhere into your posts, pages, custom post types or widgets by using the shortcode below:', 'spyropress') . '</p>';
     $instructions .= '<p><code>[pricing_table id={post_id}]</code></p>';
     $sc_fields['shortcode'] = array(array('label' => __('Shortcode', 'spyropress'), 'type' => 'heading', 'slug' => 'shortcode'), array('id' => 'instruction_info', 'type' => 'raw_info', 'function' => array($this, 'set_post_id'), 'desc' => $instructions), array('id' => 'columns', 'label' => __('Columns', 'spyropress'), 'type' => 'select', 'class' => 'section-full', 'options' => array(2 => __('2 Columns', 'spyropress'), 3 => __('3 Columns', 'spyropress'), 4 => __('4 Columns', 'spyropress'))), array('label' => __('Currency', 'spyropress'), 'id' => 'currency', 'class' => 'section-full', 'type' => 'text'), array('label' => __('Button Text', 'spyropress'), 'id' => 'btn_text', 'class' => 'section-full', 'type' => 'text'), array('label' => __('Popular Text', 'spyropress'), 'id' => 'popular_text', 'class' => 'section-full', 'type' => 'text', 'std' => 'Popular'));
     $post_type->add_meta_box('shortcode', __('Shortcode', 'spyropress'), $sc_fields, false, false, 'side');
     // Add Meta Boxes
     $meta_fields['table'] = array(array('label' => __('Table', 'spyropress'), 'type' => 'heading', 'slug' => 'table'), array('label' => __('Table', 'spyropress'), 'type' => 'repeater', 'id' => 'tables', 'item_title' => 'title', 'hide_label' => true, 'fields' => array(array('id' => 'recommended', 'type' => 'checkbox', 'options' => array('1' => __('Most Popular', 'spyropress'))), array('label' => __('Title', 'spyropress'), 'id' => 'title', 'type' => 'text'), array('type' => 'row'), array('type' => 'col', 'size' => 6), array('label' => __('Price', 'spyropress'), 'id' => 'price', 'type' => 'text'), array('type' => 'col_end'), array('type' => 'col', 'size' => 6), array('label' => __('Button URL', 'spyropress'), 'id' => 'url', 'type' => 'text'), array('type' => 'col_end'), array('type' => 'row_end'), array('label' => __('Features', 'spyropress'), 'type' => 'repeater', 'id' => 'features', 'item_title' => 'title', 'fields' => array(array('label' => __('Title', 'spyropress'), 'id' => 'title', 'type' => 'text'))))));
     $post_type->add_meta_box('tables', __('Tables', 'spyropress'), $meta_fields, false, false);
 }