Created
July 14, 2016 06:38
-
-
Save emohamed/399a3c7188e737086d8a5a2d16a8a3e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Carbon_Fields\Container\Container; | |
use Carbon_Fields\Field\Field; | |
$general_block = [ | |
Field::make('text', 'plain_text_block'), | |
Field::make('rich_text', 'rich_text_block'), | |
]; | |
$media_block = [ | |
Field::make('image', 'image_block'), | |
Field::make('textarea', 'video_embed_block'), | |
]; | |
$advanced_block = [ | |
Field::make('map', 'map_block'), | |
]; | |
Container::make('custom_fields', __('Home Page Blocks', 'crb')) | |
->show_on_page('home') | |
->add_fields([ | |
Field::make('complex', 'home_blocks') | |
->add_fields('general', $general_block) | |
->add_fields('media', $media_block) | |
]); | |
Container::make('custom_fields', __('About Page Blocks', 'crb')) | |
->show_on_page('about') | |
->add_fields([ | |
Field::make('complex', 'about_blocks') | |
->add_fields('media', $media_block) | |
->add_fields('advanced', $advanced_block) | |
]); | |
Container::make('custom_fields', __('Contact Page Blocks', 'crb')) | |
->show_on_page('contact') | |
->add_fields([ | |
Field::make('complex', 'contact_blocks') | |
->add_fields('general', $general_block) | |
->add_fields('media', $media_block) | |
->add_fields('advanced', $advanced_block) | |
]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment