Create New Item
×
Item Type
File
Folder
Item Name
×
Search file in folder and subfolders...
File Manager
/
wp-content
/
plugins
/
advanced-custom-fields
/
includes
/
fields
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php if (!class_exists('acf_field_tab')) { class acf_field_tab extends acf_field { function initialize() { $this->name = 'tab'; $this->label = __('Tab', 'acf'); $this->category = 'layout'; $this->defaults = array('placement' => 'top', 'endpoint' => 0); } function render_field($field) { $atts = array('href' => '', 'class' => 'acf-tab-button', 'data-placement' => $field['placement'], 'data-endpoint' => $field['endpoint'], 'data-key' => $field['key']); ?> <a <?php acf_esc_attr_e($atts); ?>><?php echo acf_esc_html($field['label']); ?></a> <?php } function render_field_settings($field) { acf_render_field_setting($field, array('label' => __('Placement', 'acf'), 'type' => 'select', 'name' => 'placement', 'choices' => array('top' => __('Top aligned', 'acf'), 'left' => __('Left aligned', 'acf')))); acf_render_field_setting($field, array('label' => __('Endpoint', 'acf'), 'instructions' => __('Define an endpoint for the previous tabs to stop. This will start a new group of tabs.', 'acf'), 'name' => 'endpoint', 'type' => 'true_false', 'ui' => 1)); } function load_field($field) { $field['name'] = ''; $field['instructions'] = ''; $field['required'] = 0; $field['value'] = false; return $field; } } acf_register_field_type('acf_field_tab'); }