This repository was archived by the owner on Oct 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathacf.php
More file actions
211 lines (204 loc) · 4.88 KB
/
acf.php
File metadata and controls
211 lines (204 loc) · 4.88 KB
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<?php
/**
* Install Add-ons
*
* The following code will include all 4 premium Add-Ons in your theme.
* Please do not attempt to include a file which does not exist. This will produce an error.
*
* All fields must be included during the 'acf/register_fields' action.
* Other types of Add-ons (like the options page) can be included outside of this action.
*
* The following code assumes you have a folder 'add-ons' inside your theme.
*
* IMPORTANT
* Add-ons may be included in a premium theme as outlined in the terms and conditions.
* However, they are NOT to be included in a premium / free plugin.
* For more information, please read http://www.advancedcustomfields.com/terms-conditions/
*/
// Fields
add_action('acf/register_fields', 'my_register_fields');
function my_register_fields()
{
//include_once('add-ons/acf-repeater/repeater.php');
//include_once('add-ons/acf-gallery/gallery.php');
//include_once('add-ons/acf-flexible-content/flexible-content.php');
}
// Options Page
//include_once( 'add-ons/acf-options-page/acf-options-page.php' );
/**
* Register Field Groups
*
* The register_field_group function accepts 1 array which holds the relevant data to register a field group
* You may edit the array as you see fit. However, this may result in errors if the array is not compatible with ACF
*/
if(function_exists("register_field_group"))
{
register_field_group(array (
'id' => 'acf_seo',
'title' => 'SEO',
'fields' => array (
array (
'key' => 'field_51c1b1ae483b1',
'label' => 'SEO Title',
'name' => 'seo_title',
'type' => 'text',
'default_value' => '',
'formatting' => 'html',
),
array (
'key' => 'field_51c1b1c4483b2',
'label' => 'SEO Heading',
'name' => 'seo_heading',
'type' => 'text',
'default_value' => '',
'formatting' => 'html',
),
array (
'key' => 'field_51c1b1cd483b3',
'label' => 'SEO Description',
'name' => 'seo_description',
'type' => 'textarea',
'default_value' => '',
'formatting' => 'html',
),
),
'location' => array (
array (
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'post',
'order_no' => 0,
'group_no' => 0,
),
),
array (
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'page',
'order_no' => 0,
'group_no' => 1,
),
),
),
'options' => array (
'position' => 'side',
'layout' => 'no_box',
'hide_on_screen' => array (
),
),
'menu_order' => 10,
));
}
if(function_exists("register_field_group"))
{
register_field_group(array (
'id' => 'acf_options',
'title' => 'Options',
'fields' => array (
array (
'key' => 'field_5284c77210b08',
'label' => 'Telephone',
'name' => 'telephone',
'type' => 'text',
'required' => 0,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => '',
),
array (
'key' => 'field_5284c98c10b09',
'label' => 'Email',
'name' => 'email',
'type' => 'email',
'required' => 0,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
),
array (
'key' => 'field_5284c99b10b0a',
'label' => 'Address',
'name' => 'address',
'type' => 'textarea',
'required' => 0,
'default_value' => '',
'placeholder' => '',
'maxlength' => '',
'formatting' => 'br',
),
array (
'key' => 'field_5284dcc26357c',
'label' => 'Registered address',
'name' => 'registered_address',
'type' => 'textarea',
'required' => 0,
'default_value' => '',
'placeholder' => '',
'maxlength' => '',
'formatting' => 'br',
),
array (
'key' => 'field_5284dd566a323',
'label' => 'Registered number',
'name' => 'registered_number',
'type' => 'number',
'required' => 0,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'min' => '',
'max' => '',
'step' => '',
),
array (
'key' => 'field_5284dd6a6a324',
'label' => 'Registered country',
'name' => 'registered_country',
'type' => 'text',
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => '',
),
array (
'key' => 'field_5284dd796a325',
'label' => 'VAT number',
'name' => 'vat_number',
'type' => 'text',
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => '',
),
),
'location' => array (
array (
array (
'param' => 'options_page',
'operator' => '==',
'value' => 'acf-options',
'order_no' => 0,
'group_no' => 0,
),
),
),
'options' => array (
'position' => 'normal',
'layout' => 'no_box',
'hide_on_screen' => array (
),
),
'menu_order' => 0,
));
}