Skip to content

Instantly share code, notes, and snippets.

@Vinsanity
Last active September 4, 2022 17:45
Show Gist options
  • Save Vinsanity/12e6f9d5f0dfab9a45ec7110fc483881 to your computer and use it in GitHub Desktop.
Save Vinsanity/12e6f9d5f0dfab9a45ec7110fc483881 to your computer and use it in GitHub Desktop.
<template name="acfcb" value="$name_of_field = array(&#10;&#9;'key' =&gt; 'field_name_of_field',&#10;&#9;'label' =&gt; 'Name of Field',&#10;&#9;'name' =&gt; 'name_of_field',&#10;&#9;'type' =&gt; 'checkbox',&#10;&#9;'instructions' =&gt; '',&#10;&#9;'required' =&gt; 0,&#10;&#9;'conditional_logic' =&gt; 0,&#10;&#9;'wrapper' =&gt; array(&#10;&#9;&#9;'width' =&gt; '',&#10;&#9;&#9;'class' =&gt; '',&#10;&#9;&#9;'id' =&gt; '',&#10;&#9;),&#10;&#9;'default_value' =&gt; '',&#10;&#9;'choices' =&gt; array(&#10;&#9;&#9;'red'&#9;=&gt; 'Red'&#10;&#9;),&#9;&#10;&#9;'layout' =&gt; 'vertical',&#10;);" description="ACF checkbox field" toReformat="false" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="acfem" value="$name_of_field = array(&#10;&#9;'key' =&gt; 'field_name_of_field',&#10;&#9;'label' =&gt; 'Name of Field',&#10;&#9;'name' =&gt; 'name_of_field',&#10;&#9;'type' =&gt; 'email',&#10;&#9;'instructions' =&gt; '',&#10;&#9;'required' =&gt; 0,&#10;&#9;'conditional_logic' =&gt; 0,&#10;&#9;'wrapper' =&gt; array(&#10;&#9;&#9;'width' =&gt; '',&#10;&#9;&#9;'class' =&gt; '',&#10;&#9;&#9;'id' =&gt; '',&#10;&#9;),&#10;&#9;'default_value' =&gt; '',&#10;&#9;'placeholder' =&gt; '',&#10;&#9;'prepend' =&gt; '',&#10;&#9;'append' =&gt; '',&#10;);" description="ACF email field" toReformat="false" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="acffile" value="$name_of_field = array(&#10;&#9;'key' =&gt; 'field_name_of_field',&#10;&#9;'label' =&gt; 'Name of Field',&#10;&#9;'name' =&gt; 'name_of_field',&#10;&#9;'type' =&gt; 'file',&#10;&#9;'instructions' =&gt; '',&#10;&#9;'required' =&gt; 0,&#10;&#9;'conditional_logic' =&gt; 0,&#10;&#9;'wrapper' =&gt; array(&#10;&#9;&#9;'width' =&gt; '',&#10;&#9;&#9;'class' =&gt; '',&#10;&#9;&#9;'id' =&gt; '',&#10;&#9;),&#10;&#9;'default_value' =&gt; '',&#10;&#9;'return_format' =&gt; 'url',&#10;&#9;'preview_size' =&gt; 'thumbnail',&#10;&#9;'library' =&gt; 'all',&#10;&#9;'min_size' =&gt; 0,&#10;&#9;'max_size' =&gt; 0,&#10;&#9;'mime_types' =&gt; '',&#10;);" description="ACF file upload field" toReformat="false" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="acfflex" value="$name_of_field = array(&#10;&#9;'key' =&gt; 'field_name_of_field',&#10;&#9;'label' =&gt; 'Name of Field',&#10; 'name' =&gt; 'name_of_field',&#10; 'type' =&gt; 'flexible_content',&#10; 'instructions' =&gt; '',&#10; 'required' =&gt; 0,&#10; 'conditional_logic' =&gt; 0,&#10; 'wrapper' =&gt; array (&#10; 'width' =&gt; '',&#10; 'class' =&gt; '',&#10; 'id' =&gt; '',&#10; ),&#10; 'button_label' =&gt; 'Add Layout',&#10; 'min' =&gt; 0,&#10; 'max' =&gt; 0,&#10; 'layouts' =&gt; array (&#10; array (&#10; 'key' =&gt; 'field_layout_1',&#10; 'name' =&gt; 'layout_1',&#10; 'label' =&gt; 'Layout 1',&#10; 'display' =&gt; 'block',&#10; 'sub_fields' =&gt; array (&#10; /* Add fields here */&#10; ),&#10; 'min' =&gt; '',&#10; 'max' =&gt; '',&#10; ),&#10; ),&#10;);" description="ACF flexible layout field" toReformat="false" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="acfgal" value="$name_of_field = array(&#10;&#9;'key' =&gt; 'field_name_of_field',&#10;&#9;'label' =&gt; 'Name of Field',&#10;&#9;'name' =&gt; 'name_of_field',&#10;&#9;'type' =&gt; 'gallery',&#10;&#9;'instructions' =&gt; '',&#10;&#9;'required' =&gt; 0,&#10;&#9;'conditional_logic' =&gt; 0,&#10;&#9;'wrapper' =&gt; array(&#10;&#9;&#9;'width' =&gt; '',&#10;&#9;&#9;'class' =&gt; '',&#10;&#9;&#9;'id' =&gt; '',&#10;&#9;),&#10;&#9;'default_value' =&gt; '',&#10;&#9;'min' =&gt; 0,&#10;&#9;'max' =&gt; 0,&#10;&#9;'preview_size' =&gt; 'thumbnail',&#10;&#9;'library' =&gt; 'all',&#10;&#9;'min_width' =&gt; 0,&#10;&#9;'min_height' =&gt; 0,&#10;&#9;'min_size' =&gt; 0,&#10;&#9;'max_width' =&gt; 0,&#10;&#9;'max_height' =&gt; 0,&#10;&#9;'max_size' =&gt; 0,&#10;&#9;'mime_types' =&gt; '',&#10;);" description="ACF gallery field" toReformat="false" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="acfgroup" value="$name_of_group = array(&#10;&#9;&#10;&#9;/* (string) Unique identifier for field group. Must begin with 'group_' */&#10;&#9;'key' =&gt; 'group_name_of_group',&#10;&#9;&#10;&#9;/* (string) Visible in metabox handle */&#10;&#9;'title' =&gt; 'Name of Group',&#10;&#9;&#10;&#9;/* (array) An array of fields */&#10;&#9;'fields' =&gt; array(&#10;&#9; &#10;&#9;),&#10;&#9;&#10;&#9;/* (array) An array containing 'rule groups' where each 'rule group' is an array containing 'rules'. &#10;&#9;Each group is considered an 'or', and each rule is considered an 'and'. */&#10;&#9;'location' =&gt; array(&#10;&#9;&#9;array(&#10;&#9;&#9;&#9;array(&#10;&#9;&#9;&#9;&#9;'param' =&gt; 'post_type',&#10;&#9;&#9;&#9;&#9;'operator' =&gt; '==',&#10;&#9;&#9;&#9;&#9;'value' =&gt; 'post',&#10;&#9;&#9;&#9;),&#10;&#9;&#9;&#9;// add an AND statement&#10;&#9;&#9;&#9;array(&#10;&#9;&#9;&#9;),&#10;&#9;&#9;),&#10;&#9;&#9;// add an OR statement&#10;&#9;&#9;array(&#10;&#9;&#9;),&#10;&#9;),&#10;&#9;&#10;&#9;/* (int) Field groups are shown in order from lowest to highest. Defaults to 0 */&#10;&#9;'menu_order' =&gt; 0,&#10;&#9;&#10;&#9;/* (string) Determines the position on the edit screen. Defaults to normal. Choices of 'acf_after_title', 'normal' or 'side' */&#10;&#9;'position' =&gt; 'normal',&#10;&#9;&#10;&#9;/* (string) Determines the metabox style. Defaults to 'default'. Choices of 'default' or 'seamless' */&#10;&#9;'style' =&gt; 'default',&#10;&#9;&#10;&#9;/* (string) Determines where field labels are places in relation to fields. Defaults to 'top'. &#10;&#9;Choices of 'top' (Above fields) or 'left' (Beside fields) */&#10;&#9;'label_placement' =&gt; 'left',&#10;&#9;&#10;&#9;/* (string) Determines where field instructions are places in relation to fields. Defaults to 'label'. &#10;&#9;Choices of 'label' (Below labels) or 'field' (Below fields) */&#10;&#9;'instruction_placement' =&gt; 'label',&#10;&#9;&#10;&#9;/* (array) An array of elements to hide on the screen */&#10;&#9;'hide_on_screen' =&gt; array(&#10;&#9;),&#10;);" description="ACF group" toReformat="false" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="acfimg" value="$name_of_field = array(&#10;&#9;'key' =&gt; 'field_name_of_field',&#10;&#9;'label' =&gt; 'Name of Field',&#10;&#9;'name' =&gt; 'name_of_field',&#10;&#9;'type' =&gt; 'image',&#10;&#9;'instructions' =&gt; '',&#10;&#9;'required' =&gt; 0,&#10;&#9;'conditional_logic' =&gt; 0,&#10;&#9;'wrapper' =&gt; array(&#10;&#9;&#9;'width' =&gt; '',&#10;&#9;&#9;'class' =&gt; '',&#10;&#9;&#9;'id' =&gt; '',&#10;&#9;),&#10;&#9;'default_value' =&gt; '',&#10;&#9;'return_format' =&gt; 'id',&#10;&#9;'preview_size' =&gt; 'thumbnail',&#10;&#9;'library' =&gt; 'all',&#10;&#9;'min_width' =&gt; 0,&#10;&#9;'min_height' =&gt; 0,&#10;&#9;'min_size' =&gt; 0,&#10;&#9;'max_width' =&gt; 0,&#10;&#9;'max_height' =&gt; 0,&#10;&#9;'max_size' =&gt; 0,&#10;&#9;'mime_types' =&gt; '',&#10;);" description="ACF image field" toReformat="false" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="acfmsg" value="$name_of_field = array(&#10;&#9;'key' =&gt; 'field_name_of_field',&#10;&#9;'label' =&gt; 'Name of Field',&#10;&#9;'name' =&gt; 'name_of_field',&#10;&#9;'type' =&gt; 'message',&#10; 'instructions' =&gt; '',&#10; 'required' =&gt; 0,&#10; 'conditional_logic' =&gt; 0,&#10; 'wrapper' =&gt; array (&#10; 'width' =&gt; '',&#10; 'class' =&gt; '',&#10; 'id' =&gt; '',&#10; ),&#10; 'message' =&gt; '',&#10; 'new_lines' =&gt; 'wpautop',&#10; 'esc_html' =&gt; 0,&#10;);" description="ACF message field" toReformat="false" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="acfnf" value="$name_of_field = array(&#10;&#9;'key' =&gt; 'field_name_of_field',&#10;&#9;'label' =&gt; 'Name of Field',&#10;&#9;'name' =&gt; 'name_of_field',&#10;&#9;'type' =&gt; 'number',&#10;&#9;'instructions' =&gt; '',&#10;&#9;'required' =&gt; 0,&#10;&#9;'conditional_logic' =&gt; 0,&#10;&#9;'wrapper' =&gt; array(&#10;&#9;&#9;'width' =&gt; '',&#10;&#9;&#9;'class' =&gt; '',&#10;&#9;&#9;'id' =&gt; '',&#10;&#9;),&#10;&#9;'default_value' =&gt; '',&#10;&#9;'placeholder' =&gt; '',&#10;&#9;'prepend' =&gt; '',&#10;&#9;'append' =&gt; '',&#10;&#9;'min' =&gt; '',&#10;&#9;'max' =&gt; '',&#10;&#9;'step' =&gt; '',&#10;);" description="ACF number field" toReformat="false" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="acfoem" value="$name_of_field = array(&#10;&#9;'key' =&gt; 'field_name_of_field',&#10;&#9;'label' =&gt; 'Name of Field',&#10;&#9;'name' =&gt; 'name_of_field',&#10;&#9;'type' =&gt; 'oembed',&#10;&#9;'instructions' =&gt; '',&#10;&#9;'required' =&gt; 0,&#10;&#9;'conditional_logic' =&gt; 0,&#10;&#9;'wrapper' =&gt; array(&#10;&#9;&#9;'width' =&gt; '',&#10;&#9;&#9;'class' =&gt; '',&#10;&#9;&#9;'id' =&gt; '',&#10;&#9;),&#10;&#9;'default_value' =&gt; '',&#10;&#9;'width' =&gt; '',&#10;&#9;'height' =&gt; '',&#10;);" description="ACF oembed field" toReformat="false" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="acfplink" value="$name_of_field = array(&#10;&#9;'key' =&gt; 'field_name_of_field',&#10;&#9;'label' =&gt; 'Name of Field',&#10;&#9;'name' =&gt; 'name_of_field',&#10;&#9;'type' =&gt; 'page_link',&#10;&#9;'instructions' =&gt; '',&#10;&#9;'required' =&gt; 0,&#10;&#9;'conditional_logic' =&gt; 0,&#10;&#9;'wrapper' =&gt; array(&#10;&#9;&#9;'width' =&gt; '',&#10;&#9;&#9;'class' =&gt; '',&#10;&#9;&#9;'id' =&gt; '',&#10;&#9;),&#10;&#9;'default_value' =&gt; '',&#10;&#9;'post_type' =&gt; '', // uses single 'posttype' or array('posttype', 'posttype'),&#10;&#9;'taxonomy' =&gt; '', // uses single 'taxname' or array('taxname', 'taxname'),&#10;&#9;'allow_null' =&gt; 0,&#10;&#9;'multiple' =&gt; 0,&#10;);" description="ACF page link field" toReformat="false" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="acfpost" value="$name_of_field = array(&#10;&#9;'key' =&gt; 'field_name_of_field',&#10;&#9;'label' =&gt; 'Name of Field',&#10;&#9;'name' =&gt; 'name_of_field',&#10;&#9;'type' =&gt; 'post_object',&#10;&#9;'instructions' =&gt; '',&#10;&#9;'required' =&gt; 0,&#10;&#9;'conditional_logic' =&gt; 0,&#10;&#9;'wrapper' =&gt; array(&#10;&#9;&#9;'width' =&gt; '',&#10;&#9;&#9;'class' =&gt; '',&#10;&#9;&#9;'id' =&gt; '',&#10;&#9;),&#10;&#9;'default_value' =&gt; '',&#10;&#9;'post_type' =&gt; '', // uses single 'posttype' or array('posttype', 'posttype'),&#10;&#9;'taxonomy' =&gt; '', // uses single 'taxname' or array('taxname', 'taxname'),&#10;&#9;'allow_null' =&gt; 0,&#10;&#9;'multiple' =&gt; 0,&#10;&#9;'return_format' =&gt; 'object', // can use id too.&#10;);" description="ACF post object field" toReformat="false" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="acfpw" value="$name_of_field = array(&#10;&#9;'key' =&gt; 'field_name_of_field',&#10;&#9;'label' =&gt; 'Name of Field',&#10;&#9;'name' =&gt; 'name_of_field',&#10;&#9;'type' =&gt; 'password',&#10;&#9;'instructions' =&gt; '',&#10;&#9;'required' =&gt; 0,&#10;&#9;'conditional_logic' =&gt; 0,&#10;&#9;'wrapper' =&gt; array(&#10;&#9;&#9;'width' =&gt; '',&#10;&#9;&#9;'class' =&gt; '',&#10;&#9;&#9;'id' =&gt; '',&#10;&#9;),&#10;&#9;'default_value' =&gt; '',&#10;&#9;'placeholder' =&gt; '',&#10;&#9;'prepend' =&gt; '',&#10;&#9;'append' =&gt; '',&#10;);" description="ACF password field" toReformat="false" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="acfradio" value="$name_of_field = array(&#10;&#9;'key' =&gt; 'field_name_of_field',&#10;&#9;'label' =&gt; 'Name of Field',&#10;&#9;'name' =&gt; 'name_of_field',&#10;&#9;'type' =&gt; 'radio',&#10;&#9;'instructions' =&gt; '',&#10;&#9;'required' =&gt; 0,&#10;&#9;'conditional_logic' =&gt; 0,&#10;&#9;'wrapper' =&gt; array(&#10;&#9;&#9;'width' =&gt; '',&#10;&#9;&#9;'class' =&gt; '',&#10;&#9;&#9;'id' =&gt; '',&#10;&#9;),&#10;&#9;'default_value' =&gt; '',&#10;&#9;'choices' =&gt; array(&#10;&#9;&#9;'red'&#9;=&gt; 'Red'&#10;&#9;),&#10;&#9;'other_choice' =&gt; 0,&#10;&#9;'save_other_choice' =&gt; 0,&#10;&#9;'layout' =&gt; 'vertical',&#10;);" description="ACF radio field" toReformat="false" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="acfrel" value="$name_of_field = array(&#10;&#9;'key' =&gt; 'field_name_of_field',&#10;&#9;'label' =&gt; 'Name of Field',&#10;&#9;'name' =&gt; 'name_of_field',&#10;&#9;'type' =&gt; 'relationship',&#10;&#9;'instructions' =&gt; '',&#10;&#9;'required' =&gt; 0,&#10;&#9;'conditional_logic' =&gt; 0,&#10;&#9;'wrapper' =&gt; array(&#10;&#9;&#9;'width' =&gt; '',&#10;&#9;&#9;'class' =&gt; '',&#10;&#9;&#9;'id' =&gt; '',&#10;&#9;),&#10;&#9;'default_value' =&gt; '',&#10;&#9;/* (mixed) Specify an array of post types to filter the available choices. Defaults to '' */&#10;&#9;'post_type' =&gt; '',&#10;&#9;&#10;&#9;/* (mixed) Specify an array of taxonomies to filter the available choices. Defaults to '' */&#10;&#9;'taxonomy' =&gt; '',&#10;&#9;&#10;&#9;/* (array) Specify the available filters used to search for posts.&#10;&#9;Choices of 'search' (Search input), 'post_type' (Post type select) and 'taxonomy' (Taxonomy select) */&#10;&#9;'filters' =&gt; array('search', 'post_type', 'taxonomy'),&#10;&#9;&#10;&#9;/* (array) Specify the visual elements for each post.&#10;&#9;Choices of 'featured_image' (Featured image icon) */&#10;&#9;'elements' =&gt; array(),&#10;&#9;&#10;&#9;/* (int) Specify the minimum posts required to be selected. Defaults to 0 */&#10;&#9;'min' =&gt; 0,&#10;&#9;&#10;&#9;/* (int) Specify the maximum posts allowed to be selected. Defaults to 0 */&#10;&#9;'max' =&gt; 0,&#10;&#10;&#9;/* (string) Specify the type of value returned by get_field(). Defaults to 'object'.&#10;&#9;Choices of 'object' (Post object) or 'id' (Post ID) */&#10;&#9;'return_format' =&gt; 'object',&#10;);" description="ACF relationship field" toReformat="false" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="acfrepeater" value="$name_of_field = array(&#10;&#9;'key' =&gt; 'field_name_of_field',&#10;&#9;'label' =&gt; 'Name of Field',&#10;&#9;'name' =&gt; 'name_of_field',&#10;&#9;'type' =&gt; 'repeater',&#10;&#9;'instructions' =&gt; '',&#10;&#9;'required' =&gt; 0,&#10;&#9;'conditional_logic' =&gt; 0,&#10;&#9;'wrapper' =&gt; array(&#10;&#9;&#9;'width' =&gt; '',&#10;&#9;&#9;'class' =&gt; '',&#10;&#9;&#9;'id' =&gt; '',&#10;&#9;),&#10;&#9;'collapsed' =&gt; '',&#10; 'min' =&gt; '',&#10; 'max' =&gt; '',&#10; 'layout' =&gt; 'table', // can use: row, block, table&#10; 'button_label' =&gt; 'Add Row',&#10; 'sub_fields' =&gt; array (&#10; /* Add fields here */&#10; ),&#10;);" description="ACF repeater field" toReformat="false" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="acfsel" value="$name_of_field = array(&#10;&#9;'key' =&gt; 'field_name_of_field',&#10;&#9;'label' =&gt; 'Name of Field',&#10;&#9;'name' =&gt; 'name_of_field',&#10;&#9;'type' =&gt; 'select',&#10;&#9;'instructions' =&gt; '',&#10;&#9;'required' =&gt; 0,&#10;&#9;'conditional_logic' =&gt; 0,&#10;&#9;'wrapper' =&gt; array(&#10;&#9;&#9;'width' =&gt; '',&#10;&#9;&#9;'class' =&gt; '',&#10;&#9;&#9;'id' =&gt; '',&#10;&#9;),&#10;&#9;'default_value' =&gt; '',&#10;&#9;'choices' =&gt; array(&#10;&#9;&#9;'red'&#9;=&gt; 'Red'&#10;&#9;),&#10;&#9;'allow_null' =&gt; 0,&#10;&#9;'multiple' =&gt; 0,&#10;&#9;'ui' =&gt; 0,&#10;&#9;'ajax' =&gt; 0,&#10;&#9;'placeholder' =&gt; '',&#10;);" description="ACF select field" toReformat="false" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="acfta" value="$name_of_field = array(&#10;&#9;'key' =&gt; 'field_name_of_field',&#10;&#9;'label' =&gt; 'Name of Field',&#10;&#9;'name' =&gt; 'name_of_field',&#10;&#9;'type' =&gt; 'textarea',&#10;&#9;'instructions' =&gt; '',&#10;&#9;'required' =&gt; 0,&#10;&#9;'conditional_logic' =&gt; 0,&#10;&#9;'wrapper' =&gt; array(&#10;&#9;&#9;'width' =&gt; '',&#10;&#9;&#9;'class' =&gt; '',&#10;&#9;&#9;'id' =&gt; '',&#10;&#9;),&#10;&#9;'default_value' =&gt; '',&#10;&#9;'placeholder' =&gt; '',&#10;&#9;'maxlength' =&gt; '',&#10;&#9;'rows' =&gt; '',&#10;&#9;'new_lines' =&gt; 'wpautop',&#10;&#9;'readonly' =&gt; 0,&#10;&#9;'disabled' =&gt; 0,&#10;);" description="ACF textarea field" toReformat="false" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="acftab" value="$name_of_field = array(&#10;&#9;'key' =&gt; 'field_name_of_field',&#10;&#9;'label' =&gt; 'Name of Field',&#10;&#9;'name' =&gt; 'name_of_field',&#10;&#9;'type' =&gt; 'tab',&#10; 'instructions' =&gt; '',&#10; 'required' =&gt; 0,&#10; 'conditional_logic' =&gt; 0,&#10; 'wrapper' =&gt; array (&#10; 'width' =&gt; '',&#10; 'class' =&gt; '',&#10; 'id' =&gt; '',&#10; ),&#10; 'placement' =&gt; 'left',&#10; 'endpoint' =&gt; 0,&#10;);" description="ACF tab field" toReformat="false" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="acftax" value="$name_of_field = array(&#10;&#9;'key' =&gt; 'field_name_of_field',&#10;&#9;'label' =&gt; 'Name of Field',&#10;&#9;'name' =&gt; 'name_of_field',&#10;&#9;'type' =&gt; 'taxonomy',&#10;&#9;'instructions' =&gt; '',&#10;&#9;'required' =&gt; 0,&#10;&#9;'conditional_logic' =&gt; 0,&#10;&#9;'wrapper' =&gt; array(&#10;&#9;&#9;'width' =&gt; '',&#10;&#9;&#9;'class' =&gt; '',&#10;&#9;&#9;'id' =&gt; '',&#10;&#9;),&#10;&#9;'default_value' =&gt; '',&#10;&#9;'taxonomy' =&gt; '', // single taxonomy only.&#10;&#9;'field_type' =&gt; 'select', // can use: checkbox, radio, or multi-select&#10;&#9;'allow_null' =&gt; 0,&#10;&#9;'load_save_terms' &#9;=&gt; 0,&#10;&#9;'return_format'&#9;&#9;=&gt; 'id', // can use 'object' too&#10;&#9;'add_term'&#9;&#9;&#9;=&gt; 0&#10;);" description="ACF taxonomy field" toReformat="false" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="acftext" value="$name_of_field = array(&#10;&#9;'key' =&gt; 'field_name_of_field',&#10;&#9;'label' =&gt; 'Name of Field',&#10;&#9;'name' =&gt; 'name_of_field',&#10;&#9;'type' =&gt; 'text',&#10;&#9;'instructions' =&gt; '',&#10;&#9;'required' =&gt; 0,&#10;&#9;'conditional_logic' =&gt; 0,&#10;&#9;'wrapper' =&gt; array(&#10;&#9;&#9;'width' =&gt; '',&#10;&#9;&#9;'class' =&gt; '',&#10;&#9;&#9;'id' =&gt; '',&#10;&#9;),&#10;&#9;'default_value' =&gt; '',&#10;&#9;'placeholder' =&gt; '',&#10;&#9;'prepend' =&gt; '',&#10;&#9;'append' =&gt; '',&#10;&#9;'maxlength' =&gt; '',&#10;&#9;'readonly' =&gt; 0,&#10;&#9;'disabled' =&gt; 0,&#10;);" description="ACF Text Field" toReformat="false" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="acftf" value="$name_of_field = array(&#10;&#9;'key' =&gt; 'field_name_of_field',&#10;&#9;'label' =&gt; 'Name of Field',&#10;&#9;'name' =&gt; 'name_of_field',&#10;&#9;'type' =&gt; 'true_false',&#10;&#9;'instructions' =&gt; '',&#10;&#9;'required' =&gt; 0,&#10;&#9;'conditional_logic' =&gt; 0,&#10;&#9;'wrapper' =&gt; array(&#10;&#9;&#9;'width' =&gt; '',&#10;&#9;&#9;'class' =&gt; '',&#10;&#9;&#9;'id' =&gt; '',&#10;&#9;),&#10;&#9;'default_value' =&gt; '',&#10;&#9;'message' =&gt; 'Turn Me On',&#10;);" description="ACF true/false field" toReformat="false" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="acfurl" value="$name_of_field = array(&#10;&#9;'key' =&gt; 'field_name_of_field',&#10;&#9;'label' =&gt; 'Name of Field',&#10;&#9;'name' =&gt; 'name_of_field',&#10;&#9;'type' =&gt; 'url',&#10;&#9;'instructions' =&gt; '',&#10;&#9;'required' =&gt; 0,&#10;&#9;'conditional_logic' =&gt; 0,&#10;&#9;'wrapper' =&gt; array(&#10;&#9;&#9;'width' =&gt; '',&#10;&#9;&#9;'class' =&gt; '',&#10;&#9;&#9;'id' =&gt; '',&#10;&#9;),&#10;&#9;'default_value' =&gt; '',&#10;&#9;'placeholder' =&gt; '',&#10;);" description="ACF URL field" toReformat="false" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="acfuser" value="$name_of_field = array(&#10;&#9;'key' =&gt; 'field_name_of_field',&#10;&#9;'label' =&gt; 'Name of Field',&#10;&#9;'name' =&gt; 'name_of_field',&#10;&#9;'type' =&gt; 'user',&#10;&#9;'instructions' =&gt; '',&#10;&#9;'required' =&gt; 0,&#10;&#9;'conditional_logic' =&gt; 0,&#10;&#9;'wrapper' =&gt; array(&#10;&#9;&#9;'width' =&gt; '',&#10;&#9;&#9;'class' =&gt; '',&#10;&#9;&#9;'id' =&gt; '',&#10;&#9;),&#10;&#9;'default_value' =&gt; '',&#10;&#9;'role' =&gt; array(),&#10;&#9;'allow_null' =&gt; 0,&#10;&#9;'multiple' =&gt; 0,&#10;);" description="ACF user field" toReformat="false" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="acfwysiwyg" value="$name_of_field = array(&#10;&#9;'key' =&gt; 'field_name_of_field',&#10;&#9;'label' =&gt; 'Name of Field',&#10;&#9;'name' =&gt; 'name_of_field',&#10;&#9;'type' =&gt; 'wysiwyg',&#10;&#9;'instructions' =&gt; '',&#10;&#9;'required' =&gt; 0,&#10;&#9;'conditional_logic' =&gt; 0,&#10;&#9;'wrapper' =&gt; array(&#10;&#9;&#9;'width' =&gt; '',&#10;&#9;&#9;'class' =&gt; '',&#10;&#9;&#9;'id' =&gt; '',&#10;&#9;),&#10;&#9;'default_value' =&gt; '',&#10;&#9;'tabs' =&gt; 'all',&#10;&#9;'toolbar' =&gt; 'full',&#10;&#9;'media_upload' =&gt; 0,&#10;);" description="ACF WYSIWYG field" toReformat="false" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
@Vinsanity
Copy link
Author

These templates are for those of you that prefer to Register Fields via PHP with ACF PRO https://www.advancedcustomfields.com/resources/register-fields-via-php/

Simply follow the instructions here to import the fields.
https://www.jetbrains.com/help/phpstorm/2016.1/sharing-live-templates.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment