Skip to content

Instantly share code, notes, and snippets.

@Avakulenko
Created December 22, 2015 14:30
Show Gist options
  • Save Avakulenko/56c5329e3da4259dd962 to your computer and use it in GitHub Desktop.
Save Avakulenko/56c5329e3da4259dd962 to your computer and use it in GitHub Desktop.
<?php
use Carbon_Fields\Container\Container;
use Carbon_Fields\Field\Field;
Container::make('post_meta', __('Homepage Options', 'crb'))
->show_on_post_type('page')
->show_on_template('templates/home.php')
->add_fields(array(
Field::make('complex', 'crb_home_slides', __('Slides', 'crb'))->add_fields(array(
Field::make('attachment', 'image', __('Slide', 'crb'))->set_required(true),
)),
Field::make('complex', 'crb_home_features', __('Features', 'crb'))->add_fields(array(
Field::make('attachment', 'image', __('Icon', 'crb'))->set_required(true),
Field::make('text', 'label', __('Label', 'crb')),
Field::make('text', 'link', __('Link', 'crb')),
)),
));
Container::make('post_meta', __('General Page Options', 'crb'))
->show_on_post_type('page')
->hide_on_template('templates/home.php')
->add_fields(array(
Field::make('text', 'crb_custom_page_title', __('Custom Page Title', 'crb')),
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment