field-group-options.php 3.88 KB
Newer Older
imac's avatar
imac committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
<?php

// active
acf_render_field_wrap(array(
	'label'			=> __('Active','acf'),
	'instructions'	=> '',
	'type'			=> 'true_false',
	'name'			=> 'active',
	'prefix'		=> 'acf_field_group',
	'value'			=> $field_group['active'],
	'ui'			=> 1,
	//'ui_on_text'	=> __('Active', 'acf'),
	//'ui_off_text'	=> __('Inactive', 'acf'),
));


// style
acf_render_field_wrap(array(
	'label'			=> __('Style','acf'),
	'instructions'	=> '',
	'type'			=> 'select',
	'name'			=> 'style',
	'prefix'		=> 'acf_field_group',
	'value'			=> $field_group['style'],
	'choices' 		=> array(
		'default'			=>	__("Standard (WP metabox)",'acf'),
		'seamless'			=>	__("Seamless (no metabox)",'acf'),
	)
));


// position
acf_render_field_wrap(array(
	'label'			=> __('Position','acf'),
	'instructions'	=> '',
	'type'			=> 'select',
	'name'			=> 'position',
	'prefix'		=> 'acf_field_group',
	'value'			=> $field_group['position'],
	'choices' 		=> array(
		'acf_after_title'	=> __("High (after title)",'acf'),
		'normal'			=> __("Normal (after content)",'acf'),
		'side' 				=> __("Side",'acf'),
	),
	'default_value'	=> 'normal'
));


// label_placement
acf_render_field_wrap(array(
	'label'			=> __('Label placement','acf'),
	'instructions'	=> '',
	'type'			=> 'select',
	'name'			=> 'label_placement',
	'prefix'		=> 'acf_field_group',
	'value'			=> $field_group['label_placement'],
	'choices' 		=> array(
		'top'			=>	__("Top aligned",'acf'),
		'left'			=>	__("Left Aligned",'acf'),
	)
));


// instruction_placement
acf_render_field_wrap(array(
	'label'			=> __('Instruction placement','acf'),
	'instructions'	=> '',
	'type'			=> 'select',
	'name'			=> 'instruction_placement',
	'prefix'		=> 'acf_field_group',
	'value'			=> $field_group['instruction_placement'],
	'choices' 		=> array(
		'label'		=>	__("Below labels",'acf'),
		'field'		=>	__("Below fields",'acf'),
	)
));


// menu_order
acf_render_field_wrap(array(
	'label'			=> __('Order No.','acf'),
	'instructions'	=> __('Field groups with a lower order will appear first','acf'),
	'type'			=> 'number',
	'name'			=> 'menu_order',
	'prefix'		=> 'acf_field_group',
	'value'			=> $field_group['menu_order'],
));


// description
acf_render_field_wrap(array(
	'label'			=> __('Description','acf'),
	'instructions'	=> __('Shown in field group list','acf'),
	'type'			=> 'text',
	'name'			=> 'description',
	'prefix'		=> 'acf_field_group',
	'value'			=> $field_group['description'],
));


// hide on screen
acf_render_field_wrap(array(
	'label'			=> __('Hide on screen','acf'),
	'instructions'	=> __('<b>Select</b> items to <b>hide</b> them from the edit screen.','acf') . '<br /><br />' . __("If multiple field groups appear on an edit screen, the first field group's options will be used (the one with the lowest order number)",'acf'),
	'type'			=> 'checkbox',
	'name'			=> 'hide_on_screen',
	'prefix'		=> 'acf_field_group',
	'value'			=> $field_group['hide_on_screen'],
	'toggle'		=> true,
	'choices' => array(
		'permalink'			=>	__("Permalink", 'acf'),
		'the_content'		=>	__("Content Editor",'acf'),
		'excerpt'			=>	__("Excerpt", 'acf'),
		'custom_fields'		=>	__("Custom Fields", 'acf'),
		'discussion'		=>	__("Discussion", 'acf'),
		'comments'			=>	__("Comments", 'acf'),
		'revisions'			=>	__("Revisions", 'acf'),
		'slug'				=>	__("Slug", 'acf'),
		'author'			=>	__("Author", 'acf'),
		'format'			=>	__("Format", 'acf'),
		'page_attributes'	=>	__("Page Attributes", 'acf'),
		'featured_image'	=>	__("Featured Image", 'acf'),
		'categories'		=>	__("Categories", 'acf'),
		'tags'				=>	__("Tags", 'acf'),
		'send-trackbacks'	=>	__("Send Trackbacks", 'acf'),
	)
));


// 3rd party settings
do_action('acf/render_field_group_settings', $field_group);
		
?>
<div class="acf-hidden">
	<input type="hidden" name="acf_field_group[key]" value="<?php echo $field_group['key']; ?>" />
</div>
<script type="text/javascript">
if( typeof acf !== 'undefined' ) {
		
	acf.postbox.render({
		'id': 'acf-field-group-options',
		'label': 'left'
	});	

}
</script>