Skip to content

Instantly share code, notes, and snippets.

@scottnath
Created March 21, 2012 15:16
Show Gist options
  • Save scottnath/2148283 to your computer and use it in GitHub Desktop.
Save scottnath/2148283 to your computer and use it in GitHub Desktop.
simple acf field group
<?
if(function_exists("register_field_group"))
{
register_field_group(array (
'title' => 'Category bug test',
'fields' =>
array (
0 =>
array (
'key' => 'field_4f69e70fa8298',
'label' => 'checkbox',
'name' => 'checkbox',
'type' => 'true_false',
'message' => '',
'instructions' => '',
'required' => '0',
'order_no' => '0',
),
),
'location' =>
array (
'rules' =>
array (
0 =>
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'post',
'order_no' => '0',
),
),
'allorany' => 'all',
),
'options' =>
array (
'position' => 'normal',
'layout' => 'default',
'show_on_page' =>
array (
0 => 'the_content',
1 => 'custom_fields',
2 => 'discussion',
3 => 'comments',
4 => 'slug',
5 => 'author',
),
),
'menu_order' => 0,
));
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment