Repository: AdvancedCustomFields/acf-field-type-template
Branch: master
Commit: edb3b661a164
Files: 14
Total size: 23.5 KB
Directory structure:
gitextract_5m9lcrwj/
├── .gitignore
├── README.md
└── acf-FIELD-NAME/
├── README.md
├── acf-FIELD-NAME.php
├── assets/
│ ├── README.md
│ ├── css/
│ │ ├── README.md
│ │ └── input.css
│ ├── images/
│ │ └── README.md
│ └── js/
│ ├── README.md
│ └── input.js
├── fields/
│ ├── class-NAMESPACE-acf-field-FIELD-NAME-v4.php
│ └── class-NAMESPACE-acf-field-FIELD-NAME-v5.php
├── lang/
│ └── README.md
└── readme.txt
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
================================================
FILE: README.md
================================================
# ACF Field Type Template (Deprecated)
This is an archived repository for the ACF Field Type Template for ACF v4 and V5. A new field type template for ACF v6 is now available at https://github.com/AdvancedCustomFields/acf-example-field-type.
Looking for documentation? Please read the [Creating a new field type guide](https://www.advancedcustomfields.com/resources/creating-a-new-field-type/).
================================================
FILE: acf-FIELD-NAME/README.md
================================================
# ACF FIELD_LABEL Field
Welcome to the Advanced Custom Fields FIELD_LABEL repository on Github.
EXTENDED_DESCRIPTION
================================================
FILE: acf-FIELD-NAME/acf-FIELD-NAME.php
================================================
<?php
/*
Plugin Name: Advanced Custom Fields: FIELD_LABEL
Plugin URI: PLUGIN_URL
Description: SHORT_DESCRIPTION
Version: 1.0.0
Author: AUTHOR_NAME
Author URI: AUTHOR_URL
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
// exit if accessed directly
if( ! defined( 'ABSPATH' ) ) exit;
// check if class already exists
if( !class_exists('NAMESPACE_acf_plugin_FIELD_NAME') ) :
class NAMESPACE_acf_plugin_FIELD_NAME {
// vars
var $settings;
/*
* __construct
*
* This function will setup the class functionality
*
* @type function
* @date 17/02/2016
* @since 1.0.0
*
* @param void
* @return void
*/
function __construct() {
// settings
// - these will be passed into the field class.
$this->settings = array(
'version' => '1.0.0',
'url' => plugin_dir_url( __FILE__ ),
'path' => plugin_dir_path( __FILE__ )
);
// include field
add_action('acf/include_field_types', array($this, 'include_field')); // v5
add_action('acf/register_fields', array($this, 'include_field')); // v4
}
/*
* include_field
*
* This function will include the field type class
*
* @type function
* @date 17/02/2016
* @since 1.0.0
*
* @param $version (int) major ACF version. Defaults to false
* @return void
*/
function include_field( $version = false ) {
// support empty $version
if( !$version ) $version = 4;
// load textdomain
load_plugin_textdomain( 'TEXTDOMAIN', false, plugin_basename( dirname( __FILE__ ) ) . '/lang' );
// include
include_once('fields/class-NAMESPACE-acf-field-FIELD-NAME-v' . $version . '.php');
}
}
// initialize
new NAMESPACE_acf_plugin_FIELD_NAME();
// class_exists check
endif;
?>
================================================
FILE: acf-FIELD-NAME/assets/README.md
================================================
# assets directory
Use this directory to store asset files such as CSS, JS and images.
This directory can be removed if not used.
================================================
FILE: acf-FIELD-NAME/assets/css/README.md
================================================
# CSS directory
Use this directory to store CSS files.
This directory can be removed if not used.
================================================
FILE: acf-FIELD-NAME/assets/css/input.css
================================================
================================================
FILE: acf-FIELD-NAME/assets/images/README.md
================================================
# Images directory
Use this directory to store images.
This directory can be removed if not used.
================================================
FILE: acf-FIELD-NAME/assets/js/README.md
================================================
# JS directory
Use this directory to store JS files.
This directory can be removed if not used.
================================================
FILE: acf-FIELD-NAME/assets/js/input.js
================================================
(function($){
/**
* initialize_field
*
* This function will initialize the $field.
*
* @date 30/11/17
* @since 5.6.5
*
* @param n/a
* @return n/a
*/
function initialize_field( $field ) {
//$field.doStuff();
}
if( typeof acf.add_action !== 'undefined' ) {
/*
* ready & append (ACF5)
*
* These two events are called when a field element is ready for initizliation.
* - ready: on page load similar to $(document).ready()
* - append: on new DOM elements appended via repeater field or other AJAX calls
*
* @param n/a
* @return n/a
*/
acf.add_action('ready_field/type=FIELD_NAME', initialize_field);
acf.add_action('append_field/type=FIELD_NAME', initialize_field);
} else {
/*
* acf/setup_fields (ACF4)
*
* These single event is called when a field element is ready for initizliation.
*
* @param event an event object. This can be ignored
* @param element An element which contains the new HTML
* @return n/a
*/
$(document).on('acf/setup_fields', function(e, postbox){
// find all relevant fields
$(postbox).find('.field[data-field_type="FIELD_NAME"]').each(function(){
// initialize
initialize_field( $(this) );
});
});
}
})(jQuery);
================================================
FILE: acf-FIELD-NAME/fields/class-NAMESPACE-acf-field-FIELD-NAME-v4.php
================================================
<?php
// exit if accessed directly
if( ! defined( 'ABSPATH' ) ) exit;
// check if class already exists
if( !class_exists('NAMESPACE_acf_field_FIELD_NAME') ) :
class NAMESPACE_acf_field_FIELD_NAME extends acf_field {
// vars
var $settings, // will hold info such as dir / path
$defaults; // will hold default field options
/*
* __construct
*
* Set name / label needed for actions / filters
*
* @since 3.6
* @date 23/01/13
*/
function __construct( $settings )
{
// vars
$this->name = 'FIELD_NAME';
$this->label = __('FIELD_LABEL');
$this->category = __("Basic",'TEXTDOMAIN'); // Basic, Content, Choice, etc
$this->defaults = array(
// add default here to merge into your field.
// This makes life easy when creating the field options as you don't need to use any if( isset('') ) logic. eg:
//'preview_size' => 'thumbnail'
);
// do not delete!
parent::__construct();
// settings
$this->settings = $settings;
}
/*
* create_options()
*
* Create extra options for your field. This is rendered when editing a field.
* The value of $field['name'] can be used (like below) to save extra data to the $field
*
* @type action
* @since 3.6
* @date 23/01/13
*
* @param $field - an array holding all the field's data
*/
function create_options( $field )
{
// defaults?
/*
$field = array_merge($this->defaults, $field);
*/
// key is needed in the field names to correctly save the data
$key = $field['name'];
// Create Field Options HTML
?>
<tr class="field_option field_option_<?php echo $this->name; ?>">
<td class="label">
<label><?php _e("Preview Size",'TEXTDOMAIN'); ?></label>
<p class="description"><?php _e("Thumbnail is advised",'TEXTDOMAIN'); ?></p>
</td>
<td>
<?php
do_action('acf/create_field', array(
'type' => 'radio',
'name' => 'fields['.$key.'][preview_size]',
'value' => $field['preview_size'],
'layout' => 'horizontal',
'choices' => array(
'thumbnail' => __('Thumbnail', 'TEXTDOMAIN'),
'something_else' => __('Something Else', 'TEXTDOMAIN'),
)
));
?>
</td>
</tr>
<?php
}
/*
* create_field()
*
* Create the HTML interface for your field
*
* @param $field - an array holding all the field's data
*
* @type action
* @since 3.6
* @date 23/01/13
*/
function create_field( $field )
{
// defaults?
/*
$field = array_merge($this->defaults, $field);
*/
// perhaps use $field['preview_size'] to alter the markup?
// create Field HTML
?>
<div>
</div>
<?php
}
/*
* input_admin_enqueue_scripts()
*
* This action is called in the admin_enqueue_scripts action on the edit screen where your field is created.
* Use this action to add CSS + JavaScript to assist your create_field() action.
*
* $info http://codex.wordpress.org/Plugin_API/Action_Reference/admin_enqueue_scripts
* @type action
* @since 3.6
* @date 23/01/13
*/
function input_admin_enqueue_scripts()
{
// Note: This function can be removed if not used
// vars
$url = $this->settings['url'];
$version = $this->settings['version'];
// register & include JS
wp_register_script('TEXTDOMAIN', "{$url}assets/js/input.js", array('acf-input'), $version);
wp_enqueue_script('TEXTDOMAIN');
// register & include CSS
wp_register_style('TEXTDOMAIN', "{$url}assets/css/input.css", array('acf-input'), $version);
wp_enqueue_style('TEXTDOMAIN');
}
/*
* input_admin_head()
*
* This action is called in the admin_head action on the edit screen where your field is created.
* Use this action to add CSS and JavaScript to assist your create_field() action.
*
* @info http://codex.wordpress.org/Plugin_API/Action_Reference/admin_head
* @type action
* @since 3.6
* @date 23/01/13
*/
function input_admin_head()
{
// Note: This function can be removed if not used
}
/*
* field_group_admin_enqueue_scripts()
*
* This action is called in the admin_enqueue_scripts action on the edit screen where your field is edited.
* Use this action to add CSS + JavaScript to assist your create_field_options() action.
*
* $info http://codex.wordpress.org/Plugin_API/Action_Reference/admin_enqueue_scripts
* @type action
* @since 3.6
* @date 23/01/13
*/
function field_group_admin_enqueue_scripts()
{
// Note: This function can be removed if not used
}
/*
* field_group_admin_head()
*
* This action is called in the admin_head action on the edit screen where your field is edited.
* Use this action to add CSS and JavaScript to assist your create_field_options() action.
*
* @info http://codex.wordpress.org/Plugin_API/Action_Reference/admin_head
* @type action
* @since 3.6
* @date 23/01/13
*/
function field_group_admin_head()
{
// Note: This function can be removed if not used
}
/*
* load_value()
*
* This filter is applied to the $value after it is loaded from the db
*
* @type filter
* @since 3.6
* @date 23/01/13
*
* @param $value - the value found in the database
* @param $post_id - the $post_id from which the value was loaded
* @param $field - the field array holding all the field options
*
* @return $value - the value to be saved in the database
*/
function load_value( $value, $post_id, $field )
{
// Note: This function can be removed if not used
return $value;
}
/*
* update_value()
*
* This filter is applied to the $value before it is updated in the db
*
* @type filter
* @since 3.6
* @date 23/01/13
*
* @param $value - the value which will be saved in the database
* @param $post_id - the $post_id of which the value will be saved
* @param $field - the field array holding all the field options
*
* @return $value - the modified value
*/
function update_value( $value, $post_id, $field )
{
// Note: This function can be removed if not used
return $value;
}
/*
* format_value()
*
* This filter is applied to the $value after it is loaded from the db and before it is passed to the create_field action
*
* @type filter
* @since 3.6
* @date 23/01/13
*
* @param $value - the value which was loaded from the database
* @param $post_id - the $post_id from which the value was loaded
* @param $field - the field array holding all the field options
*
* @return $value - the modified value
*/
function format_value( $value, $post_id, $field )
{
// defaults?
/*
$field = array_merge($this->defaults, $field);
*/
// perhaps use $field['preview_size'] to alter the $value?
// Note: This function can be removed if not used
return $value;
}
/*
* format_value_for_api()
*
* This filter is applied to the $value after it is loaded from the db and before it is passed back to the API functions such as the_field
*
* @type filter
* @since 3.6
* @date 23/01/13
*
* @param $value - the value which was loaded from the database
* @param $post_id - the $post_id from which the value was loaded
* @param $field - the field array holding all the field options
*
* @return $value - the modified value
*/
function format_value_for_api( $value, $post_id, $field )
{
// defaults?
/*
$field = array_merge($this->defaults, $field);
*/
// perhaps use $field['preview_size'] to alter the $value?
// Note: This function can be removed if not used
return $value;
}
/*
* load_field()
*
* This filter is applied to the $field after it is loaded from the database
*
* @type filter
* @since 3.6
* @date 23/01/13
*
* @param $field - the field array holding all the field options
*
* @return $field - the field array holding all the field options
*/
function load_field( $field )
{
// Note: This function can be removed if not used
return $field;
}
/*
* update_field()
*
* This filter is applied to the $field before it is saved to the database
*
* @type filter
* @since 3.6
* @date 23/01/13
*
* @param $field - the field array holding all the field options
* @param $post_id - the field group ID (post_type = acf)
*
* @return $field - the modified field
*/
function update_field( $field, $post_id )
{
// Note: This function can be removed if not used
return $field;
}
}
// initialize
new NAMESPACE_acf_field_FIELD_NAME( $this->settings );
// class_exists check
endif;
?>
================================================
FILE: acf-FIELD-NAME/fields/class-NAMESPACE-acf-field-FIELD-NAME-v5.php
================================================
<?php
// exit if accessed directly
if( ! defined( 'ABSPATH' ) ) exit;
// check if class already exists
if( !class_exists('NAMESPACE_acf_field_FIELD_NAME') ) :
class NAMESPACE_acf_field_FIELD_NAME extends acf_field {
/*
* __construct
*
* This function will setup the field type data
*
* @type function
* @date 5/03/2014
* @since 5.0.0
*
* @param n/a
* @return n/a
*/
function __construct( $settings ) {
/*
* name (string) Single word, no spaces. Underscores allowed
*/
$this->name = 'FIELD_NAME';
/*
* label (string) Multiple words, can include spaces, visible when selecting a field type
*/
$this->label = __('FIELD_LABEL', 'TEXTDOMAIN');
/*
* category (string) basic | content | choice | relational | jquery | layout | CUSTOM GROUP NAME
*/
$this->category = 'basic';
/*
* defaults (array) Array of default settings which are merged into the field object. These are used later in settings
*/
$this->defaults = array(
'font_size' => 14,
);
/*
* l10n (array) Array of strings that are used in JavaScript. This allows JS strings to be translated in PHP and loaded via:
* var message = acf._e('FIELD_NAME', 'error');
*/
$this->l10n = array(
'error' => __('Error! Please enter a higher value', 'TEXTDOMAIN'),
);
/*
* settings (array) Store plugin settings (url, path, version) as a reference for later use with assets
*/
$this->settings = $settings;
// do not delete!
parent::__construct();
}
/*
* render_field_settings()
*
* Create extra settings for your field. These are visible when editing a field
*
* @type action
* @since 3.6
* @date 23/01/13
*
* @param $field (array) the $field being edited
* @return n/a
*/
function render_field_settings( $field ) {
/*
* acf_render_field_setting
*
* This function will create a setting for your field. Simply pass the $field parameter and an array of field settings.
* The array of settings does not require a `value` or `prefix`; These settings are found from the $field array.
*
* More than one setting can be added by copy/paste the above code.
* Please note that you must also have a matching $defaults value for the field name (font_size)
*/
acf_render_field_setting( $field, array(
'label' => __('Font Size','TEXTDOMAIN'),
'instructions' => __('Customise the input font size','TEXTDOMAIN'),
'type' => 'number',
'name' => 'font_size',
'prepend' => 'px',
));
}
/*
* render_field()
*
* Create the HTML interface for your field
*
* @param $field (array) the $field being rendered
*
* @type action
* @since 3.6
* @date 23/01/13
*
* @param $field (array) the $field being edited
* @return n/a
*/
function render_field( $field ) {
/*
* Review the data of $field.
* This will show what data is available
*/
echo '<pre>';
print_r( $field );
echo '</pre>';
/*
* Create a simple text input using the 'font_size' setting.
*/
?>
<input type="text" name="<?php echo esc_attr($field['name']) ?>" value="<?php echo esc_attr($field['value']) ?>" style="font-size:<?php echo $field['font_size'] ?>px;" />
<?php
}
/*
* input_admin_enqueue_scripts()
*
* This action is called in the admin_enqueue_scripts action on the edit screen where your field is created.
* Use this action to add CSS + JavaScript to assist your render_field() action.
*
* @type action (admin_enqueue_scripts)
* @since 3.6
* @date 23/01/13
*
* @param n/a
* @return n/a
*/
/*
function input_admin_enqueue_scripts() {
// vars
$url = $this->settings['url'];
$version = $this->settings['version'];
// register & include JS
wp_register_script('TEXTDOMAIN', "{$url}assets/js/input.js", array('acf-input'), $version);
wp_enqueue_script('TEXTDOMAIN');
// register & include CSS
wp_register_style('TEXTDOMAIN', "{$url}assets/css/input.css", array('acf-input'), $version);
wp_enqueue_style('TEXTDOMAIN');
}
*/
/*
* input_admin_head()
*
* This action is called in the admin_head action on the edit screen where your field is created.
* Use this action to add CSS and JavaScript to assist your render_field() action.
*
* @type action (admin_head)
* @since 3.6
* @date 23/01/13
*
* @param n/a
* @return n/a
*/
/*
function input_admin_head() {
}
*/
/*
* input_form_data()
*
* This function is called once on the 'input' page between the head and footer
* There are 2 situations where ACF did not load during the 'acf/input_admin_enqueue_scripts' and
* 'acf/input_admin_head' actions because ACF did not know it was going to be used. These situations are
* seen on comments / user edit forms on the front end. This function will always be called, and includes
* $args that related to the current screen such as $args['post_id']
*
* @type function
* @date 6/03/2014
* @since 5.0.0
*
* @param $args (array)
* @return n/a
*/
/*
function input_form_data( $args ) {
}
*/
/*
* input_admin_footer()
*
* This action is called in the admin_footer action on the edit screen where your field is created.
* Use this action to add CSS and JavaScript to assist your render_field() action.
*
* @type action (admin_footer)
* @since 3.6
* @date 23/01/13
*
* @param n/a
* @return n/a
*/
/*
function input_admin_footer() {
}
*/
/*
* field_group_admin_enqueue_scripts()
*
* This action is called in the admin_enqueue_scripts action on the edit screen where your field is edited.
* Use this action to add CSS + JavaScript to assist your render_field_options() action.
*
* @type action (admin_enqueue_scripts)
* @since 3.6
* @date 23/01/13
*
* @param n/a
* @return n/a
*/
/*
function field_group_admin_enqueue_scripts() {
}
*/
/*
* field_group_admin_head()
*
* This action is called in the admin_head action on the edit screen where your field is edited.
* Use this action to add CSS and JavaScript to assist your render_field_options() action.
*
* @type action (admin_head)
* @since 3.6
* @date 23/01/13
*
* @param n/a
* @return n/a
*/
/*
function field_group_admin_head() {
}
*/
/*
* load_value()
*
* This filter is applied to the $value after it is loaded from the db
*
* @type filter
* @since 3.6
* @date 23/01/13
*
* @param $value (mixed) the value found in the database
* @param $post_id (mixed) the $post_id from which the value was loaded
* @param $field (array) the field array holding all the field options
* @return $value
*/
/*
function load_value( $value, $post_id, $field ) {
return $value;
}
*/
/*
* update_value()
*
* This filter is applied to the $value before it is saved in the db
*
* @type filter
* @since 3.6
* @date 23/01/13
*
* @param $value (mixed) the value found in the database
* @param $post_id (mixed) the $post_id from which the value was loaded
* @param $field (array) the field array holding all the field options
* @return $value
*/
/*
function update_value( $value, $post_id, $field ) {
return $value;
}
*/
/*
* format_value()
*
* This filter is appied to the $value after it is loaded from the db and before it is returned to the template
*
* @type filter
* @since 3.6
* @date 23/01/13
*
* @param $value (mixed) the value which was loaded from the database
* @param $post_id (mixed) the $post_id from which the value was loaded
* @param $field (array) the field array holding all the field options
*
* @return $value (mixed) the modified value
*/
/*
function format_value( $value, $post_id, $field ) {
// bail early if no value
if( empty($value) ) {
return $value;
}
// apply setting
if( $field['font_size'] > 12 ) {
// format the value
// $value = 'something';
}
// return
return $value;
}
*/
/*
* validate_value()
*
* This filter is used to perform validation on the value prior to saving.
* All values are validated regardless of the field's required setting. This allows you to validate and return
* messages to the user if the value is not correct
*
* @type filter
* @date 11/02/2014
* @since 5.0.0
*
* @param $valid (boolean) validation status based on the value and the field's required setting
* @param $value (mixed) the $_POST value
* @param $field (array) the field array holding all the field options
* @param $input (string) the corresponding input name for $_POST value
* @return $valid
*/
/*
function validate_value( $valid, $value, $field, $input ){
// Basic usage
if( $value < $field['custom_minimum_setting'] )
{
$valid = false;
}
// Advanced usage
if( $value < $field['custom_minimum_setting'] )
{
$valid = __('The value is too little!','TEXTDOMAIN'),
}
// return
return $valid;
}
*/
/*
* delete_value()
*
* This action is fired after a value has been deleted from the db.
* Please note that saving a blank value is treated as an update, not a delete
*
* @type action
* @date 6/03/2014
* @since 5.0.0
*
* @param $post_id (mixed) the $post_id from which the value was deleted
* @param $key (string) the $meta_key which the value was deleted
* @return n/a
*/
/*
function delete_value( $post_id, $key ) {
}
*/
/*
* load_field()
*
* This filter is applied to the $field after it is loaded from the database
*
* @type filter
* @date 23/01/2013
* @since 3.6.0
*
* @param $field (array) the field array holding all the field options
* @return $field
*/
/*
function load_field( $field ) {
return $field;
}
*/
/*
* update_field()
*
* This filter is applied to the $field before it is saved to the database
*
* @type filter
* @date 23/01/2013
* @since 3.6.0
*
* @param $field (array) the field array holding all the field options
* @return $field
*/
/*
function update_field( $field ) {
return $field;
}
*/
/*
* delete_field()
*
* This action is fired after a field is deleted from the database
*
* @type action
* @date 11/02/2014
* @since 5.0.0
*
* @param $field (array) the field array holding all the field options
* @return n/a
*/
/*
function delete_field( $field ) {
}
*/
}
// initialize
new NAMESPACE_acf_field_FIELD_NAME( $this->settings );
// class_exists check
endif;
?>
================================================
FILE: acf-FIELD-NAME/lang/README.md
================================================
# Translations directory
Use this directory to store .po and .mo files.
This directory can be removed if not used.
================================================
FILE: acf-FIELD-NAME/readme.txt
================================================
=== Advanced Custom Fields: FIELD_LABEL Field ===
Contributors: AUTHOR_NAME
Tags: PLUGIN_TAGS
Requires at least: 3.6.0
Tested up to: 4.9.0
Stable tag: trunk
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
SHORT_DESCRIPTION
== Description ==
EXTENDED_DESCRIPTION
= Compatibility =
This ACF field type is compatible with:
* ACF 5
* ACF 4
== Installation ==
1. Copy the `acf-FIELD-NAME` folder into your `wp-content/plugins` folder
2. Activate the FIELD_LABEL plugin via the plugins admin page
3. Create a new field via ACF and select the FIELD_LABEL type
4. Read the description above for usage instructions
== Changelog ==
= 1.0.0 =
* Initial Release.
gitextract_5m9lcrwj/
├── .gitignore
├── README.md
└── acf-FIELD-NAME/
├── README.md
├── acf-FIELD-NAME.php
├── assets/
│ ├── README.md
│ ├── css/
│ │ ├── README.md
│ │ └── input.css
│ ├── images/
│ │ └── README.md
│ └── js/
│ ├── README.md
│ └── input.js
├── fields/
│ ├── class-NAMESPACE-acf-field-FIELD-NAME-v4.php
│ └── class-NAMESPACE-acf-field-FIELD-NAME-v5.php
├── lang/
│ └── README.md
└── readme.txt
SYMBOL INDEX (22 symbols across 4 files)
FILE: acf-FIELD-NAME/acf-FIELD-NAME.php
class NAMESPACE_acf_plugin_FIELD_NAME (line 21) | class NAMESPACE_acf_plugin_FIELD_NAME {
method __construct (line 40) | function __construct() {
method include_field (line 70) | function include_field( $version = false ) {
FILE: acf-FIELD-NAME/assets/js/input.js
function initialize_field (line 16) | function initialize_field( $field ) {
FILE: acf-FIELD-NAME/fields/class-NAMESPACE-acf-field-FIELD-NAME-v4.php
class NAMESPACE_acf_field_FIELD_NAME (line 11) | class NAMESPACE_acf_field_FIELD_NAME extends acf_field {
method __construct (line 27) | function __construct( $settings )
method create_options (line 63) | function create_options( $field )
method create_field (line 115) | function create_field( $field )
method input_admin_enqueue_scripts (line 146) | function input_admin_enqueue_scripts()
method input_admin_head (line 180) | function input_admin_head()
method field_group_admin_enqueue_scripts (line 198) | function field_group_admin_enqueue_scripts()
method field_group_admin_head (line 216) | function field_group_admin_head()
method load_value (line 238) | function load_value( $value, $post_id, $field )
method update_value (line 261) | function update_value( $value, $post_id, $field )
method format_value (line 284) | function format_value( $value, $post_id, $field )
method format_value_for_api (line 315) | function format_value_for_api( $value, $post_id, $field )
method load_field (line 344) | function load_field( $field )
method update_field (line 366) | function update_field( $field, $post_id )
FILE: acf-FIELD-NAME/fields/class-NAMESPACE-acf-field-FIELD-NAME-v5.php
class NAMESPACE_acf_field_FIELD_NAME (line 11) | class NAMESPACE_acf_field_FIELD_NAME extends acf_field {
method __construct (line 27) | function __construct( $settings ) {
method render_field_settings (line 95) | function render_field_settings( $field ) {
method render_field (line 134) | function render_field( $field ) {
Condensed preview — 14 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (28K chars).
[
{
"path": ".gitignore",
"chars": 118,
"preview": "# OS generated files #\n######################\n.DS_Store\n.DS_Store?\n._*\n.Spotlight-V100\n.Trashes\nehthumbs.db\nThumbs.db\n"
},
{
"path": "README.md",
"chars": 397,
"preview": "# ACF Field Type Template (Deprecated)\n\nThis is an archived repository for the ACF Field Type Template for ACF v4 and V5"
},
{
"path": "acf-FIELD-NAME/README.md",
"chars": 118,
"preview": "# ACF FIELD_LABEL Field\n\nWelcome to the Advanced Custom Fields FIELD_LABEL repository on Github.\n\nEXTENDED_DESCRIPTION"
},
{
"path": "acf-FIELD-NAME/acf-FIELD-NAME.php",
"chars": 1742,
"preview": "<?php\n\n/*\nPlugin Name: Advanced Custom Fields: FIELD_LABEL\nPlugin URI: PLUGIN_URL\nDescription: SHORT_DESCRIPTION\nVersion"
},
{
"path": "acf-FIELD-NAME/assets/README.md",
"chars": 132,
"preview": "# assets directory\n\nUse this directory to store asset files such as CSS, JS and images.\n\nThis directory can be removed i"
},
{
"path": "acf-FIELD-NAME/assets/css/README.md",
"chars": 100,
"preview": "# CSS directory\n\nUse this directory to store CSS files.\n\nThis directory can be removed if not used.\n"
},
{
"path": "acf-FIELD-NAME/assets/css/input.css",
"chars": 0,
"preview": ""
},
{
"path": "acf-FIELD-NAME/assets/images/README.md",
"chars": 100,
"preview": "# Images directory\n\nUse this directory to store images.\n\nThis directory can be removed if not used.\n"
},
{
"path": "acf-FIELD-NAME/assets/js/README.md",
"chars": 98,
"preview": "# JS directory\n\nUse this directory to store JS files.\n\nThis directory can be removed if not used.\n"
},
{
"path": "acf-FIELD-NAME/assets/js/input.js",
"chars": 1284,
"preview": "(function($){\n\t\n\t\n\t/**\n\t* initialize_field\n\t*\n\t* This function will initialize the $field.\n\t*\n\t* @date\t30/11/17\n\t* @"
},
{
"path": "acf-FIELD-NAME/fields/class-NAMESPACE-acf-field-FIELD-NAME-v4.php",
"chars": 8429,
"preview": "<?php\n\n// exit if accessed directly\nif( ! defined( 'ABSPATH' ) ) exit;\n\n\n// check if class already exists\nif( !class_exi"
},
{
"path": "acf-FIELD-NAME/fields/class-NAMESPACE-acf-field-FIELD-NAME-v5.php",
"chars": 10714,
"preview": "<?php\n\n// exit if accessed directly\nif( ! defined( 'ABSPATH' ) ) exit;\n\n\n// check if class already exists\nif( !class_exi"
},
{
"path": "acf-FIELD-NAME/lang/README.md",
"chars": 117,
"preview": "# Translations directory\n\nUse this directory to store .po and .mo files.\n\nThis directory can be removed if not used.\n"
},
{
"path": "acf-FIELD-NAME/readme.txt",
"chars": 689,
"preview": "=== Advanced Custom Fields: FIELD_LABEL Field ===\nContributors: AUTHOR_NAME\nTags: PLUGIN_TAGS\nRequires at least: 3.6.0\nT"
}
]
About this extraction
This page contains the full source code of the AdvancedCustomFields/acf-field-type-template GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 14 files (23.5 KB), approximately 7.9k tokens, and a symbol index with 22 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.