Skip to content

Instantly share code, notes, and snippets.

@iamntz-gists
Created January 9, 2014 16:53
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 iamntz-gists/069f7c64781a906fd02e to your computer and use it in GitHub Desktop.
Save iamntz-gists/069f7c64781a906fd02e to your computer and use it in GitHub Desktop.
<?php
if(function_exists("register_field_group"))
{
register_field_group(array (
'id' => 'acf_logic-testing',
'title' => 'Logic testing',
'fields' => array (
array (
'key' => 'field_52cec76c329ca',
'label' => 'Truthy',
'name' => 'truthy',
'type' => 'true_false',
'message' => '',
'default_value' => 0,
),
array (
'key' => 'field_52cec7a47b20e',
'label' => 'Truthy 2',
'name' => 'truthy_2',
'type' => 'true_false',
'conditional_logic' => array (
'status' => 1,
'rules' => array (
array (
'field' => 'field_52cec76c329ca',
'operator' => '==',
'value' => '1',
),
),
'allorany' => 'all',
),
'message' => '',
'default_value' => 0,
),
array (
'key' => 'field_52cec7ab7b20f',
'label' => 'Content 2',
'name' => 'content_2',
'type' => 'textarea',
'conditional_logic' => array (
'status' => 1,
'rules' => array (
array (
'field' => 'field_52cec7a47b20e',
'operator' => '==',
'value' => '1',
),
),
'allorany' => 'all',
),
'default_value' => '',
'placeholder' => '',
'maxlength' => '',
'formatting' => 'br',
),
),
'location' => array (
array (
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'page',
'order_no' => 0,
'group_no' => 0,
),
),
),
'options' => array (
'position' => 'normal',
'layout' => 'default',
'hide_on_screen' => array (
0 => 'permalink',
1 => 'the_content',
2 => 'excerpt',
3 => 'custom_fields',
4 => 'discussion',
5 => 'comments',
6 => 'revisions',
7 => 'slug',
8 => 'author',
9 => 'format',
10 => 'featured_image',
11 => 'categories',
12 => 'tags',
13 => 'send-trackbacks',
),
),
'menu_order' => 0,
));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment