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