Skip to content

Instantly share code, notes, and snippets.

@jamesmthornton
Created August 15, 2018 19:53
Show Gist options
  • Save jamesmthornton/c2547292ee321334ef953ea913667290 to your computer and use it in GitHub Desktop.
Save jamesmthornton/c2547292ee321334ef953ea913667290 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_560aae855e3b5',
'title' => 'Press',
'fields' => array(
array(
'key' => 'field_560aae8e3338a',
'label' => 'Press Source',
'name' => 'press_source',
'type' => 'image',
'instructions' => 'We\'re just looking for the logo here - 300x300 logo on clear bg (png).',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'return_format' => 'url',
'preview_size' => 'medium',
'library' => 'all',
'min_width' => '',
'min_height' => '',
'min_size' => '',
'max_width' => '',
'max_height' => '',
'max_size' => '',
'mime_types' => '',
),
array(
'key' => 'field_560ab882c6ef1',
'label' => '2x Press Source Logo',
'name' => 'press_2x_source',
'type' => 'image',
'instructions' => 'Upload a 600x600 press source logo for retina display ie. remodelista@2x.png - don\'t forget the 2x!',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'return_format' => 'url',
'preview_size' => 'press-2x',
'library' => 'all',
'min_width' => '',
'min_height' => '',
'min_size' => '',
'max_width' => '',
'max_height' => '',
'max_size' => '',
'mime_types' => '',
),
array(
'key' => 'field_560aaece3338b',
'label' => 'Press Link',
'name' => 'press_link',
'type' => 'url',
'instructions' => 'Full press link with http:// included plz.',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
),
array(
'key' => 'field_560aaef83338c',
'label' => 'Press Featured Thumbnail',
'name' => 'press_thumbnail',
'type' => 'image',
'instructions' => 'Upload/select the background image you would like to use (will show with low opacity).',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'return_format' => 'url',
'preview_size' => 'medium',
'library' => 'all',
'min_width' => '',
'min_height' => '',
'min_size' => '',
'max_width' => '',
'max_height' => '',
'max_size' => '',
'mime_types' => '',
),
array(
'key' => 'field_560abc73e3969',
'label' => 'press source svg',
'name' => 'press_source_svg',
'type' => 'image',
'instructions' => 'A place to upload a .svg file if we\'re going in the direction of crispy. Illustrator exported svgs have to 1) have comments stripped out 2) have width="##px" and height="##px" removed from <svg> tag in a code editor and 3) svg tag viewbox parameter should be a square shape ie 0 0 300 300.',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'return_format' => 'url',
'preview_size' => 'full',
'library' => 'all',
'min_width' => '',
'min_height' => '',
'min_size' => '',
'max_width' => '',
'max_height' => '',
'max_size' => '',
'mime_types' => '',
),
array(
'key' => 'field_560b4a97866dc',
'label' => 'Press Source Text',
'name' => 'press_source_text',
'type' => 'text',
'instructions' => 'Just write the name of the press source as your want it to appear i.e. Remodelista',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
'readonly' => 0,
'disabled' => 0,
),
array(
'key' => 'field_560b4b4158b4d',
'label' => 'Date of press',
'name' => 'date_of_press',
'type' => 'text',
'instructions' => 'Short hand for Month and Year i.e. Jan 2012',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
'readonly' => 0,
'disabled' => 0,
),
),
'location' => array(
array(
array(
'param' => 'post_type',
'operator' => '==',
'value' => 'press',
),
),
),
'menu_order' => 0,
'position' => 'acf_after_title',
'style' => 'default',
'label_placement' => 'top',
'instruction_placement' => 'label',
'hide_on_screen' => array(
0 => 'the_content',
1 => 'featured_image',
2 => 'categories',
3 => 'send-trackbacks',
),
'active' => 1,
'description' => '',
));
acf_add_local_field_group(array(
'key' => 'group_5a2dd9e113c3b',
'title' => 'Timeline',
'fields' => array(
array(
'key' => 'field_5a2dd9e60a5e4',
'label' => 'timeline-item',
'name' => 'timeline-item',
'type' => 'repeater',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'collapsed' => '',
'min' => 0,
'max' => 0,
'layout' => 'table',
'button_label' => '',
'sub_fields' => array(
array(
'key' => 'field_5a2dda040a5e5',
'label' => 'timeline-img',
'name' => 'timeline-img',
'type' => 'image',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'return_format' => 'url',
'preview_size' => 'thumbnail',
'library' => 'all',
'min_width' => '',
'min_height' => '',
'min_size' => '',
'max_width' => '',
'max_height' => '',
'max_size' => '',
'mime_types' => '',
),
array(
'key' => 'field_5a2dda1d0a5e6',
'label' => 'timeline-title',
'name' => 'timeline-title',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '<h3>',
'append' => '</h3>',
'maxlength' => '',
),
array(
'key' => 'field_5a2dda4e0a5e7',
'label' => 'timeline-text',
'name' => 'timeline-text',
'type' => 'textarea',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'maxlength' => '',
'rows' => 4,
'new_lines' => '',
),
array(
'key' => 'field_5a2dda7db084f',
'label' => 'timeline-accent',
'name' => 'timeline-accent',
'type' => 'radio',
'instructions' => 'define 1, 2 and 3 here',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'choices' => array(
1 => '1',
2 => '2',
3 => '3',
),
'allow_null' => 0,
'other_choice' => 0,
'save_other_choice' => 0,
'default_value' => '',
'layout' => 'vertical',
'return_format' => 'value',
),
array(
'key' => 'field_5a2ddc6145d02',
'label' => 'timeline-date',
'name' => 'timeline-date',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '<span>',
'append' => '</span>',
'maxlength' => '',
),
array(
'key' => 'field_5a2ddc7145d03',
'label' => '',
'name' => '',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
),
),
),
'location' => array(
array(
array(
'param' => 'post_type',
'operator' => '==',
'value' => 'timeline',
),
),
),
'menu_order' => 0,
'position' => 'normal',
'style' => 'default',
'label_placement' => 'top',
'instruction_placement' => 'label',
'hide_on_screen' => '',
'active' => 1,
'description' => '',
));
endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment