Skip to content

Instantly share code, notes, and snippets.

@iamntz

iamntz/acf.php Secret

Created December 26, 2013 08:07
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 iamntz/4818c3e9d5f7c0fdb2f6 to your computer and use it in GitHub Desktop.
Save iamntz/4818c3e9d5f7c0fdb2f6 to your computer and use it in GitHub Desktop.
ACF Import/Export fail
<?php
register_field_group(array (
'id' => 'acf_sports-child',
'title' => 'Sports Child',
'fields' => array (
array (
'key' => 'field_52a06ed37ed04',
'label' => 'Content',
'name' => '',
'type' => 'tab',
),
array (
'key' => 'field_52a06f2115013',
'label' => 'Title',
'name' => 'title',
'type' => 'text',
'instructions' => 'Leave empty to use post title',
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => '',
),
array (
'key' => 'field_52a068a9cc979',
'label' => 'Subtitle',
'name' => 'subtitle',
'type' => 'text',
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => '',
),
array (
'key' => 'field_52a06f2d15014',
'label' => 'Content',
'name' => 'content',
'type' => 'wysiwyg',
'default_value' => '',
'toolbar' => 'basic',
'media_upload' => 'no',
),
array (
'key' => 'field_52a06fd9e18f4',
'label' => 'Image',
'name' => 'image',
'type' => 'image',
'save_format' => 'id',
'preview_size' => 'thumbnail',
'library' => 'all',
),
array (
'key' => 'field_52a07039e18f6',
'label' => 'Image Size',
'name' => 'image_size',
'type' => 'select',
'choices' => array (
'small' => 'Small',
'medium' => 'Medium',
'big' => 'Big',
'huge' => 'Huge (100% wide)',
),
'default_value' => 'medium',
'allow_null' => 0,
'multiple' => 0,
),
array (
'key' => 'field_52a07059e18f7',
'label' => 'Image Alignment',
'name' => 'image_alignment',
'type' => 'select',
'choices' => array (
'auto' => 'Auto (oposite of previous image)',
'alignleft' => 'Left',
'alignright' => 'Right',
),
'default_value' => 'auto',
'allow_null' => 0,
'multiple' => 0,
),
array (
'key' => 'field_52a06ff3e18f5',
'label' => 'Gallery',
'name' => 'gallery',
'type' => 'post_object',
'post_type' => array (
0 => 'my_galleries',
),
'taxonomy' => array (
0 => 'all',
),
'allow_null' => 1,
'multiple' => 0,
),
array (
'key' => 'field_52a06f73b0276',
'label' => 'Links',
'name' => 'links',
'type' => 'repeater',
'sub_fields' => array (
array (
'key' => 'field_52a06f8795aff',
'label' => 'URL',
'name' => 'url',
'type' => 'text',
'column_width' => '',
'default_value' => '',
'placeholder' => 'http://',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => '',
),
array (
'key' => 'field_52a06f8d95b00',
'label' => 'Anchor',
'name' => 'anchor',
'type' => 'text',
'column_width' => '',
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => '',
),
),
'row_min' => 0,
'row_limit' => '',
'layout' => 'table',
'button_label' => 'Add Link',
),
array (
'key' => 'field_52a06fa8847f2',
'label' => 'Show Social Icons',
'name' => 'show_social_icons',
'type' => 'true_false',
'instructions' => 'You can set sharing meta data (such as thumb, description, etc) on parent post.',
'message' => '',
'default_value' => 0,
),
array (
'key' => 'field_52a068bfcc97a',
'label' => 'Has Dark Background?',
'name' => 'is_dark_section',
'type' => 'true_false',
'message' => '',
'default_value' => 0,
),
array (
'key' => 'field_52a06eb4baae0',
'label' => 'Section Settings',
'name' => '',
'type' => 'tab',
),
array (
'key' => 'field_52a0693acc97c',
'label' => 'Section Title',
'name' => 'section_title',
'type' => 'text',
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => '',
),
array (
'key' => 'field_52a06952cc97d',
'label' => 'Section Subtitle',
'name' => 'section_subtitle',
'type' => 'text',
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => '',
),
),
'location' => array (
array (
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'my_sports',
'order_no' => 0,
'group_no' => 0,
),
array (
'param' => 'page_type',
'operator' => '==',
'value' => 'child',
'order_no' => 1,
'group_no' => 0,
),
),
),
'options' => array (
'position' => 'normal',
'layout' => 'default',
'hide_on_screen' => array (
),
),
'menu_order' => -1,
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment