Skip to content

Instantly share code, notes, and snippets.

@fgilio
Created July 27, 2016 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fgilio/c0f2018938f3cbc4f3de9ddc8bad9971 to your computer and use it in GitHub Desktop.
Save fgilio/c0f2018938f3cbc4f3de9ddc8bad9971 to your computer and use it in GitHub Desktop.
Testing Carbon Fields
<?php
use Carbon_Fields\Container;
use Carbon_Fields\Field;
Container::make('theme_options', 'thisThing Options')
->add_fields([
Field::make('complex', 'thisThing_options')
->set_min(1)
->set_max(1)
->add_fields('Basic', [
Field::make('text', 'canal_name'),
Field::make('text', 'canal_dir'),
Field::make('text', 'contact_email'),
Field::make('text', 'apple_app_id')
])
]);
Container::make('theme_options', 'Social Networks')
->set_page_parent('thisThing Options')
->add_fields([
Field::make('text', 'facebook_page_slug'),
Field::make('text', 'twitter_slug'),
Field::make('text', 'google_plus_slug')
]);
Container::make('post_meta', 'Testing Carbon Fields')
->show_on_post_type('post')
// ->show_on_category('policiales')
// ->show_on_post_format('video')
->add_fields([
// Field::make('select', 'crb_show_socials', 'Show Socials')
// ->add_options([
// 'yes' => 'Yes',
// 'no' => 'No',
// ]),
Field::make('textarea', '_wpcf_n_bajada'),
// Field::make('textarea', '_wp_attachment_metadata'),
// Field::make('text', 'crb_facebook', 'Facebook URL')
// ->set_conditional_logic([
// 'relation' => 'AND', // Optional, defaults to "AND"
// [
// 'field' => 'crb_show_socials',
// 'value' => 'yes', // Optional, defaults to "". Should be an array if "IN" or "NOT IN" operators are used.
// 'compare' => '=', // Optional, defaults to "=". Available operators: =, <, >, <=, >=, IN, NOT IN
// ]
// ])
]);
// carbon_get_theme_option('crb_copyright');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment