Skip to content

Instantly share code, notes, and snippets.

@JulieKuehl
Created June 14, 2016 20:47
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 JulieKuehl/10ce4300ea5e92f6d71bd2d1578c3abe to your computer and use it in GitHub Desktop.
Save JulieKuehl/10ce4300ea5e92f6d71bd2d1578c3abe to your computer and use it in GitHub Desktop.
ACF Flexible Content fields
// Register fields for Research custom post type
register_field_group( array(
'id' => 'acf_research',
'title' => 'Research',
'fields' => array(
array(
'key' => 'field_57601b07bf178',
'label' => 'Published Date',
'name' => 'published_date',
'type' => 'date_picker',
'instructions' => 'Add the publishing date. Only the month and year will be selected.',
'required' => 1,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'first_day' => 1,
'return_format' => 'Ymd',
'display_format' => 'm/Y/d',
),
array(
'key' => 'field_57601c66bf179',
'label' => 'Hashtag',
'name' => 'hashtag',
'type' => 'text',
'instructions' => 'Two words words best.',
'required' => 1,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => '',
'readonly' => 0,
'disabled' => 0,
),
array(
'key' => 'field_57601c97bf17a',
'label' => 'Report',
'name' => 'report',
'type' => 'text',
'instructions' => 'Add the URL to the report. Be sure to include the http(s).',
'required' => 1,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => '',
'readonly' => 0,
'disabled' => 0,
),
array(
'key' => 'field_576048298fe82',
'label' => 'Quote',
'name' => 'quote',
'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_57601cef07e33',
'label' => 'Content Formats',
'name' => 'content_formats',
'type' => 'flexible_content',
'instructions' => 'Choose the type of content that you would like to display.',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'button_label' => 'Add Content Block',
'min' => '',
'max' => '',
'layouts' => array(
array(
'key' => '576030a708a34',
'name' => 'text_block',
'label' => 'Text Block',
'display' => 'block',
'sub_fields' => array(
array(
'key' => 'field_576048588fe83',
'label' => 'Text',
'name' => 'text',
'type' => 'textarea',
'instructions' => '',
'required' => '',
'conditional_logic' => '',
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'maxlength' => '',
'rows' => '',
'new_lines' => 'wpautop',
'readonly' => 0,
'disabled' => 0,
),
),
'min' => '',
'max' => '',
),
array(
'key' => '576048878fe84',
'name' => 'photo_gallery_block',
'label' => 'Photo Gallery Block',
'display' => 'block',
'sub_fields' => array(
array(
'key' => 'field_576048968fe85',
'label' => 'Photo Gallery',
'name' => 'photo_gallery',
'type' => 'post_object',
'instructions' => '',
'required' => '',
'conditional_logic' => '',
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'post_type' => array(
0 => 'gallery',
),
'taxonomy' => array(),
'allow_null' => '',
'multiple' => '',
'return_format' => '',
'ui' => 1,
),
),
'min' => '',
'max' => '',
),
array(
'key' => '576048d08fe86',
'name' => 'wide_four_columns_icons_block',
'label' => 'Wide 4-Column Icons Block',
'display' => 'block',
'sub_fields' => array(
array(
'key' => 'field_576048e98fe87',
'label' => 'Icon Pre-text',
'name' => 'wide_four_columns_icon_pretext',
'type' => 'text',
'instructions' => '',
'required' => '',
'conditional_logic' => '',
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
'readonly' => 0,
'disabled' => 0,
),
array(
'key' => 'field_576049138fe88',
'label' => 'Icon',
'name' => 'wide_four_columns_icon',
'type' => 'image',
'instructions' => '',
'required' => '',
'conditional_logic' => '',
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'return_format' => 'array',
'preview_size' => 'thumbnail',
'library' => 'all',
'min_width' => '',
'min_height' => '',
'min_size' => '',
'max_width' => '',
'max_height' => '',
'max_size' => '',
'mime_types' => '',
),
array(
'key' => 'field_5760495c8fe89',
'label' => 'Icon Title',
'name' => 'wide_four_columns_icon_title',
'type' => 'text',
'instructions' => '',
'required' => '',
'conditional_logic' => '',
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
'readonly' => 0,
'disabled' => 0,
),
array(
'key' => 'field_576049768fe8a',
'label' => 'Icon Description',
'name' => 'wide_four_columns_icon_description',
'type' => 'text',
'instructions' => '',
'required' => '',
'conditional_logic' => '',
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
'readonly' => 0,
'disabled' => 0,
),
),
'min' => '',
'max' => '',
),
array(
'key' => '576049b4b829f',
'name' => 'normal_four_columns_icons_block',
'label' => 'Normal 4-Columns Icons Block',
'display' => 'block',
'sub_fields' => array(
array(
'key' => 'field_576049b4b82a0',
'label' => 'Icon Pre-text',
'name' => 'normal_four_columns_icon_pretext',
'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_576049b4b82a1',
'label' => 'Icon',
'name' => 'normal_four_columns_icon',
'type' => 'image',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'return_format' => 'array',
'preview_size' => 'thumbnail',
'library' => 'all',
'min_width' => '',
'min_height' => '',
'min_size' => '',
'max_width' => '',
'max_height' => '',
'max_size' => '',
'mime_types' => '',
),
array(
'key' => 'field_576049b4b82a2',
'label' => 'Icon Title',
'name' => 'normal_four_columns_icon_title',
'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_576049b4b82a3',
'label' => 'Icon Description',
'name' => 'normal_four_columns_icon_description',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
'readonly' => 0,
'disabled' => 0,
),
),
'min' => '',
'max' => '',
),
array(
'key' => '57604a6c441ac',
'name' => 'video_block',
'label' => 'Video',
'display' => 'block',
'sub_fields' => array(
array(
'key' => 'field_57604a76441ad',
'label' => 'Video',
'name' => 'video',
'type' => 'oembed',
'instructions' => 'Add a URL to a YouTube or Vimeo video.',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'width' => '',
'height' => '',
),
),
'min' => '',
'max' => '',
),
),
),
),
'location' => array(
array(
array(
'param' => 'post_type',
'operator' => '==',
'value' => 'research',
),
),
),
'menu_order' => 0,
'position' => 'normal',
'style' => 'seamless',
'label_placement' => 'top',
'instruction_placement' => 'label',
'hide_on_screen' => '',
'active' => 1,
'description' => '',
) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment