Skip to content

Instantly share code, notes, and snippets.

@secretstache
Last active August 2, 2016 02:23
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 secretstache/d40fed3af85900f2b0409499829954c0 to your computer and use it in GitHub Desktop.
Save secretstache/d40fed3af85900f2b0409499829954c0 to your computer and use it in GitHub Desktop.
<?php
if( function_exists('acf_add_local_field_group') ):
acf_add_local_field_group(array (
'key' => 'group_5525dfd96b4a0',
'title' => 'Brand Logo',
'fields' => array (
array (
'key' => 'field_5525dff1be331',
'label' => 'Image',
'name' => 'brand_logo',
'type' => 'image',
'instructions' => 'For best results, use an <strong>SVG</strong> Image',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'return_format' => 'array',
'preview_size' => 'large',
'library' => 'all',
'min_width' => '',
'min_height' => '',
'min_size' => '',
'max_width' => '',
'max_height' => '',
'max_size' => '',
'mime_types' => 'svg, png, jpg, jpeg',
),
),
'location' => array (
array (
array (
'param' => 'options_page',
'operator' => '==',
'value' => 'acf-options-brand-options',
),
),
),
'menu_order' => 0,
'position' => 'normal',
'style' => 'default',
'label_placement' => 'top',
'instruction_placement' => 'label',
'hide_on_screen' => '',
'active' => 1,
'description' => '',
'modified' => 1435531844,
'local' => 'json',
));
acf_add_local_field_group(array (
'key' => 'group_5525df1cf14e3',
'title' => 'Business Information',
'fields' => array (
array (
'key' => 'field_5525df26536f3',
'label' => 'Legal Business Name',
'name' => 'legal_business_name',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
'readonly' => 0,
'disabled' => 0,
),
array (
'key' => 'field_5525df35536f4',
'label' => 'Address (Line 1)',
'name' => 'address_line_1',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
'readonly' => 0,
'disabled' => 0,
),
array (
'key' => 'field_5525df4f536f5',
'label' => 'Address (Line 2)',
'name' => 'address_line_2',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
'readonly' => 0,
'disabled' => 0,
),
array (
'key' => 'field_5525df61536f6',
'label' => 'City',
'name' => 'city',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => 33,
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
'readonly' => 0,
'disabled' => 0,
),
array (
'key' => 'field_5525df6f536f7',
'label' => 'State',
'name' => 'state',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => 34,
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
'readonly' => 0,
'disabled' => 0,
),
array (
'key' => 'field_5525df7f536f8',
'label' => 'Zipcode',
'name' => 'zipcode',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => 33,
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
'readonly' => 0,
'disabled' => 0,
),
array (
'key' => 'field_552a869e0b256',
'label' => 'Default Email',
'name' => 'default_email',
'type' => 'email',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => 50,
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
),
array (
'key' => 'field_552a86b30b257',
'label' => 'Phone Number',
'name' => 'phone_number',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => 50,
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
'readonly' => 0,
'disabled' => 0,
),
),
'location' => array (
array (
array (
'param' => 'options_page',
'operator' => '==',
'value' => 'acf-options-brand-options',
),
),
),
'menu_order' => 0,
'position' => 'normal',
'style' => 'default',
'label_placement' => 'top',
'instruction_placement' => 'label',
'hide_on_screen' => '',
'active' => 1,
'description' => '',
'modified' => 1435531862,
'local' => 'json',
));
acf_add_local_field_group(array (
'key' => 'group_5525e16acc8ba',
'title' => 'Footer',
'fields' => array (
array (
'key' => 'field_5525e17465ea1',
'label' => 'Copy',
'name' => 'content',
'type' => 'wysiwyg',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => 'Copyright [footer_copyright]. All Rights Reserved.',
'tabs' => 'all',
'toolbar' => 'full',
'media_upload' => 0,
),
array (
'key' => 'field_5525e275f333a',
'label' => 'Menu',
'name' => 'footer_menu',
'type' => 'nav_menu',
'instructions' => 'An <strong>Optional</strong> Menu to add to the footer',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'save_format' => 'id',
'container' => 'nav',
'allow_null' => 1,
),
array (
'key' => 'field_5532b5838ca63',
'label' => 'Landing Page Menu',
'name' => 'landing_page_menu',
'type' => 'nav_menu',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'save_format' => 'id',
'container' => 'nav',
'allow_null' => 0,
),
array (
'key' => 'field_552bd0be1cb0a',
'label' => 'Include Social Networks?',
'name' => 'include_social_networks',
'type' => 'radio',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'choices' => array (
'Yes' => 'Yes',
'No' => 'No',
),
'other_choice' => 0,
'save_other_choice' => 0,
'default_value' => 'Yes',
'layout' => 'horizontal',
'allow_null' => 0,
),
array (
'key' => 'field_558a062e11194',
'label' => 'Note',
'name' => '',
'type' => 'message',
'instructions' => '',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_552bd0be1cb0a',
'operator' => '==',
'value' => 'Yes',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'message' => 'Choose Social Networks <a href="#acf-group_5525e0c443cc8">Below</a>.',
'esc_html' => 0,
'new_lines' => 'wpautop',
),
),
'location' => array (
array (
array (
'param' => 'options_page',
'operator' => '==',
'value' => 'acf-options-brand-options',
),
),
),
'menu_order' => 20,
'position' => 'normal',
'style' => 'default',
'label_placement' => 'top',
'instruction_placement' => 'label',
'hide_on_screen' => '',
'active' => 1,
'description' => '',
'modified' => 1435531894,
'local' => 'json',
));
acf_add_local_field_group(array (
'key' => 'group_5525e0c443cc8',
'title' => 'Social Networks',
'fields' => array (
array (
'key' => 'field_5525e0d292ac5',
'label' => 'Facebook',
'name' => 'facebook',
'type' => 'url',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
),
array (
'key' => 'field_5525e0e992ac6',
'label' => 'Twitter',
'name' => 'twitter',
'type' => 'url',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
),
array (
'key' => 'field_5525e0f792ac7',
'label' => 'Instagram',
'name' => 'instagram',
'type' => 'url',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
),
array (
'key' => 'field_5525e10892ac8',
'label' => 'Linkedin',
'name' => 'linkedin',
'type' => 'url',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
),
array (
'key' => 'field_5525e11192ac9',
'label' => 'Google+',
'name' => 'google_plus',
'type' => 'url',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
),
array (
'key' => 'field_5525e12392aca',
'label' => 'Youtube',
'name' => 'youtube',
'type' => 'url',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
),
array (
'key' => 'field_5525e12c92acb',
'label' => 'Vimeo',
'name' => 'vimeo',
'type' => 'url',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
),
),
'location' => array (
array (
array (
'param' => 'options_page',
'operator' => '==',
'value' => 'acf-options-brand-options',
),
),
),
'menu_order' => 99,
'position' => 'normal',
'style' => 'default',
'label_placement' => 'top',
'instruction_placement' => 'label',
'hide_on_screen' => '',
'active' => 1,
'description' => '',
'modified' => 1435531908,
'local' => 'json',
));
endif;
<?php
/**
* Creates ACF Options Page(s)
*/
if( function_exists('acf_add_options_sub_page') ) {
acf_add_options_page('Brand Options');
acf_add_options_sub_page(array(
'title' => 'Brand Options',
'parent' => 'options-general.php',
'capability' => 'manage_options'
));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment