Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // CONTENT BLOCKS
- $meta_boxes[] = array(
- 'title' => __( 'Content blocks' ),
- 'post_types' => 'page',
- 'fields' => array(
- array(
- 'id' => 'content-block',
- 'type' => 'group',
- 'clone' => true,
- 'sort_clone' => true,
- 'collapsible' => true,
- 'group_title' => array( 'field' => 'select-content-block' ),
- 'save_state' => true,
- 'fields' => array(
- array(
- 'id' => 'select-content-block',
- 'name' => __( 'Create a content block', 'rwmb' ),
- 'type' => 'select',
- 'multiple' => false,
- 'placeholder' => 'Select',
- 'options' => array(
- 'text' => 'Freeform text',
- 'slideshow' => 'Slideshow',
- 'gallery' => 'Gallery',
- 'image-and-text' => 'Image and text',
- 'menu' => 'Menu',
- 'call-to-action' => 'Call to action'
- )
- ),
- // TEXT
- array(
- 'id' => 'content-block-text',
- 'type' => 'group',
- 'visible' => array('select-content-block', '=', 'text'),
- 'fields' => array(
- array(
- 'id' => 'content-block-text_text-format',
- 'name' => __( 'Text format', 'rwmb' ),
- 'type' => 'select',
- 'multiple' => false,
- 'placeholder' => 'Select',
- 'options' => array(
- 'standard' => 'Standard',
- 'blockquote' => 'Blockquote'
- )
- ),
- array(
- 'id' => 'content-block-text_text-format-standard_title',
- 'name' => __( 'Title', 'rwmb' ),
- 'type' => 'text',
- 'desc' => 'Optional',
- 'visible' => array('content-block-text_text-format', '=', 'standard'),
- ),
- array(
- 'id' => 'content-block-text_text-format-standard_number-of-columns',
- 'name' => __( 'Number of columns', 'rwmb' ),
- 'type' => 'select',
- 'multiple' => false,
- 'visible' => array('content-block-text_text-format', '=', 'standard'),
- 'placeholder' => 'Select',
- 'options' => array(
- '2' => '2',
- '3' => '3',
- '4' => '4'
- )
- ),
- array(
- 'id' => 'content-block-text_text',
- 'name' => __( 'Text', 'rwmb' ),
- 'type' => 'wysiwyg',
- // 'options' => array(
- // 'media_buttons' => false,
- // 'textarea_rows' => 5
- // )
- ),
- array(
- 'id' => 'content-block-text_text-align',
- 'name' => __( 'Text align', 'rwmb' ),
- 'type' => 'select',
- 'placeholder' => 'Left',
- 'multiple' => false,
- 'options' => array(
- 'ac' => 'Centre',
- 'ar' => 'Right'
- ),
- 'desc' => 'Default is left',
- 'visible' => array('content-block-text_text-format', '=', 'blockquote'),
- ),
- ),
- ),
- // SLIDESHOW
- array(
- 'id' => 'content-block-slideshow',
- 'type' => 'group',
- 'visible' => array('select-content-block', '=', 'slideshow'),
- 'fields' => array(
- array(
- 'id' => 'content-block-slideshow_slideshow-format',
- 'name' => __( 'Slideshow format', 'rwmb' ),
- 'type' => 'select',
- 'placeholder' => 'Select',
- 'multiple' => false,
- 'options' => array(
- 'standard' => 'Standard',
- 'horizontal' => 'Horizontal scrolling',
- 'group' => 'Group'
- )
- ),
- array(
- 'id' => 'content-block-slideshow_slideshow-images',
- 'name' => __( 'Slideshow images', 'rwmb' ),
- 'type' => 'image_advanced',
- 'visible' => array('content-block-slideshow_slideshow-format', '=', 'horizontal'),
- ),
- array(
- 'id' => 'content-block-slideshow_slideshow-images_crop',
- 'name' => __( 'Crop slideshow images?', 'rwmb' ),
- 'type' => 'checkbox',
- 'desc' => 'Check to crop images to the size of the slideshow',
- 'visible' => array('content-block-slideshow_slideshow-format', '=', 'standard'),
- ),
- array(
- 'id' => 'content-block-slideshow_subtitle',
- 'name' => __( 'Slideshow subtitle', 'rwmb' ),
- 'type' => 'text',
- 'visible' => array (
- 'when' => array (
- array (
- 'content-block-slideshow_slideshow-format', '=', 'standard',
- ),
- array (
- 'content-block-slideshow_slideshow-format', '=', 'horizontal'
- ),
- ),
- 'relation' => 'or',
- ),
- ),
- array(
- 'id' => 'content-block-slideshow_title',
- 'name' => __( 'Slideshow title', 'rwmb' ),
- 'type' => 'text',
- 'visible' => array (
- 'when' => array (
- array (
- 'content-block-slideshow_slideshow-format', '=', 'standard',
- ),
- array (
- 'content-block-slideshow_slideshow-format', '=', 'horizontal'
- ),
- ),
- 'relation' => 'or',
- ),
- ),
- // Standard
- array(
- 'id' => 'content-block-slideshow_slideshow-format-standard_make-title-a-link',
- 'name' => __( 'Make title a link?', 'rwmb' ),
- 'type' => 'checkbox',
- 'visible' => array('content-block-slideshow_slideshow-format', '=', 'standard')
- ),
- array(
- 'id' => 'content-block-slideshow_slideshow-format-standard_make-title-a-link_link-type',
- 'name' => __( 'Slideshow title link', 'rwmb' ),
- 'type' => 'select',
- 'multiple' => false,
- 'placeholder' => 'Select',
- 'options' => array(
- 'page' => 'Page',
- 'custom' => 'Custom link'
- ),
- 'visible' => array('content-block-slideshow_slideshow-format-standard_make-title-a-link', '=', true)
- ),
- array(
- 'id' => 'content-block-slideshow_slideshow-format-standard_slide-title-link-custom',
- 'name' => __( 'Slide title', 'rwmb' ),
- 'type' => 'url',
- 'visible' => array('content-block-slideshow_slideshow-format-standard_make-title-a-link_link-type', '=', 'custom')
- ),
- array(
- 'id' => 'content-block-slideshow_slideshow-format-standard_slide-title-link-page',
- 'name' => __( 'Page to link slide', 'rwmb' ),
- 'type' => 'select',
- 'placeholder' => 'Select page',
- 'options' => $pageoptions,
- 'visible' => array('content-block-slideshow_slideshow-format-standard_make-title-a-link_link-type', '=', 'page')
- ),
- array(
- 'id' => 'content-block-slideshow_aside',
- 'name' => __( 'Slideshow aside', 'rwmb' ),
- 'type' => 'textarea',
- 'visible' => array('content-block-slideshow_slideshow-format', '=', 'standard'),
- ),
- array(
- 'id' => 'content-block-slideshow_title-position',
- 'name' => __( 'Title / Subtitle / Aside position', 'rwmb' ),
- 'type' => 'select',
- 'placeholder' => 'Select',
- 'multiple' => false,
- 'visible' => array('content-block-slideshow_slideshow-format', '=', 'standard'),
- 'options' => array(
- 'top' => 'Top',
- 'overlay' => 'Overlay'
- )
- ),
- array(
- 'id' => 'content-block-slideshow_description',
- 'name' => __( 'Slideshow description', 'rwmb' ),
- 'type' => 'wysiwyg',
- 'visible' => array('content-block-slideshow_slideshow-format', '=', 'standard'),
- 'options' => array(
- 'media_buttons' => false,
- 'textarea_rows' => 5
- )
- ),
- array(
- 'id' => 'content-block-slideshow_slideshow-format-standard',
- 'type' => 'group',
- 'name' => 'Slides',
- 'clone' => true,
- 'sort_clone' => true,
- 'visible' => array('content-block-slideshow_slideshow-format', '=', 'standard'),
- 'fields' => array(
- array(
- 'id' => 'content-block-slideshow_slideshow-format-standard_slide-image',
- 'name' => __( 'Slideshow image', 'rwmb' ),
- 'type' => 'image_advanced',
- 'max_file_uploads' => 1,
- ),
- array(
- 'id' => 'content-block-slideshow_slideshow-format-standard_slide-link',
- 'name' => __( 'Slideshow link', 'rwmb' ),
- 'type' => 'select',
- 'multiple' => false,
- 'placeholder' => 'Select',
- 'options' => array(
- 'page' => 'Page',
- 'custom' => 'Custom link'
- ),
- ),
- array(
- 'id' => 'content-block-slideshow_slideshow-format-standard_slide-link-custom',
- 'name' => __( 'Slide title', 'rwmb' ),
- 'type' => 'url',
- 'visible' => array('content-block-slideshow_slideshow-format-standard_slide-link', '=', 'custom')
- ),
- array(
- 'id' => 'content-block-slideshow_slideshow-format-standard_slide-link-page',
- 'name' => __( 'Page to link slide', 'rwmb' ),
- 'type' => 'select',
- 'placeholder' => 'Select page',
- 'options' => $pageoptions,
- 'visible' => array('content-block-slideshow_slideshow-format-standard_slide-link', '=', 'page')
- ),
- ),
- ),
- // Horizontal
- array(
- 'id' => 'content-block-slideshow_number_slides_per_row',
- 'name' => __( 'Number of slides per row', 'rwmb' ),
- 'type' => 'select',
- 'multiple' => false,
- 'placeholder' => 'Select',
- 'options' => array(
- '2' => '2',
- '3' => '3',
- '4' => '4'
- ),
- 'visible' => array('content-block-slideshow_slideshow-format', '=', 'horizontal'),
- ),
- // Group
- array(
- 'id' => 'content-block-slideshow_group-subtitle',
- 'name' => __( 'Group subtitle', 'rwmb' ),
- 'type' => 'text',
- 'placeholder' => 'eg. Featured artists',
- 'visible' => array('content-block-slideshow_slideshow-format', '=', 'group'),
- ),
- array(
- 'id' => 'content-block-slideshow_group-title',
- 'name' => __( 'Group title', 'rwmb' ),
- 'type' => 'text',
- 'visible' => array('content-block-slideshow_slideshow-format', '=', 'group'),
- ),
- array(
- 'id' => 'content-block-slideshow_slideshow-format-group',
- 'type' => 'group',
- 'name' => 'Slides',
- 'clone' => true,
- 'sort_clone' => true,
- 'visible' => array('content-block-slideshow_slideshow-format', '=', 'group'),
- 'fields' => array(
- array(
- 'id' => 'content-block-slideshow_slideshow-format-group_slide-title',
- 'name' => __( 'Slide title', 'rwmb' ),
- 'type' => 'text',
- 'placeholder' => 'eg. Ian McKeever'
- ),
- array(
- 'id' => 'content-block-slideshow_slideshow-format-group_slide-image',
- 'name' => __( 'Slideshow image', 'rwmb' ),
- 'type' => 'image_advanced',
- 'max_file_uploads' => 1,
- ),
- array(
- 'id' => 'content-block-slideshow_slideshow-format-group_slide-link',
- 'name' => __( 'Slideshow link', 'rwmb' ),
- 'type' => 'select',
- 'multiple' => false,
- 'placeholder' => 'Select',
- 'options' => array(
- 'page' => 'Page',
- 'custom' => 'Custom link'
- ),
- ),
- array(
- 'id' => 'content-block-slideshow_slideshow-format-group_slide-link-custom',
- 'name' => __( 'Slide title', 'rwmb' ),
- 'type' => 'url',
- 'visible' => array('content-block-slideshow_slideshow-format-group_slide-link', '=', 'custom')
- ),
- array(
- 'id' => 'content-block-slideshow_slideshow-format-group_slide-link-page',
- 'name' => __( 'Page to link slide', 'rwmb' ),
- 'type' => 'select',
- 'placeholder' => 'Select page',
- 'options' => $pageoptions,
- 'visible' => array('content-block-slideshow_slideshow-format-group_slide-link', '=', 'page')
- ),
- ),
- ),
- ),
- ),
- // GALLERY
- array(
- 'id' => 'content-block-gallery',
- 'type' => 'group',
- 'visible' => array('select-content-block', '=', 'gallery'),
- 'fields' => array(
- array(
- 'id' => 'content-block-gallery_gallery-format',
- 'name' => __( 'Gallery format', 'rwmb' ),
- 'type' => 'select',
- 'placeholder' => 'Select',
- 'multiple' => false,
- 'options' => array(
- 'standard' => 'Standard',
- 'series-index' => 'Series index',
- 'instagram' => 'Instagram'
- )
- ),
- // Standard
- array(
- 'id' => 'content-block-gallery_gallery-images',
- 'name' => __( 'Gallery images', 'rwmb' ),
- 'type' => 'image_advanced',
- 'multiple' => true,
- 'visible' => array('content-block-gallery_gallery-format', '=', 'standard'),
- ),
- array(
- 'id' => 'content-block-gallery_number-of-columns',
- 'name' => __( 'Number of columns', 'rwmb' ),
- 'type' => 'select',
- 'multiple' => false,
- 'visible' => array('content-block-gallery_gallery-format', '=', 'standard'),
- 'placeholder' => 'Select',
- 'options' => array(
- '1' => '1',
- '2' => '2',
- '3' => '3',
- '4' => '4'
- )
- ),
- array(
- 'id' => 'content-block-gallery_gallery-image-format',
- 'name' => __( 'Gallery image format', 'rwmb' ),
- 'type' => 'select',
- 'placeholder' => 'Select',
- 'multiple' => false,
- 'visible' => array('content-block-gallery_gallery-format', '=', 'standard'),
- 'options' => array(
- 'large' => 'Standard',
- 'big-square-crop' => 'Square'
- )
- ),
- array(
- 'id' => 'content-block-gallery_include-image-titles',
- 'name' => __( 'Include image titles?', 'rwmb' ),
- 'type' => 'checkbox',
- 'visible' => array('content-block-gallery_gallery-format', '=', 'standard'),
- ),
- array(
- 'id' => 'content-block-gallery_include-image-captions',
- 'name' => __( 'Include image captions?', 'rwmb' ),
- 'type' => 'checkbox',
- 'visible' => array('content-block-gallery_gallery-format', '=', 'standard'),
- ),
- array(
- 'id' => 'content-block-gallery_edge-to-edge',
- 'name' => __( 'Edge-to-edge images?', 'rwmb' ),
- 'type' => 'checkbox',
- 'visible' => array('content-block-gallery_gallery-format', '=', 'standard'),
- ),
- array(
- 'id' => 'content-block-gallery_alt-value-as-link',
- 'name' => __( 'Use <em>Alt</em> value as link?', 'rwmb' ),
- 'type' => 'checkbox',
- 'visible' => array('content-block-gallery_gallery-format', '=', 'standard'),
- ),
- // Series index
- array(
- 'id' => 'content-block-gallery_gallery-format_series-index',
- 'type' => 'group',
- 'clone' => true,
- 'sort_clone' => true,
- 'name' => 'Series indexes',
- 'visible' => array('content-block-gallery_gallery-format', '=', 'series-index'),
- 'fields' => array(
- array(
- 'id' => 'content-block-gallery_gallery-format_series-index_series-title',
- 'name' => __( 'Index title', 'rwmb' ),
- 'type' => 'text',
- ),
- array(
- 'id' => 'content-block-gallery_gallery-format_series-index_include-series-description',
- 'name' => __( 'Include index description?', 'rwmb' ),
- 'type' => 'checkbox',
- ),
- array(
- 'id' => 'content-block-gallery_gallery-format_series-index_series-description',
- 'name' => __( 'Index description', 'rwmb' ),
- 'type' => 'wysiwyg',
- 'visible' => array('content-block-gallery_gallery-format_series-index_include-series-description', '=', true),
- 'options' => array(
- 'media_buttons' => false,
- 'textarea_rows' => 5,
- 'wp_more' => false
- )
- ),
- array(
- 'id' => 'content-block-gallery_gallery-format_series-index_images',
- 'name' => __( 'Index images', 'rwmb' ),
- 'type' => 'image_advanced',
- 'multiple' => true
- ),
- array(
- 'id' => 'content-block-gallery_gallery-format_series-index_number-of-columns',
- 'name' => __( 'Number of columns', 'rwmb' ),
- 'type' => 'select',
- 'multiple' => false,
- 'placeholder' => 'Select',
- 'options' => array(
- '1' => '1',
- '2' => '2',
- '3' => '3',
- '4' => '4'
- )
- ),
- ),
- ),
- // Instagram
- array(
- 'id' => 'content-block-gallery_gallery-format_instagram_number-of-columns',
- 'name' => __( 'Number of columns', 'rwmb' ),
- 'type' => 'select',
- 'multiple' => false,
- 'visible' => array('content-block-gallery_gallery-format', '=', 'instagram'),
- 'placeholder' => 'Select',
- 'options' => array(
- '1' => '1',
- '2' => '2',
- '3' => '3',
- '4' => '4'
- )
- ),
- array(
- 'id' => 'content-block-gallery_gallery-format_instagram_number-of-photos',
- 'name' => __( 'Number of photos', 'rwmb' ),
- 'type' => 'numvber',
- 'multiple' => false,
- 'visible' => array('content-block-gallery_gallery-format', '=', 'instagram')
- ),
- ),
- ),
- // IMAGE AND TEXT
- array(
- 'id' => 'content-block-image-and-text',
- 'type' => 'group',
- 'visible' => array('select-content-block', '=', 'image-and-text'),
- 'fields' => array(
- array(
- 'id' => 'content-block-image-and-text_image-and-text-format',
- 'name' => __( 'Image and text format', 'rwmb' ),
- 'type' => 'select',
- 'multiple' => false,
- 'placeholder' => 'Select',
- 'options' => array(
- 'freeform' => 'Freeform',
- 'page' => 'Page'
- )
- ),
- // Freeform
- array(
- 'id' => 'content-block-image-and-text_freeform-images',
- 'name' => __( 'Select image', 'rwmb' ),
- 'type' => 'image_advanced',
- 'max_file_uploads' => 1,
- 'multiple' => false,
- 'visible' => array('content-block-image-and-text_image-and-text-format', '=', 'freeform'),
- ),
- array(
- 'id' => 'content-block-image-and-text_freeform-text',
- 'name' => __( 'Text', 'rwmb' ),
- 'type' => 'wysiwyg',
- 'options' => array(
- 'media_buttons' => false,
- 'textarea_rows' => 10
- ),
- 'visible' => array('content-block-image-and-text_image-and-text-format', '=', 'freeform'),
- ),
- // Page
- array(
- 'id' => 'content-block-image-and-text_select_page',
- 'name' => __( 'Page', 'rwmb' ),
- 'type' => 'select',
- 'placeholder' => 'Select page',
- 'options' => $pageoptions,
- 'description' => 'Selected page must have a Featured Image and Excerpt to display correctly',
- 'visible' => array('content-block-image-and-text_image-and-text-format', '=', 'page'),
- ),
- array(
- 'id' => 'content-block-image-and-text_select_page_use-alternative-title',
- 'name' => __( 'Use another title?', 'rwmb' ),
- 'type' => 'checkbox',
- 'visible' => array('content-block-image-and-text_image-and-text-format', '=', 'page'),
- 'desc' => 'The page title then becomes a subtitle'
- ),
- array(
- 'id' => 'content-block-image-and-text_select_page_alternative-title',
- 'name' => __( 'Alternative title', 'rwmb' ),
- 'type' => 'text',
- 'visible' => array('content-block-image-and-text_select_page_use-alternative-title', '=', true),
- ),
- // Globals
- array(
- 'id' => 'content-block-image-and-text_image-and-text-position',
- 'name' => __( 'Image and text position', 'rwmb' ),
- 'type' => 'select',
- 'multiple' => false,
- 'placeholder' => 'Select',
- 'options' => array(
- 'image-left-text-right' => 'Image left text right',
- 'image-right-text-left' => 'Image right text left',
- )
- ),
- array(
- 'id' => 'content-block-image-and-text_edge-to-edge',
- 'name' => __( 'Edge-to-edge images?', 'rwmb' ),
- 'type' => 'checkbox',
- ),
- ),
- ),
- // MENU
- array(
- 'id' => 'content-block-menu',
- 'type' => 'group',
- 'visible' => array('select-content-block', '=', 'menu'),
- 'fields' => array(
- array(
- 'id' => 'content-block-menu_menu-format',
- 'name' => __( 'Menu format', 'rwmb' ),
- 'type' => 'select',
- 'multiple' => false,
- 'placeholder' => 'Select',
- 'options' => array(
- 'subpages' => 'Subpages'
- )
- ),
- ),
- ),
- // CALL TO ACTION
- array(
- 'id' => 'content-block-call-to-action',
- 'type' => 'group',
- 'visible' => array('select-content-block', '=', 'call-to-action'),
- 'fields' => array(
- array(
- 'id' => 'content-block-call-to-action_text',
- 'name' => __( 'Call to action text', 'rwmb' ),
- 'type' => 'text'
- ),
- array(
- 'id' => 'content-block-call-to-action_what-link',
- 'name' => __( 'Use different text for the link', 'rwmb' ),
- 'type' => 'checkbox',
- 'desc' => 'By default the call to action text is used as a link'
- ),
- array(
- 'id' => 'content-block-call-to-action_text-link',
- 'name' => __( 'Call to action link text', 'rwmb' ),
- 'type' => 'text',
- 'visible' => array('content-block-call-to-action_what-link', '=', true),
- ),
- array(
- 'id' => 'content-block-call-to-action_link',
- 'name' => __( 'Call to action link', 'rwmb' ),
- 'type' => 'text'
- ),
- array(
- 'id' => 'content-block-call-to-action_text-align',
- 'name' => __( 'Text align', 'rwmb' ),
- 'type' => 'select',
- 'placeholder' => 'Centre',
- 'multiple' => false,
- 'options' => array(
- 'al' => 'Left',
- 'ar' => 'Right'
- ),
- 'desc' => 'Default is centre',
- ),
- ),
- ),
- ),
- ),
- ),
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement