Advertisement
Guest User

ACF PHP

a guest
Dec 2nd, 2022
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.33 KB | None | 0 0
  1. if( function_exists('acf_add_local_field_group') ):
  2.  
  3. acf_add_local_field_group(array(
  4. 'key' => 'group_5f6480d09ed3f',
  5. 'title' => 'Footer Settings',
  6. 'fields' => array(
  7. array(
  8. 'key' => 'field_5f6480dbf9583',
  9. 'label' => 'Social Media',
  10. 'name' => 'social_media',
  11. 'aria-label' => '',
  12. 'type' => 'repeater',
  13. 'instructions' => '',
  14. 'required' => 0,
  15. 'conditional_logic' => 0,
  16. 'wrapper' => array(
  17. 'width' => '',
  18. 'class' => '',
  19. 'id' => '',
  20. ),
  21. 'collapsed' => 'field_5f6480e7f9584',
  22. 'min' => 0,
  23. 'max' => 0,
  24. 'layout' => 'table',
  25. 'button_label' => 'Add Social Media',
  26. 'rows_per_page' => 20,
  27. 'sub_fields' => array(
  28. array(
  29. 'key' => 'field_5f6480e7f9584',
  30. 'label' => 'Title',
  31. 'name' => 'title',
  32. 'aria-label' => '',
  33. 'type' => 'text',
  34. 'instructions' => '',
  35. 'required' => 0,
  36. 'conditional_logic' => 0,
  37. 'wrapper' => array(
  38. 'width' => '',
  39. 'class' => '',
  40. 'id' => '',
  41. ),
  42. 'default_value' => '',
  43. 'placeholder' => '',
  44. 'prepend' => '',
  45. 'append' => '',
  46. 'maxlength' => '',
  47. 'parent_repeater' => 'field_5f6480dbf9583',
  48. ),
  49. array(
  50. 'key' => 'field_5f6480eff9585',
  51. 'label' => 'URL',
  52. 'name' => 'url',
  53. 'aria-label' => '',
  54. 'type' => 'url',
  55. 'instructions' => '',
  56. 'required' => 0,
  57. 'conditional_logic' => 0,
  58. 'wrapper' => array(
  59. 'width' => '',
  60. 'class' => '',
  61. 'id' => '',
  62. ),
  63. 'default_value' => '',
  64. 'placeholder' => '',
  65. 'parent_repeater' => 'field_5f6480dbf9583',
  66. ),
  67. ),
  68. ),
  69. array(
  70. 'key' => 'field_5f6480f9f9586',
  71. 'label' => 'Offices',
  72. 'name' => 'offices',
  73. 'aria-label' => '',
  74. 'type' => 'repeater',
  75. 'instructions' => '',
  76. 'required' => 0,
  77. 'conditional_logic' => 0,
  78. 'wrapper' => array(
  79. 'width' => '',
  80. 'class' => '',
  81. 'id' => '',
  82. ),
  83. 'collapsed' => 'field_5f648130f9587',
  84. 'min' => 0,
  85. 'max' => 0,
  86. 'layout' => 'table',
  87. 'button_label' => 'Add Office',
  88. 'rows_per_page' => 20,
  89. 'sub_fields' => array(
  90. array(
  91. 'key' => 'field_5f648130f9587',
  92. 'label' => 'Title',
  93. 'name' => 'title',
  94. 'aria-label' => '',
  95. 'type' => 'textarea',
  96. 'instructions' => '',
  97. 'required' => 1,
  98. 'conditional_logic' => 0,
  99. 'wrapper' => array(
  100. 'width' => '',
  101. 'class' => '',
  102. 'id' => '',
  103. ),
  104. 'default_value' => '',
  105. 'placeholder' => '',
  106. 'maxlength' => '',
  107. 'rows' => 2,
  108. 'new_lines' => 'br',
  109. 'parent_repeater' => 'field_5f6480f9f9586',
  110. ),
  111. array(
  112. 'key' => 'field_5f648171f9589',
  113. 'label' => 'Address',
  114. 'name' => 'address',
  115. 'aria-label' => '',
  116. 'type' => 'textarea',
  117. 'instructions' => '',
  118. 'required' => 1,
  119. 'conditional_logic' => 0,
  120. 'wrapper' => array(
  121. 'width' => '',
  122. 'class' => '',
  123. 'id' => '',
  124. ),
  125. 'default_value' => '',
  126. 'placeholder' => '',
  127. 'maxlength' => '',
  128. 'rows' => 2,
  129. 'new_lines' => 'br',
  130. 'parent_repeater' => 'field_5f6480f9f9586',
  131. ),
  132. array(
  133. 'key' => 'field_5f64818ff958a',
  134. 'label' => 'Contact Information',
  135. 'name' => 'contact_information',
  136. 'aria-label' => '',
  137. 'type' => 'textarea',
  138. 'instructions' => '',
  139. 'required' => 0,
  140. 'conditional_logic' => 0,
  141. 'wrapper' => array(
  142. 'width' => '',
  143. 'class' => '',
  144. 'id' => '',
  145. ),
  146. 'default_value' => '',
  147. 'placeholder' => '',
  148. 'maxlength' => '',
  149. 'rows' => 2,
  150. 'new_lines' => 'br',
  151. 'parent_repeater' => 'field_5f6480f9f9586',
  152. ),
  153. ),
  154. ),
  155. array(
  156. 'key' => 'field_60e45da863086',
  157. 'label' => 'Logotypes Section',
  158. 'name' => 'logotypes_section',
  159. 'aria-label' => '',
  160. 'type' => 'group',
  161. 'instructions' => 'Logotypes that will be added above the footer on every page.',
  162. 'required' => 0,
  163. 'conditional_logic' => 0,
  164. 'wrapper' => array(
  165. 'width' => '',
  166. 'class' => '',
  167. 'id' => '',
  168. ),
  169. 'layout' => 'block',
  170. 'sub_fields' => array(
  171. array(
  172. 'key' => 'field_60e45e9263087',
  173. 'label' => 'Title',
  174. 'name' => 'logotypes_title',
  175. 'aria-label' => '',
  176. 'type' => 'text',
  177. 'instructions' => '',
  178. 'required' => 0,
  179. 'conditional_logic' => 0,
  180. 'wrapper' => array(
  181. 'width' => '',
  182. 'class' => '',
  183. 'id' => '',
  184. ),
  185. 'default_value' => '',
  186. 'placeholder' => '',
  187. 'prepend' => '',
  188. 'append' => '',
  189. 'maxlength' => '',
  190. ),
  191. array(
  192. 'key' => 'field_60e45e9763088',
  193. 'label' => 'Logotypes',
  194. 'name' => 'logotypes',
  195. 'aria-label' => '',
  196. 'type' => 'repeater',
  197. 'instructions' => '',
  198. 'required' => 0,
  199. 'conditional_logic' => 0,
  200. 'wrapper' => array(
  201. 'width' => '',
  202. 'class' => '',
  203. 'id' => '',
  204. ),
  205. 'collapsed' => 'field_60e45ea163089',
  206. 'min' => 0,
  207. 'max' => 0,
  208. 'layout' => 'table',
  209. 'button_label' => 'Add Row',
  210. 'rows_per_page' => 20,
  211. 'sub_fields' => array(
  212. array(
  213. 'key' => 'field_60e45ea163089',
  214. 'label' => 'Logotype',
  215. 'name' => 'logotype',
  216. 'aria-label' => '',
  217. 'type' => 'image',
  218. 'instructions' => 'Aspect Ratio should be 2:1 (for example 2560x1280 pixels).',
  219. 'required' => 1,
  220. 'conditional_logic' => 0,
  221. 'wrapper' => array(
  222. 'width' => '',
  223. 'class' => '',
  224. 'id' => '',
  225. ),
  226. 'return_format' => 'array',
  227. 'preview_size' => 'medium',
  228. 'library' => 'all',
  229. 'min_width' => '',
  230. 'min_height' => '',
  231. 'min_size' => '',
  232. 'max_width' => '',
  233. 'max_height' => '',
  234. 'max_size' => '',
  235. 'mime_types' => '',
  236. 'parent_repeater' => 'field_60e45e9763088',
  237. ),
  238. array(
  239. 'key' => 'field_60e45f286308a',
  240. 'label' => 'URL',
  241. 'name' => 'url',
  242. 'aria-label' => '',
  243. 'type' => 'url',
  244. 'instructions' => '',
  245. 'required' => 0,
  246. 'conditional_logic' => 0,
  247. 'wrapper' => array(
  248. 'width' => '',
  249. 'class' => '',
  250. 'id' => '',
  251. ),
  252. 'default_value' => '',
  253. 'placeholder' => '',
  254. 'parent_repeater' => 'field_60e45e9763088',
  255. ),
  256. ),
  257. ),
  258. array(
  259. 'key' => 'field_60e5646036b52',
  260. 'label' => 'Column Amount',
  261. 'name' => 'column_amount',
  262. 'aria-label' => '',
  263. 'type' => 'select',
  264. 'instructions' => '',
  265. 'required' => 0,
  266. 'conditional_logic' => 0,
  267. 'wrapper' => array(
  268. 'width' => '',
  269. 'class' => '',
  270. 'id' => '',
  271. ),
  272. 'choices' => array(
  273. 3 => '3',
  274. 4 => '4',
  275. 5 => '5',
  276. 6 => '6',
  277. ),
  278. 'default_value' => 6,
  279. 'allow_null' => 0,
  280. 'multiple' => 0,
  281. 'ui' => 0,
  282. 'return_format' => 'value',
  283. 'ajax' => 0,
  284. 'placeholder' => '',
  285. ),
  286. ),
  287. ),
  288. ),
  289. 'location' => array(
  290. array(
  291. array(
  292. 'param' => 'options_page',
  293. 'operator' => '==',
  294. 'value' => 'footer-settings',
  295. ),
  296. ),
  297. ),
  298. 'menu_order' => 0,
  299. 'position' => 'normal',
  300. 'style' => 'default',
  301. 'label_placement' => 'top',
  302. 'instruction_placement' => 'label',
  303. 'hide_on_screen' => '',
  304. 'active' => true,
  305. 'description' => '',
  306. 'show_in_rest' => false,
  307. ));
  308.  
  309. acf_add_local_field_group(array(
  310. 'key' => 'group_5f634538994a0',
  311. 'title' => 'Modules',
  312. 'fields' => array(
  313. array(
  314. 'key' => 'field_5f63453b94f9d',
  315. 'label' => 'Columns',
  316. 'name' => 'columns',
  317. 'aria-label' => '',
  318. 'type' => 'text',
  319. 'instructions' => '',
  320. 'required' => false,
  321. 'conditional_logic' => false,
  322. 'wrapper' => array(
  323. 'width' => '',
  324. 'class' => '',
  325. 'id' => '',
  326. ),
  327. 0 => false,
  328. 'default_value' => '',
  329. 'maxlength' => '',
  330. 'placeholder' => '',
  331. 'prepend' => '',
  332. 'append' => '',
  333. ),
  334. ),
  335. 'location' => array(
  336. array(
  337. array(
  338. 'param' => 'page_template',
  339. 'operator' => '==',
  340. 'value' => 'page-modules.php',
  341. ),
  342. ),
  343. ),
  344. 'menu_order' => 0,
  345. 'position' => 'normal',
  346. 'style' => 'default',
  347. 'label_placement' => 'top',
  348. 'instruction_placement' => 'label',
  349. 'hide_on_screen' => '',
  350. 'active' => true,
  351. 'description' => '',
  352. 'show_in_rest' => false,
  353. ));
  354.  
  355. endif;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement