Last active
March 25, 2018 02:13
-
-
Save jonwaldstein/b665f8d0185b6b5d8fdaa9984a0f0d14 to your computer and use it in GitHub Desktop.
This file contains hidden or 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; | |
| use Carbon_Fields\Field; | |
| use Carbon_Fields\Field\Complex_Field; | |
| Container::make( 'post_meta', 'Page Builder' )//PAGE BUILDER | |
| ->show_on_post_type( array('page','location','post') ) | |
| ->add_fields( array( | |
| Field::make( 'complex', 'crb_layouts' ) | |
| ->setup_labels(array( | |
| 'plural_name' => 'Sections', | |
| 'singular_name' => 'Section', | |
| )) | |
| ->add_fields( 'dynamic_row', array( | |
| Field::make('checkbox', 'full_width_section')->set_width(20), | |
| Field::make('checkbox', 'content_contained')->set_width(20), | |
| Field::make('text', 'section_class')->set_width(30), | |
| Field::make('image', 'section_background_image')->set_value_type( 'url' )->set_width(30), | |
| Field::make('text', 'section_heading'), | |
| Field::make("select", "number_of_columns", "Number of Columns") | |
| ->add_options(array( | |
| 'one' => '1', | |
| 'two' => '2', | |
| 'three' => '3', | |
| 'four' => '4', | |
| 'five' => '5', | |
| 'six' => '6', | |
| )), | |
| Field::make('text', 'column1_class')->set_width(50) | |
| ->set_conditional_logic(array( | |
| 'relation' => 'OR', | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'one', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'two', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'three', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'four', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'five', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'six', | |
| 'compare' => '=', | |
| ), | |
| )), | |
| Field::make( 'rich_text', 'column1' )->set_width(50) | |
| ->set_conditional_logic(array( | |
| 'relation' => 'OR', | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'one', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'two', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'three', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'four', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'five', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'six', | |
| 'compare' => '=', | |
| ), | |
| )), | |
| Field::make('text', 'column2_class') | |
| ->set_conditional_logic(array( | |
| 'relation' => 'OR', | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'two', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'three', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'four', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'five', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'six', | |
| 'compare' => '=', | |
| ), | |
| )), | |
| Field::make( 'rich_text', 'column2' )->set_width(50) | |
| ->set_conditional_logic(array( | |
| 'relation' => 'OR', | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'two', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'three', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'four', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'five', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'six', | |
| 'compare' => '=', | |
| ), | |
| )), | |
| Field::make('text', 'column3_class') | |
| ->set_conditional_logic(array( | |
| 'relation' => 'OR', | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'three', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'four', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'five', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'six', | |
| 'compare' => '=', | |
| ), | |
| )), | |
| Field::make( 'rich_text', 'column3' )->set_width(50) | |
| ->set_conditional_logic(array( | |
| 'relation' => 'OR', | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'three', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'four', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'five', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'six', | |
| 'compare' => '=', | |
| ), | |
| )), | |
| Field::make('text', 'column4_class') | |
| ->set_conditional_logic(array( | |
| 'relation' => 'OR', | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'four', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'five', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'six', | |
| 'compare' => '=', | |
| ), | |
| )), | |
| Field::make( 'rich_text', 'column4' )->set_width(50) | |
| ->set_conditional_logic(array( | |
| 'relation' => 'OR', | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'four', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'five', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'six', | |
| 'compare' => '=', | |
| ), | |
| )), | |
| Field::make('text', 'column5_class') | |
| ->set_conditional_logic(array( | |
| 'relation' => 'OR', | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'five', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'six', | |
| 'compare' => '=', | |
| ), | |
| )), | |
| Field::make( 'rich_text', 'column5' )->set_width(50) | |
| ->set_conditional_logic(array( | |
| 'relation' => 'OR', | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'five', | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'six', | |
| 'compare' => '=', | |
| ), | |
| )), | |
| Field::make('text', 'column6_class') | |
| ->set_conditional_logic(array( | |
| 'relation' => 'OR', | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'six', | |
| 'compare' => '=', | |
| ), | |
| )), | |
| Field::make( 'rich_text', 'column6' )->set_width(50) | |
| ->set_conditional_logic(array( | |
| 'relation' => 'OR', | |
| array( | |
| 'field' => 'number_of_columns', | |
| 'value' => 'six', | |
| 'compare' => '=', | |
| ), | |
| )), | |
| )) | |
| )); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment