Advanced Custom Fields PHP field types - markhowellsmead/helpers GitHub Wiki
Generator
- ACF field generator with random IDs (19.3.2021)
Field locations
News archive page
'location' => [
[
[
'param' => 'page_type',
'operator' => '==',
'value' => 'posts_page',
],
],
],
Field Types
Copy + paste for acf_add_local_field_group
.
Color
[
'key' => 'color',
'label' => _x('Farbe', 'ACF field label', 'sha'),
'name' => 'color',
'type' => 'color_picker',
'instructions' => _x('Instructions', 'ACF field label', 'sha'),
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
],
'default_value' => '#fff',
],
[
'key' => 'sht_email',
'label' => _x('E-Mail-Adresse', 'ACF field label', 'sha'),
'name' => 'sht_email',
'type' => 'email',
'instructions' => _x('Instructions', 'ACF field label', 'sha'),
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
],
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
],
File
[
'key' => 'sht_download',
'label' => _x('Download', 'ACF field label', 'sht'),
'name' => 'sht_download',
'type' => 'file',
'instructions' => _x('Instructions', 'ACF field label', 'sht'),
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
],
'return_format' => 'array',
'library' => 'all',
'min_size' => '',
'max_size' => '',
'mime_types' => '',
],
Group
[
'key' => 'sht_group_field',
'label' => 'Group',
'name' => 'sht_group_field',
'type' => 'group',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
],
'layout' => 'block',
'sub_fields' => [
[
'key' => 'sht_group_field_title',
'label' => 'Titel',
'name' => 'sht_group_field_title',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
],
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
],
[
'key' => 'sht_group_field_text',
'label' => 'Text',
'name' => 'sht_group_field_text',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
],
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
],
[
'key' => 'sht_group_field_price',
'label' => 'Preis',
'name' => 'sht_group_field_price',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
],
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
],
],
],
Image
[
'key' => 'sht_moodimage',
'label' => _x('Moodbild', 'ACF field label', 'sha'),
'name' => 'sht_moodimage',
'type' => 'image',
'instructions' => _x('Hilfetext', 'ACF field label', 'sha'),
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'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' => 'jpg',
],
Link
[
'key' => 'sht_cardlink',
'label' => _x('Link', 'ACF field label', 'sha'),
'name' => 'sht_cardlink',
'type' => 'link',
'instructions' => _x('Instructions', 'ACF field label', 'sha'),
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
],
'return_format' => 'array',
],
Message
[
'key' => 'sht_message',
'label' => _x('Beschriftung', 'ACF field label', 'sha'),
'name' => 'sht_message',
'type' => 'message',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
],
'message' => _x('Nachrichtentext', 'ACF message field content', 'sha'),
'new_lines' => 'wpautop',
'esc_html' => 0,
],
Repeater
[
'key' => 'entries',
'label' => _x('Einträge', 'ACF field label', 'sha'),
'name' => 'entries',
'type' => 'repeater',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
],
'collapsed' => '',
'min' => 0,
'max' => 0,
'layout' => 'table',
'button_label' => '',
'sub_fields' => [
[
'key' => 'sht_text_field',
'label' => _x('Text field', 'ACF field label', 'sha'),
'name' => 'sht_text_field',
'type' => 'text',
'instructions' => _x('Instructions', 'ACF field label', 'sha'),
'required' => 1,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
],
'default_value' => '',
],
],
],
Related post
[
'key' => 'sht_related_teammember',
'label' => _x('Teammitglied auswählen', 'ACF field label', 'sha'),
'name' => 'sht_related_teammember',
'type' => 'post_object',
'instructions' => _x('Instructions', 'ACF field label', 'sha'),
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
],
'post_type' => [
0 => 'sht_teammember',
],
'taxonomy' => '',
'allow_null' => 0,
'multiple' => 0,
'return_format' => 'object',
'ui' => 1,
],
Radio
[
'key' => 'field_60a276c125539',
'label' => 'Radio-Optionen',
'name' => 'sht_radio',
'type' => 'radio',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
],
'choices' => [
1 => 'Eins',
2 => 'Zwei',
],
'allow_null' => 0,
'other_choice' => 0,
'default_value' => '',
'layout' => 'horizontal',
'return_format' => 'value',
],
Select
[
'key' => 'image_size',
'label' => _x('Bildgrösse', 'ACF field label', 'sha'),
'name' => 'image_size',
'type' => 'select',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
],
'choices' => [
'small' => 'Klein',
'regular' => 'Standard',
],
'default_value' => 'regular',
'allow_null' => 0,
'multiple' => 0,
'ui' => 0,
'return_format' => 'value',
'ajax' => 0,
'placeholder' => '',
],
Tab
[
'key' => 'sht_tab_sticker',
'label' => 'Tab text',
'name' => '',
'type' => 'tab',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
],
'placement' => 'left',
'endpoint' => 0,
],
Taxonomy selector
[
'key' => 'sht_teammemberstory_tax',
'label' => _x('Taxonomie Mitarbeitergeschichte', 'ACF field label', 'sha'),
'name' => 'sht_teammemberstory_tax',
'type' => 'taxonomy',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
],
'taxonomy' => 'sht_story_type',
'field_type' => 'radio',
'allow_null' => 0,
'add_term' => 0,
'save_terms' => 0,
'load_terms' => 0,
'return_format' => 'id',
'multiple' => 0,
],
Text
[
'key' => 'sht_text_field',
'label' => _x('Text field', 'ACF field label', 'sha'),
'name' => 'sht_text_field',
'type' => 'text',
'instructions' => _x('Instructions', 'ACF field label', 'sha'),
'required' => 1,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
],
'default_value' => '',
],
Textarea
[
'key' => 'sht_textarea',
'label' => _x('Textarea', 'ACF field label', 'sha'),
'name' => 'sht_textarea',
'type' => 'textarea',
'instructions' => _x('Instructions', 'ACF field label', 'sha'),
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
],
'default_value' => '',
'placeholder' => '',
'maxlength' => '',
'rows' => '',
'new_lines' => '',
],
True/false
[
'key' => 'sht_yes_or_no',
'label' => _x('Ja oder nein', 'ACF field label', 'sha'),
'name' => 'sht_yes_or_no',
'type' => 'true_false',
'instructions' => _x('', 'ACF field label', 'sha'),
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
],
'message' => '',
'default_value' => 1,
'ui' => 1,
'ui_on_text' => _x('Ja', 'ACF field label', 'sha'),
'ui_off_text' => _x('Nein', 'ACF field label', 'sha'),
],
URL/Website
[
'key' => 'sht_website',
'label' => _x('Website', 'ACF field label', 'sha'),
'name' => 'sht_website',
'type' => 'url',
'instructions' => _x('Instructions', 'ACF field label', 'sha'),
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
],
'default_value' => '',
'placeholder' => '',
],
WYSIWYG
[
'key' => 'sht_cookiebanner_text',
'label' => _x('Text', 'ACF field label', 'sha'),
'name' => 'sht_cookiebanner_text',
'type' => 'wysiwyg',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
],
'default_value' => '',
'tabs' => 'all',
'toolbar' => 'full',
'media_upload' => 1,
'delay' => 0,
],