function html() { // vars $view = array('version' => acf_get_setting('version'), 'have_pro' => acf_get_setting('pro'), 'tabs' => array('new' => __("What's New", 'acf'), 'changelog' => __("Changelog", 'acf')), 'active' => 'new'); // set active tab if (!empty($_GET['tab']) && array_key_exists($_GET['tab'], $view['tabs'])) { $view['active'] = $_GET['tab']; } // load view acf_get_view('settings-info', $view); }
function mb_fields() { // global global $post; // vars $field_group = acf_get_field_group($post); // get fields $view = array('fields' => acf_get_fields_by_id($field_group['ID'])); // load view acf_get_view('field-group-fields', $view); }
function html() { // load view acf_get_view($this->view, $this->data); }
function render_field_settings($field) { // load default layout if (empty($field['layouts'])) { $field['layouts'] = array(); $field['layouts'][] = $this->get_valid_layout(); } // loop through layouts foreach ($field['layouts'] as $layout) { // get valid layout $layout = $this->get_valid_layout($layout); // vars $layout_prefix = "{$field['prefix']}[layouts][{$layout['key']}]"; ?> <tr class="acf-field" data-name="fc_layout" data-setting="flexible_content" data-id="<?php echo $layout['key']; ?> "> <td class="acf-label"> <label><?php _e("Layout", 'acf'); ?> </label> <p class="description acf-fl-actions"> <a data-name="acf-fc-reorder" title="<?php _e("Reorder Layout", 'acf'); ?> " ><?php _e("Reorder", 'acf'); ?> </a> <a data-name="acf-fc-delete" title="<?php _e("Delete Layout", 'acf'); ?> " href="#"><?php _e("Delete", 'acf'); ?> </a> <a data-name="acf-fc-duplicate" title="<?php _e("Duplicate Layout", 'acf'); ?> " href="#"><?php _e("Duplicate", 'acf'); ?> </a> <a data-name="acf-fc-add" title="<?php _e("Add New Layout", 'acf'); ?> " href="#"><?php _e("Add New", 'acf'); ?> </a> </p> </td> <td class="acf-input"> <ul class="acf-fc-meta acf-bl"> <li class="acf-fc-meta-key"> <?php acf_hidden_input(array('name' => "{$layout_prefix}[key]", 'data-name' => 'layout-key', 'value' => $layout['key'])); ?> </li> <li class="acf-fc-meta-label"> <?php acf_render_field(array('type' => 'text', 'name' => 'label', 'prefix' => $layout_prefix, 'value' => $layout['label'], 'prepend' => __('Label', 'acf'))); ?> </li> <li class="acf-fc-meta-name"> <?php acf_render_field(array('type' => 'text', 'name' => 'name', 'prefix' => $layout_prefix, 'value' => $layout['name'], 'prepend' => __('Name', 'acf'))); ?> </li> <li class="acf-fc-meta-display"> <div class="acf-input-prepend"><?php _e('Layout', 'acf'); ?> </div> <div class="acf-input-wrap select"> <?php acf_render_field(array('type' => 'select', 'name' => 'display', 'prefix' => $layout_prefix, 'value' => $layout['display'], 'choices' => array('table' => __('Table', 'acf'), 'block' => __('Block', 'acf'), 'row' => __('Row', 'acf')))); ?> </div> </li> <li class="acf-fc-meta-min"> <?php acf_render_field(array('type' => 'text', 'name' => 'min', 'prefix' => $layout_prefix, 'value' => $layout['min'], 'prepend' => __('Min', 'acf'))); ?> </li> <li class="acf-fc-meta-max"> <?php acf_render_field(array('type' => 'text', 'name' => 'max', 'prefix' => $layout_prefix, 'value' => $layout['max'], 'prepend' => __('Max', 'acf'))); ?> </li> </ul> <?php // vars $args = array('fields' => $layout['sub_fields'], 'layout' => $layout['display'], 'parent' => $field['ID']); acf_get_view('field-group-fields', $args); ?> </td> </tr> <?php } // endforeach // min acf_render_field_setting($field, array('label' => __('Button Label', 'acf'), 'instructions' => '', 'type' => 'text', 'name' => 'button_label')); // min acf_render_field_setting($field, array('label' => __('Minimum Layouts', 'acf'), 'instructions' => '', 'type' => 'number', 'name' => 'min')); // max acf_render_field_setting($field, array('label' => __('Maximum Layouts', 'acf'), 'instructions' => '', 'type' => 'number', 'name' => 'max')); }
function render_field_settings($field) { // vars $args = array('fields' => $field['sub_fields'], 'layout' => $field['layout'], 'parent' => $field['ID']); ?> <tr class="acf-field" data-setting="repeater" data-name="sub_fields"> <td class="acf-label"> <label><?php _e("Sub Fields", 'acf'); ?> </label> <p class="description"></p> </td> <td class="acf-input"> <?php acf_get_view('field-group-fields', $args); ?> </td> </tr> <?php // rows $field['min'] = empty($field['min']) ? '' : $field['min']; $field['max'] = empty($field['max']) ? '' : $field['max']; // min acf_render_field_setting($field, array('label' => __('Minimum Rows', 'acf'), 'instructions' => '', 'type' => 'number', 'name' => 'min', 'placeholder' => '0')); // max acf_render_field_setting($field, array('label' => __('Maximum Rows', 'acf'), 'instructions' => '', 'type' => 'number', 'name' => 'max', 'placeholder' => '0')); // layout acf_render_field_setting($field, array('label' => __('Layout', 'acf'), 'instructions' => '', 'class' => 'acf-repeater-layout', 'type' => 'radio', 'name' => 'layout', 'layout' => 'horizontal', 'choices' => array('table' => __('Table', 'acf'), 'block' => __('Block', 'acf'), 'row' => __('Row', 'acf')))); // button_label acf_render_field_setting($field, array('label' => __('Button Label', 'acf'), 'instructions' => '', 'type' => 'text', 'name' => 'button_label')); }
function html() { // load view acf_get_view('settings-addons', $this->view); }
function html() { // view $view = array('updates' => acf_get_updates(), 'plugin_version' => acf_get_setting('version')); // enqueue acf_enqueue_scripts(); // load view acf_get_view('update', $view); }
} } ?> </div> <ul class="acf-hl acf-tfoot"> <li class="acf-fr"> <a href="#" class="button button-primary button-large add-field"><?php _e('+ Add Field', 'acf'); ?> </a> </li> </ul> <?php if (!$parent) { // get clone $clone = acf_get_valid_field(array('ID' => 'acfcloneindex', 'key' => 'acfcloneindex', 'label' => __('New Field', 'acf'), 'name' => 'new_field', 'type' => 'text')); ?> <script type="text/html" id="tmpl-acf-field"> <?php acf_get_view('field-group-field', array('field' => $clone)); ?> </script> <?php } ?> </div>
function html() { // view $view = array('updates' => acf_get_updates()); // load view acf_get_view('update', $view); }
function network_html() { // vars $plugin_version = acf_get_setting('version'); // loop through sites and find updates $sites = acf_get_sites(); if ($sites) { foreach ($sites as $i => $site) { // switch blog switch_to_blog($site['blog_id']); // extra info $site['name'] = get_bloginfo('name'); $site['url'] = home_url(); // get site updates $site['updates'] = acf_get_db_updates(); // get site version $site['acf_version'] = get_option('acf_version'); // no value equals new instal if (!$site['acf_version']) { $site['acf_version'] = $plugin_version; } // update $sites[$i] = $site; // restore restore_current_blog(); } } // view $view = array('sites' => $sites, 'plugin_version' => $plugin_version); // load view acf_get_view('install-network', $view); }
function mb_fields() { // global global $field_group; // get fields $view = array('fields' => acf_get_fields_by_id($field_group['ID']), 'parent' => 0); // load view acf_get_view('field-group-fields', $view); }
function html() { // view $view = array('updates' => acf_get_db_updates(), 'plugin_version' => acf_get_setting('version')); // load view acf_get_view('install', $view); }
// label acf_render_field_wrap(array('label' => __('Field Label', 'acf'), 'instructions' => __('This is the name which will appear on the EDIT page', 'acf'), 'required' => 1, 'type' => 'text', 'name' => 'label', 'prefix' => $field['prefix'], 'value' => $field['label']), 'tr'); // name acf_render_field_wrap(array('label' => __('Field Name', 'acf'), 'instructions' => __('Single word, no spaces. Underscores and dashes allowed', 'acf'), 'required' => 1, 'type' => 'text', 'name' => 'name', 'prefix' => $field['prefix'], 'value' => $field['name']), 'tr'); // type acf_render_field_wrap(array('label' => __('Field Type', 'acf'), 'instructions' => '', 'required' => 1, 'type' => 'select', 'name' => 'type', 'prefix' => $field['prefix'], 'value' => $field['type'], 'choices' => acf_get_field_types()), 'tr'); // instructions acf_render_field_wrap(array('label' => __('Instructions', 'acf'), 'instructions' => __('Instructions for authors. Shown when submitting data', 'acf'), 'type' => 'textarea', 'name' => 'instructions', 'prefix' => $field['prefix'], 'value' => $field['instructions'], 'rows' => 5), 'tr'); // required acf_render_field_wrap(array('label' => __('Required?', 'acf'), 'instructions' => '', 'type' => 'radio', 'name' => 'required', 'prefix' => $field['prefix'], 'value' => $field['required'], 'choices' => array(1 => __("Yes", 'acf'), 0 => __("No", 'acf')), 'layout' => 'horizontal'), 'tr'); // type specific settings do_action("acf/render_field_settings/type={$field['type']}", $field); // 3rd party settings do_action('acf/render_field_settings', $field); // conditional logic acf_get_view('field-group-field-conditional-logic', array('field' => $field)); // wrapper acf_render_field_wrap(array('label' => __('Wrapper Attributes', 'acf'), 'instructions' => '', 'type' => 'text', 'name' => 'width', 'prefix' => $field['prefix'] . '[wrapper]', 'value' => $field['wrapper']['width'], 'prepend' => __('width', 'acf'), 'append' => '%', 'wrapper' => array('data-name' => 'wrapper')), 'tr'); acf_render_field_wrap(array('label' => '', 'instructions' => '', 'type' => 'text', 'name' => 'class', 'prefix' => $field['prefix'] . '[wrapper]', 'value' => $field['wrapper']['class'], 'prepend' => __('class', 'acf'), 'wrapper' => array('data-append' => 'wrapper')), 'tr'); acf_render_field_wrap(array('label' => '', 'instructions' => '', 'type' => 'text', 'name' => 'id', 'prefix' => $field['prefix'] . '[wrapper]', 'value' => $field['wrapper']['id'], 'prepend' => __('id', 'acf'), 'wrapper' => array('data-append' => 'wrapper')), 'tr'); ?> <tr class="acf-field acf-field-save"> <td class="acf-label"></td> <td class="acf-input"> <ul class="acf-hl"> <li> <a class="edit-field acf-button grey" title="<?php _e("Close Field", 'acf'); ?> " href="#"><?php _e("Close Field", 'acf');
</li> </ul> <div class="acf-field-list<?php if ($layout) { echo " layout-{$layout}"; } ?> "> <?php foreach ($fields as $i => $field) { ?> <?php acf_get_view('field-group-field', array('field' => $field, 'i' => $i)); ?> <?php } ?> <div class="no-fields-message" <?php if (count($fields) > 1) { echo 'style="display:none;"'; } ?> > <?php _e("No fields. Click the <strong>+ Add Field</strong> button to create your first field.", 'acf'); ?>