Version Description
- Module: Added Dynamic Post Type module
- Module: Added Dynamic Taxonomy module
- Admin: Added WP Options page
- Field: Added Post Type Selection field
- Field: Added Taxonomy Selection field
- Field: Added Slug field
- Field Groups: Fixed 'no field groups found' wrong colspan
- General: Reworked plugin folders and files hierarchy
Download this release
Release Info
Developer | hwk-fr |
Plugin | Advanced Custom Fields: Extended |
Version | 0.5.5 |
Comparing to | |
See all releases |
Code changes from version 0.5.2.3 to 0.5.5
- acf-extended.php +24 -8
- assets/{admin.css → acf-extended.css} +0 -0
- assets/{admin.js → acf-extended.js} +0 -0
- assets/fields.js +29 -0
- includes/admin/options.php +206 -0
- includes/core/enqueue.php +7 -2
- includes/field-groups/field-group-category.php +5 -2
- includes/field-groups/field-group.php +0 -28
- includes/field-groups/field-groups.php +4 -0
- includes/{fields/settings-data.php → fields-settings/data.php} +0 -0
- includes/{fields/settings-permissions.php → fields-settings/permissions.php} +0 -0
- includes/{fields/settings-update.php → fields-settings/update.php} +15 -1
- includes/{fields/settings-validation.php → fields-settings/validation.php} +19 -3
- includes/fields/field-button.php +130 -134
- includes/fields/field-dynamic-message.php +10 -14
- includes/fields/field-post-types.php +166 -0
- includes/fields/field-slug.php +137 -0
- includes/fields/field-taxonomies.php +166 -0
- includes/locations/post-type-all.php +36 -0
- includes/modules/dynamic-post-type.php +2359 -0
- includes/modules/dynamic-taxonomy.php +1719 -0
- readme.txt +35 -1
acf-extended.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Plugin Name: Advanced Custom Fields: Extended
|
4 |
* Description: Enhancement Suite which improves Advanced Custom Fields administration
|
5 |
-
* Version: 0.5.
|
6 |
* Author: hwk-fr
|
7 |
* Author URI: https://hwk.fr
|
8 |
* Text Domain: acfe
|
@@ -55,17 +55,18 @@ function acfe_init(){
|
|
55 |
require_once(ACFE_PATH . 'includes/core/helpers.php');
|
56 |
|
57 |
/**
|
58 |
-
*
|
59 |
*/
|
60 |
require_once(ACFE_PATH . 'includes/admin/settings.php');
|
|
|
61 |
|
62 |
/**
|
63 |
* Fields settings
|
64 |
*/
|
65 |
-
require_once(ACFE_PATH . 'includes/fields/
|
66 |
-
require_once(ACFE_PATH . 'includes/fields/
|
67 |
-
require_once(ACFE_PATH . 'includes/fields/
|
68 |
-
require_once(ACFE_PATH . 'includes/fields/
|
69 |
|
70 |
/**
|
71 |
* Field Groups
|
@@ -74,15 +75,30 @@ function acfe_init(){
|
|
74 |
require_once(ACFE_PATH . 'includes/field-groups/field-group-category.php');
|
75 |
require_once(ACFE_PATH . 'includes/field-groups/field-groups.php');
|
76 |
|
|
|
|
|
|
|
|
|
|
|
77 |
/**
|
78 |
* Modules
|
79 |
*/
|
80 |
require_once(ACFE_PATH . 'includes/modules/autosync.php');
|
|
|
|
|
81 |
|
82 |
}
|
83 |
|
84 |
/**
|
85 |
* Fields
|
86 |
*/
|
87 |
-
|
88 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
/**
|
3 |
* Plugin Name: Advanced Custom Fields: Extended
|
4 |
* Description: Enhancement Suite which improves Advanced Custom Fields administration
|
5 |
+
* Version: 0.5.5
|
6 |
* Author: hwk-fr
|
7 |
* Author URI: https://hwk.fr
|
8 |
* Text Domain: acfe
|
55 |
require_once(ACFE_PATH . 'includes/core/helpers.php');
|
56 |
|
57 |
/**
|
58 |
+
* Admin Pages
|
59 |
*/
|
60 |
require_once(ACFE_PATH . 'includes/admin/settings.php');
|
61 |
+
require_once(ACFE_PATH . 'includes/admin/options.php');
|
62 |
|
63 |
/**
|
64 |
* Fields settings
|
65 |
*/
|
66 |
+
require_once(ACFE_PATH . 'includes/fields-settings/data.php');
|
67 |
+
require_once(ACFE_PATH . 'includes/fields-settings/permissions.php');
|
68 |
+
require_once(ACFE_PATH . 'includes/fields-settings/update.php');
|
69 |
+
require_once(ACFE_PATH . 'includes/fields-settings/validation.php');
|
70 |
|
71 |
/**
|
72 |
* Field Groups
|
75 |
require_once(ACFE_PATH . 'includes/field-groups/field-group-category.php');
|
76 |
require_once(ACFE_PATH . 'includes/field-groups/field-groups.php');
|
77 |
|
78 |
+
/**
|
79 |
+
* Locations
|
80 |
+
*/
|
81 |
+
require_once(ACFE_PATH . 'includes/locations/post-type-all.php');
|
82 |
+
|
83 |
/**
|
84 |
* Modules
|
85 |
*/
|
86 |
require_once(ACFE_PATH . 'includes/modules/autosync.php');
|
87 |
+
require_once(ACFE_PATH . 'includes/modules/dynamic-post-type.php');
|
88 |
+
require_once(ACFE_PATH . 'includes/modules/dynamic-taxonomy.php');
|
89 |
|
90 |
}
|
91 |
|
92 |
/**
|
93 |
* Fields
|
94 |
*/
|
95 |
+
add_action('acf/include_field_types', 'acfe_fields');
|
96 |
+
function acfe_fields(){
|
97 |
+
|
98 |
+
require_once(ACFE_PATH . 'includes/fields/field-button.php');
|
99 |
+
require_once(ACFE_PATH . 'includes/fields/field-dynamic-message.php');
|
100 |
+
require_once(ACFE_PATH . 'includes/fields/field-post-types.php');
|
101 |
+
require_once(ACFE_PATH . 'includes/fields/field-slug.php');
|
102 |
+
require_once(ACFE_PATH . 'includes/fields/field-taxonomies.php');
|
103 |
+
|
104 |
+
}
|
assets/{admin.css → acf-extended.css}
RENAMED
File without changes
|
assets/{admin.js → acf-extended.js}
RENAMED
File without changes
|
assets/fields.js
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function($){
|
2 |
+
|
3 |
+
if(typeof acf == 'undefined')
|
4 |
+
return;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Field: Slug
|
8 |
+
*/
|
9 |
+
acf.addAction('prepare_field/type=acfe_slug', function(field){
|
10 |
+
|
11 |
+
field.$el.bind('input', function(e){
|
12 |
+
field.val(field.val().toLowerCase()
|
13 |
+
.replace(/\s+/g, '-') // Replace spaces with -
|
14 |
+
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
|
15 |
+
.replace(/\-\-+/g, '-') // Replace multiple - with single -
|
16 |
+
.replace(/\_\_+/g, '_') // Replace multiple _ with single _
|
17 |
+
.replace(/^-+/, '')); // Trim - from start of text
|
18 |
+
});
|
19 |
+
|
20 |
+
field.$el.on('focusout', function(e){
|
21 |
+
field.val(field.val().toLowerCase()
|
22 |
+
.replace(/-+$/, '') // Trim - from end of text
|
23 |
+
.replace(/_+$/, '')); // Trim _ from end of text
|
24 |
+
});
|
25 |
+
|
26 |
+
|
27 |
+
});
|
28 |
+
|
29 |
+
})(jQuery);
|
includes/admin/options.php
ADDED
@@ -0,0 +1,206 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if(!defined('ABSPATH'))
|
4 |
+
exit;
|
5 |
+
|
6 |
+
add_action('init', 'acfe_options_register');
|
7 |
+
function acfe_options_register(){
|
8 |
+
|
9 |
+
if(!is_admin())
|
10 |
+
return;
|
11 |
+
|
12 |
+
acf_add_options_page(array(
|
13 |
+
'page_title' => 'Options <span style="word-wrap: break-word;padding: 2px 6px;margin-left:1px;border-radius:2px;background:#555;color: #fff; font-size: 14px;vertical-align: text-bottom;">BETA</span>',
|
14 |
+
'menu_title' => 'Options',
|
15 |
+
'menu_slug' => 'acfe-options',
|
16 |
+
'post_id' => 'acfe-options',
|
17 |
+
'parent_slug' => 'options-general.php',
|
18 |
+
'capability' => 'manage_options',
|
19 |
+
'redirect' => false
|
20 |
+
));
|
21 |
+
|
22 |
+
}
|
23 |
+
|
24 |
+
add_action('admin_init', 'acfe_options_field_group');
|
25 |
+
function acfe_options_field_group(){
|
26 |
+
|
27 |
+
global $pagenow;
|
28 |
+
if(empty($pagenow) || $pagenow != 'options-general.php' || !isset($_GET['page']) || $_GET['page'] != 'acfe-options')
|
29 |
+
return;
|
30 |
+
|
31 |
+
global $wpdb;
|
32 |
+
$options = $wpdb->get_results("SELECT * FROM $wpdb->options ORDER BY option_name");
|
33 |
+
if(empty($options))
|
34 |
+
return;
|
35 |
+
|
36 |
+
$acfe_options = array();
|
37 |
+
foreach((array) $options as $option){
|
38 |
+
if($option->option_name == '')
|
39 |
+
continue;
|
40 |
+
|
41 |
+
$option_name = esc_attr($option->option_name);
|
42 |
+
$acfe_options[] = $option_name;
|
43 |
+
|
44 |
+
}
|
45 |
+
|
46 |
+
update_option('acfe_options', $acfe_options);
|
47 |
+
|
48 |
+
$options = $wpdb->get_results("SELECT * FROM $wpdb->options ORDER BY option_name");
|
49 |
+
|
50 |
+
$fields = array();
|
51 |
+
foreach((array) $options as $option){
|
52 |
+
|
53 |
+
if($option->option_name == '')
|
54 |
+
continue;
|
55 |
+
|
56 |
+
$option_name = esc_attr($option->option_name);
|
57 |
+
$option_value = $option->option_value;
|
58 |
+
|
59 |
+
$fields[] = array(
|
60 |
+
'field_acfe_option_name' => $option_name,
|
61 |
+
'field_acfe_option_value' => $option_value,
|
62 |
+
);
|
63 |
+
|
64 |
+
}
|
65 |
+
|
66 |
+
acf_add_local_field_group(array(
|
67 |
+
'key' => 'acfe_group_options',
|
68 |
+
'title' => 'Options',
|
69 |
+
|
70 |
+
'location' => array(
|
71 |
+
array(
|
72 |
+
array(
|
73 |
+
'param' => 'options_page',
|
74 |
+
'operator' => '==',
|
75 |
+
'value' => 'acfe-options',
|
76 |
+
),
|
77 |
+
),
|
78 |
+
),
|
79 |
+
|
80 |
+
'menu_order' => 0,
|
81 |
+
'position' => 'normal',
|
82 |
+
'style' => 'seamless',
|
83 |
+
'label_placement' => 'top',
|
84 |
+
'instruction_placement' => 'label',
|
85 |
+
'hide_on_screen' => '',
|
86 |
+
'active' => 1,
|
87 |
+
'description' => '',
|
88 |
+
|
89 |
+
'fields' => array(
|
90 |
+
array(
|
91 |
+
'label' => '',
|
92 |
+
'key' => 'field_acfe_options_repeater',
|
93 |
+
'name' => 'acfe_options_repeater',
|
94 |
+
'type' => 'repeater',
|
95 |
+
'instructions' => '',
|
96 |
+
'required' => 0,
|
97 |
+
'conditional_logic' => 0,
|
98 |
+
'wrapper' => array(
|
99 |
+
'width' => '',
|
100 |
+
'class' => '',
|
101 |
+
'id' => '',
|
102 |
+
),
|
103 |
+
'collapsed' => '',
|
104 |
+
'min' => 0,
|
105 |
+
'max' => 0,
|
106 |
+
'layout' => 'table',
|
107 |
+
'button_label' => __('Add option'),
|
108 |
+
'value' => $fields,
|
109 |
+
'sub_fields' => array(
|
110 |
+
array(
|
111 |
+
'label' => 'Option name',
|
112 |
+
'key' => 'field_acfe_option_name',
|
113 |
+
'name' => 'acfe_field_option_name',
|
114 |
+
'type' => 'text',
|
115 |
+
'instructions' => '',
|
116 |
+
'required' => 0,
|
117 |
+
'conditional_logic' => 0,
|
118 |
+
'wrapper' => array(
|
119 |
+
'width' => 33,
|
120 |
+
'class' => '',
|
121 |
+
'id' => '',
|
122 |
+
),
|
123 |
+
'acfe_validate' => '',
|
124 |
+
'acfe_update' => '',
|
125 |
+
'acfe_permissions' => '',
|
126 |
+
'default_value' => '',
|
127 |
+
'placeholder' => '',
|
128 |
+
'prepend' => '',
|
129 |
+
'append' => '',
|
130 |
+
'maxlength' => '',
|
131 |
+
),
|
132 |
+
array(
|
133 |
+
'label' => 'Option value',
|
134 |
+
'key' => 'field_acfe_option_value',
|
135 |
+
'name' => 'acfe_option_value',
|
136 |
+
'type' => 'text',
|
137 |
+
'instructions' => '',
|
138 |
+
'required' => 0,
|
139 |
+
'conditional_logic' => 0,
|
140 |
+
'wrapper' => array(
|
141 |
+
'width' => '',
|
142 |
+
'class' => '',
|
143 |
+
'id' => '',
|
144 |
+
),
|
145 |
+
'acfe_validate' => '',
|
146 |
+
'acfe_update' => '',
|
147 |
+
'acfe_permissions' => '',
|
148 |
+
'default_value' => '',
|
149 |
+
'placeholder' => '',
|
150 |
+
'prepend' => '',
|
151 |
+
'append' => '',
|
152 |
+
'maxlength' => '',
|
153 |
+
),
|
154 |
+
),
|
155 |
+
),
|
156 |
+
),
|
157 |
+
));
|
158 |
+
|
159 |
+
}
|
160 |
+
|
161 |
+
add_filter('acf/prepare_field/key=field_acfe_option_value', 'acfe_options_prepare_value');
|
162 |
+
function acfe_options_prepare_value($field){
|
163 |
+
|
164 |
+
if(is_serialized($field['value'])){
|
165 |
+
$field['type'] = 'textarea';
|
166 |
+
$field['rows'] = 8;
|
167 |
+
$field['disabled'] = true;
|
168 |
+
$field['readonly'] = true;
|
169 |
+
$field['value'] = print_r(maybe_unserialize($field['value']), true);
|
170 |
+
}
|
171 |
+
|
172 |
+
return $field;
|
173 |
+
|
174 |
+
}
|
175 |
+
|
176 |
+
add_action('acf/save_post', 'acfe_options_save', 0);
|
177 |
+
function acfe_options_save($post_id){
|
178 |
+
|
179 |
+
if($_POST['_acf_post_id'] != 'acfe-options' || empty($_POST['acf']))
|
180 |
+
return;
|
181 |
+
|
182 |
+
$acfe_options = get_option('acfe_options', array());
|
183 |
+
|
184 |
+
foreach($_POST['acf']['field_acfe_options_repeater'] as $option){
|
185 |
+
|
186 |
+
$option_key = array_search($option['field_acfe_option_name'], $acfe_options);
|
187 |
+
if($option_key !== false)
|
188 |
+
unset($acfe_options[$option_key]);
|
189 |
+
|
190 |
+
if(!isset($option['field_acfe_option_value']))
|
191 |
+
continue;
|
192 |
+
|
193 |
+
update_option($option['field_acfe_option_name'], stripslashes($option['field_acfe_option_value']));
|
194 |
+
|
195 |
+
}
|
196 |
+
|
197 |
+
if(!empty($acfe_options)){
|
198 |
+
foreach($acfe_options as $option){
|
199 |
+
delete_option($option);
|
200 |
+
}
|
201 |
+
}
|
202 |
+
|
203 |
+
$_POST['acf'] = array();
|
204 |
+
return;
|
205 |
+
|
206 |
+
}
|
includes/core/enqueue.php
CHANGED
@@ -14,11 +14,16 @@ function acfe_enqueue_admin(){
|
|
14 |
// CSS
|
15 |
wp_enqueue_style('acf-input');
|
16 |
wp_enqueue_style('wp-jquery-ui-dialog');
|
17 |
-
wp_enqueue_style('
|
18 |
|
19 |
// JS
|
20 |
wp_enqueue_script('acf-input');
|
21 |
wp_enqueue_script('jquery-ui-core');
|
22 |
wp_enqueue_script('jquery-ui-dialog');
|
23 |
-
wp_enqueue_script('
|
|
|
|
|
|
|
|
|
|
|
24 |
}
|
14 |
// CSS
|
15 |
wp_enqueue_style('acf-input');
|
16 |
wp_enqueue_style('wp-jquery-ui-dialog');
|
17 |
+
wp_enqueue_style('acf-extended', plugins_url('assets/acf-extended.css', ACFE_FILE), false, null);
|
18 |
|
19 |
// JS
|
20 |
wp_enqueue_script('acf-input');
|
21 |
wp_enqueue_script('jquery-ui-core');
|
22 |
wp_enqueue_script('jquery-ui-dialog');
|
23 |
+
wp_enqueue_script('acf-extended', plugins_url('assets/acf-extended.js', ACFE_FILE), array('jquery'), null);
|
24 |
+
}
|
25 |
+
|
26 |
+
add_action('acf/input/admin_enqueue_scripts', 'acfe_enqueue_fields');
|
27 |
+
function acfe_enqueue_fields(){
|
28 |
+
wp_enqueue_script('acfe-fields-js', plugins_url('assets/fields.js', ACFE_FILE), array('jquery'), null);
|
29 |
}
|
includes/field-groups/field-group-category.php
CHANGED
@@ -8,11 +8,12 @@ function acfe_field_group_category_register(){
|
|
8 |
register_taxonomy('acf-field-group-category', array('acf-field-group'), array(
|
9 |
'hierarchical' => true,
|
10 |
'public' => false,
|
11 |
-
'show_ui' =>
|
12 |
'show_admin_column' => true,
|
13 |
'show_in_menu' => true,
|
14 |
'show_in_nav_menus' => true,
|
15 |
'show_tagcloud' => false,
|
|
|
16 |
'labels' => array(
|
17 |
'name' => _x('Categories', 'Category'),
|
18 |
'singular_name' => _x('Categories', 'Category'),
|
@@ -62,8 +63,10 @@ function acfe_field_group_category_column($columns){
|
|
62 |
add_action('manage_acf-field-group_posts_custom_column' , 'acfe_field_group_category_column_html', 10, 2);
|
63 |
function acfe_field_group_category_column_html($column, $post_id){
|
64 |
if($column == 'acf-field-group-category'){
|
65 |
-
if(!$terms = get_the_terms($post_id, 'acf-field-group-category'))
|
|
|
66 |
return;
|
|
|
67 |
|
68 |
$categories = array();
|
69 |
foreach($terms as $term){
|
8 |
register_taxonomy('acf-field-group-category', array('acf-field-group'), array(
|
9 |
'hierarchical' => true,
|
10 |
'public' => false,
|
11 |
+
'show_ui' => 'ACFE',
|
12 |
'show_admin_column' => true,
|
13 |
'show_in_menu' => true,
|
14 |
'show_in_nav_menus' => true,
|
15 |
'show_tagcloud' => false,
|
16 |
+
'rewrite' => false,
|
17 |
'labels' => array(
|
18 |
'name' => _x('Categories', 'Category'),
|
19 |
'singular_name' => _x('Categories', 'Category'),
|
63 |
add_action('manage_acf-field-group_posts_custom_column' , 'acfe_field_group_category_column_html', 10, 2);
|
64 |
function acfe_field_group_category_column_html($column, $post_id){
|
65 |
if($column == 'acf-field-group-category'){
|
66 |
+
if(!$terms = get_the_terms($post_id, 'acf-field-group-category')){
|
67 |
+
echo '—';
|
68 |
return;
|
69 |
+
}
|
70 |
|
71 |
$categories = array();
|
72 |
foreach($terms as $term){
|
includes/field-groups/field-group.php
CHANGED
@@ -375,32 +375,4 @@ function acfc_field_group_default_options($field_group){
|
|
375 |
$field_group['label_placement'] = 'left';
|
376 |
|
377 |
return $field_group;
|
378 |
-
}
|
379 |
-
|
380 |
-
/**
|
381 |
-
* Hooks: Locations - Post Type - All (Values)
|
382 |
-
*/
|
383 |
-
add_filter('acf/location/rule_values/post_type', 'acfc_field_group_locations_values_post_type_all');
|
384 |
-
function acfc_field_group_locations_values_post_type_all($choices){
|
385 |
-
$choices = array_merge(array('all' => __('All')), $choices);
|
386 |
-
return $choices;
|
387 |
-
}
|
388 |
-
|
389 |
-
/**
|
390 |
-
* Hooks: Locations - Post Type - All (Match)
|
391 |
-
*/
|
392 |
-
add_filter('acf/location/rule_match', 'acfc_field_group_locations_match_post_type_all', 10, 3);
|
393 |
-
function acfc_field_group_locations_match_post_type_all($match, $rule, $options){
|
394 |
-
if($rule['param'] != 'post_type' || $rule['value'] != 'all')
|
395 |
-
return $match;
|
396 |
-
|
397 |
-
if($rule['operator'] == "=="){
|
398 |
-
$match = isset($options['post_type']) && !empty($options['post_type']);
|
399 |
-
}
|
400 |
-
|
401 |
-
elseif($rule['operator'] == "!="){
|
402 |
-
$match = !isset($options['post_type']) || empty($options['post_type']);
|
403 |
-
}
|
404 |
-
|
405 |
-
return $match;
|
406 |
}
|
375 |
$field_group['label_placement'] = 'left';
|
376 |
|
377 |
return $field_group;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
378 |
}
|
includes/field-groups/field-groups.php
CHANGED
@@ -297,6 +297,10 @@ add_action('current_screen', function(){
|
|
297 |
// ACFE: Debug
|
298 |
//$('#posts-filter').append($('#tmpl-acfe-debug').html());
|
299 |
|
|
|
|
|
|
|
|
|
300 |
// ACFE: Table Row Actions - Export Wrap Form
|
301 |
$('.acfe-export-json .acfe-form').each(function(k, v){
|
302 |
$(this).wrapAll('<form action="' + $(this).attr('data-action') + '" method="post" style="display:inline;"></form>');
|
297 |
// ACFE: Debug
|
298 |
//$('#posts-filter').append($('#tmpl-acfe-debug').html());
|
299 |
|
300 |
+
|
301 |
+
// Fix no field groups found
|
302 |
+
$('#the-list tr.no-items td').attr('colspan', 9);
|
303 |
+
|
304 |
// ACFE: Table Row Actions - Export Wrap Form
|
305 |
$('.acfe-export-json .acfe-form').each(function(k, v){
|
306 |
$(this).wrapAll('<form action="' + $(this).attr('data-action') + '" method="post" style="display:inline;"></form>');
|
includes/{fields/settings-data.php → fields-settings/data.php}
RENAMED
File without changes
|
includes/{fields/settings-permissions.php → fields-settings/permissions.php}
RENAMED
File without changes
|
includes/{fields/settings-update.php → fields-settings/update.php}
RENAMED
@@ -24,13 +24,27 @@ function acfe_update_functions($choices){
|
|
24 |
);
|
25 |
}
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
/**
|
28 |
* Add Setting
|
29 |
*/
|
30 |
add_action('acf/render_field_settings', 'acfe_update_settings', 991);
|
31 |
function acfe_update_settings($field){
|
32 |
|
33 |
-
$exclude = apply_filters('acfe/update/exclude
|
34 |
if($exclude)
|
35 |
return;
|
36 |
|
24 |
);
|
25 |
}
|
26 |
|
27 |
+
/**
|
28 |
+
* Exclude layout advanced fields
|
29 |
+
*/
|
30 |
+
add_filter('acfe/update/exclude', 'acfe_update_exclude', 10, 2);
|
31 |
+
function acfe_update_exclude($exclude, $field){
|
32 |
+
|
33 |
+
$excludes = array('message', 'accordion', 'tab', 'group', 'repeater', 'flexible_content', 'clone', 'acfe_dynamic_message');
|
34 |
+
if(in_array($field['type'], $excludes))
|
35 |
+
$exclude = true;
|
36 |
+
|
37 |
+
return $exclude;
|
38 |
+
|
39 |
+
}
|
40 |
+
|
41 |
/**
|
42 |
* Add Setting
|
43 |
*/
|
44 |
add_action('acf/render_field_settings', 'acfe_update_settings', 991);
|
45 |
function acfe_update_settings($field){
|
46 |
|
47 |
+
$exclude = apply_filters('acfe/update/exclude', false, $field);
|
48 |
if($exclude)
|
49 |
return;
|
50 |
|
includes/{fields/settings-validation.php → fields-settings/validation.php}
RENAMED
@@ -36,6 +36,7 @@ function acfe_value($result, $value, $field){
|
|
36 |
*/
|
37 |
add_filter('acfe/validate/functions', 'acfe_validate_functions', 0);
|
38 |
function acfe_validate_functions($choices){
|
|
|
39 |
return array(
|
40 |
'Global' => array(
|
41 |
'acfe_value' => 'Value (acfe_value)',
|
@@ -74,6 +75,21 @@ function acfe_validate_functions($choices){
|
|
74 |
'is_user_logged_in' => 'Is user logged in (is_user_logged_in)',
|
75 |
)
|
76 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
}
|
78 |
|
79 |
/**
|
@@ -228,10 +244,10 @@ function acfe_validate_value($valid, $value, $field, $input){
|
|
228 |
|
229 |
// Check filters
|
230 |
$filters = array(
|
231 |
-
'acfe/validate/function/' . $rule['acfe_validate_function'],
|
232 |
-
'acfe/validate/function/' . $rule['acfe_validate_function'] . '/type=' . $field['type'],
|
233 |
-
'acfe/validate/function/' . $rule['acfe_validate_function'] . '/name=' . $field['name'],
|
234 |
'acfe/validate/function/' . $rule['acfe_validate_function'] . '/key=' . $field['key'],
|
|
|
|
|
|
|
235 |
);
|
236 |
|
237 |
$filter_call = false;
|
36 |
*/
|
37 |
add_filter('acfe/validate/functions', 'acfe_validate_functions', 0);
|
38 |
function acfe_validate_functions($choices){
|
39 |
+
|
40 |
return array(
|
41 |
'Global' => array(
|
42 |
'acfe_value' => 'Value (acfe_value)',
|
75 |
'is_user_logged_in' => 'Is user logged in (is_user_logged_in)',
|
76 |
)
|
77 |
);
|
78 |
+
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Exclude layout advanced fields
|
83 |
+
*/
|
84 |
+
add_filter('acfe/validate/exclude', 'acfe_validate_exclude', 10, 2);
|
85 |
+
function acfe_validate_exclude($exclude, $field){
|
86 |
+
|
87 |
+
$excludes = array('message', 'accordion', 'tab', 'group', 'repeater', 'flexible_content', 'clone', 'acfe_dynamic_message');
|
88 |
+
if(in_array($field['type'], $excludes))
|
89 |
+
$exclude = true;
|
90 |
+
|
91 |
+
return $exclude;
|
92 |
+
|
93 |
}
|
94 |
|
95 |
/**
|
244 |
|
245 |
// Check filters
|
246 |
$filters = array(
|
|
|
|
|
|
|
247 |
'acfe/validate/function/' . $rule['acfe_validate_function'] . '/key=' . $field['key'],
|
248 |
+
'acfe/validate/function/' . $rule['acfe_validate_function'] . '/name=' . $field['name'],
|
249 |
+
'acfe/validate/function/' . $rule['acfe_validate_function'] . '/type=' . $field['type'],
|
250 |
+
'acfe/validate/function/' . $rule['acfe_validate_function'],
|
251 |
);
|
252 |
|
253 |
$filter_call = false;
|
includes/fields/field-button.php
CHANGED
@@ -3,149 +3,145 @@
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
function __construct(){
|
11 |
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
|
16 |
-
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
),
|
49 |
-
'wrapper' => array(
|
50 |
-
'width' => 33
|
51 |
-
)
|
52 |
-
),
|
53 |
-
|
54 |
-
array(
|
55 |
-
'label' => '',
|
56 |
-
'instructions' => '',
|
57 |
-
'type' => 'text',
|
58 |
-
'name' => 'button_class',
|
59 |
-
'_name' => 'button_class',
|
60 |
-
'key' => 'button_class',
|
61 |
-
'required' => false,
|
62 |
-
'prepend' => 'class',
|
63 |
-
'wrapper' => array(
|
64 |
-
'width' => 33
|
65 |
-
)
|
66 |
-
),
|
67 |
-
|
68 |
-
array(
|
69 |
-
'label' => '',
|
70 |
-
'instructions' => '',
|
71 |
-
'type' => 'text',
|
72 |
-
'name' => 'button_id',
|
73 |
-
'_name' => 'button_id',
|
74 |
-
'key' => 'button_id',
|
75 |
-
'required' => false,
|
76 |
-
'prepend' => 'id',
|
77 |
-
'wrapper' => array(
|
78 |
-
'width' => 33
|
79 |
-
)
|
80 |
-
),
|
81 |
-
|
82 |
-
|
83 |
-
)
|
84 |
-
));
|
85 |
-
|
86 |
-
acf_render_field_setting($field, array(
|
87 |
-
'label' => __('Button wrapper', 'acfe'),
|
88 |
-
'instructions' => __('Set button wrapper', 'acfe'),
|
89 |
-
'type' => 'group',
|
90 |
-
'name' => 'button_wrapper',
|
91 |
-
'sub_fields' => array(
|
92 |
-
|
93 |
-
array(
|
94 |
-
'label' => '',
|
95 |
-
'instructions' => '',
|
96 |
-
'type' => 'text',
|
97 |
-
'name' => 'button_before',
|
98 |
-
'_name' => 'button_before',
|
99 |
-
'key' => 'button_before',
|
100 |
-
'required' => false,
|
101 |
-
'prepend' => __('Before'),
|
102 |
-
'wrapper' => array(
|
103 |
-
'width' => 50
|
104 |
-
)
|
105 |
-
),
|
106 |
-
|
107 |
-
array(
|
108 |
-
'label' => '',
|
109 |
-
'instructions' => '',
|
110 |
-
'type' => 'text',
|
111 |
-
'name' => 'button_after',
|
112 |
-
'_name' => 'button_after',
|
113 |
-
'key' => 'button_after',
|
114 |
-
'required' => false,
|
115 |
-
'prepend' => __('After'),
|
116 |
-
'wrapper' => array(
|
117 |
-
'width' => 50
|
118 |
-
)
|
119 |
),
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
|
141 |
-
if(!empty($field['button_wrapper']['button_after'])){
|
142 |
-
echo $field['button_wrapper']['button_after'];
|
143 |
-
}
|
144 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
}
|
146 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
}
|
148 |
|
149 |
-
|
150 |
|
151 |
-
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
6 |
+
class acfe_field_button extends acf_field{
|
7 |
+
|
8 |
+
function __construct(){
|
|
|
|
|
9 |
|
10 |
+
$this->name = 'button';
|
11 |
+
$this->label = __('Button', 'acfe');
|
12 |
+
$this->category = 'basic';
|
13 |
|
14 |
+
parent::__construct();
|
15 |
|
16 |
+
}
|
17 |
+
|
18 |
+
function render_field_settings($field){
|
19 |
+
|
20 |
+
acf_render_field_setting($field, array(
|
21 |
+
'label' => __('Button value', 'acfe'),
|
22 |
+
'instructions' => __('Set a default value for the field', 'acfe'),
|
23 |
+
'type' => 'text',
|
24 |
+
'name' => 'button_value',
|
25 |
+
'default_value' => __('Submit', 'acfe')
|
26 |
+
));
|
27 |
+
|
28 |
+
acf_render_field_setting($field, array(
|
29 |
+
'label' => __('Button attributes', 'acfe'),
|
30 |
+
'instructions' => __('Set button attributes', 'acfe'),
|
31 |
+
'type' => 'group',
|
32 |
+
'name' => 'button_attributes',
|
33 |
+
'sub_fields' => array(
|
34 |
+
array(
|
35 |
+
'label' => '',
|
36 |
+
'instructions' => '',
|
37 |
+
'type' => 'select',
|
38 |
+
'name' => 'button_type',
|
39 |
+
'_name' => 'button_type',
|
40 |
+
'key' => 'button_type',
|
41 |
+
'required' => false,
|
42 |
+
'default_value' => 'button',
|
43 |
+
'choices' => array(
|
44 |
+
'button' => __('Button', 'acfe'),
|
45 |
+
'submit' => __('Submit', 'acfe'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
),
|
47 |
+
'wrapper' => array(
|
48 |
+
'width' => 33
|
49 |
+
)
|
50 |
+
),
|
51 |
+
|
52 |
+
array(
|
53 |
+
'label' => '',
|
54 |
+
'instructions' => '',
|
55 |
+
'type' => 'text',
|
56 |
+
'name' => 'button_class',
|
57 |
+
'_name' => 'button_class',
|
58 |
+
'key' => 'button_class',
|
59 |
+
'required' => false,
|
60 |
+
'prepend' => 'class',
|
61 |
+
'wrapper' => array(
|
62 |
+
'width' => 33
|
63 |
+
)
|
64 |
+
),
|
65 |
+
|
66 |
+
array(
|
67 |
+
'label' => '',
|
68 |
+
'instructions' => '',
|
69 |
+
'type' => 'text',
|
70 |
+
'name' => 'button_id',
|
71 |
+
'_name' => 'button_id',
|
72 |
+
'key' => 'button_id',
|
73 |
+
'required' => false,
|
74 |
+
'prepend' => 'id',
|
75 |
+
'wrapper' => array(
|
76 |
+
'width' => 33
|
77 |
+
)
|
78 |
+
),
|
79 |
+
|
80 |
+
|
81 |
+
)
|
82 |
+
));
|
83 |
|
84 |
+
acf_render_field_setting($field, array(
|
85 |
+
'label' => __('Button wrapper', 'acfe'),
|
86 |
+
'instructions' => __('Set button wrapper', 'acfe'),
|
87 |
+
'type' => 'group',
|
88 |
+
'name' => 'button_wrapper',
|
89 |
+
'sub_fields' => array(
|
90 |
+
|
91 |
+
array(
|
92 |
+
'label' => '',
|
93 |
+
'instructions' => '',
|
94 |
+
'type' => 'text',
|
95 |
+
'name' => 'button_before',
|
96 |
+
'_name' => 'button_before',
|
97 |
+
'key' => 'button_before',
|
98 |
+
'required' => false,
|
99 |
+
'prepend' => __('Before'),
|
100 |
+
'wrapper' => array(
|
101 |
+
'width' => 50
|
102 |
+
)
|
103 |
+
),
|
104 |
+
|
105 |
+
array(
|
106 |
+
'label' => '',
|
107 |
+
'instructions' => '',
|
108 |
+
'type' => 'text',
|
109 |
+
'name' => 'button_after',
|
110 |
+
'_name' => 'button_after',
|
111 |
+
'key' => 'button_after',
|
112 |
+
'required' => false,
|
113 |
+
'prepend' => __('After'),
|
114 |
+
'wrapper' => array(
|
115 |
+
'width' => 50
|
116 |
+
)
|
117 |
+
),
|
118 |
|
|
|
|
|
|
|
119 |
|
120 |
+
)
|
121 |
+
));
|
122 |
+
|
123 |
+
}
|
124 |
+
|
125 |
+
function render_field($field){
|
126 |
+
|
127 |
+
if(!empty($field['button_wrapper']['button_before'])){
|
128 |
+
echo $field['button_wrapper']['button_before'];
|
129 |
}
|
130 |
|
131 |
+
echo '<input
|
132 |
+
type="' . esc_attr($field['button_attributes']['button_type']) . '"
|
133 |
+
name="' . esc_attr($field['name']) . '"
|
134 |
+
id="' . esc_attr($field['button_attributes']['button_id']) . '"
|
135 |
+
class="' . esc_attr($field['button_attributes']['button_class']) . '"
|
136 |
+
value="' . esc_attr($field['button_value']) . '"
|
137 |
+
/>';
|
138 |
+
|
139 |
+
if(!empty($field['button_wrapper']['button_after'])){
|
140 |
+
echo $field['button_wrapper']['button_after'];
|
141 |
+
}
|
142 |
+
|
143 |
}
|
144 |
|
145 |
+
}
|
146 |
|
147 |
+
new acfe_field_button();
|
includes/fields/field-dynamic-message.php
CHANGED
@@ -3,20 +3,16 @@
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
$this->label = __('Dynamic Message', 'acfe');
|
13 |
-
$this->category = 'layout';
|
14 |
-
|
15 |
-
parent::__construct();
|
16 |
-
}
|
17 |
|
18 |
-
|
|
|
19 |
|
20 |
-
|
21 |
|
22 |
-
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
6 |
+
class acfe_field_dynamic_message extends acf_field{
|
7 |
+
|
8 |
+
function __construct(){
|
9 |
+
$this->name = 'acfe_dynamic_message';
|
10 |
+
$this->label = __('Dynamic Message', 'acfe');
|
11 |
+
$this->category = 'layout';
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
+
parent::__construct();
|
14 |
+
}
|
15 |
|
16 |
+
}
|
17 |
|
18 |
+
new acfe_field_dynamic_message();
|
includes/fields/field-post-types.php
ADDED
@@ -0,0 +1,166 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if(!defined('ABSPATH'))
|
4 |
+
exit;
|
5 |
+
|
6 |
+
class acfe_field_post_types extends acf_field{
|
7 |
+
|
8 |
+
function __construct(){
|
9 |
+
$this->name = 'acfe_post_types';
|
10 |
+
$this->label = __('Post types', 'acfe');
|
11 |
+
$this->category = 'relational';
|
12 |
+
$this->defaults = array(
|
13 |
+
'field_type' => 'checkbox',
|
14 |
+
'return_format' => 'name',
|
15 |
+
);
|
16 |
+
|
17 |
+
parent::__construct();
|
18 |
+
}
|
19 |
+
|
20 |
+
function render_field($field){
|
21 |
+
|
22 |
+
// force value to array
|
23 |
+
$field['value'] = acf_get_array($field['value']);
|
24 |
+
|
25 |
+
if( $field['field_type'] == 'select' ) {
|
26 |
+
|
27 |
+
$this->render_field_select( $field );
|
28 |
+
|
29 |
+
} elseif( $field['field_type'] == 'radio' ) {
|
30 |
+
|
31 |
+
$this->render_field_checkbox( $field );
|
32 |
+
|
33 |
+
} elseif( $field['field_type'] == 'checkbox' ) {
|
34 |
+
|
35 |
+
$this->render_field_checkbox( $field );
|
36 |
+
|
37 |
+
}
|
38 |
+
|
39 |
+
}
|
40 |
+
|
41 |
+
function render_field_select($field){
|
42 |
+
|
43 |
+
// Change Field into a select
|
44 |
+
$field['type'] = 'select';
|
45 |
+
$field['ui'] = 0;
|
46 |
+
$field['ajax'] = 0;
|
47 |
+
$field['choices'] = get_post_types(array(
|
48 |
+
'public' => true,
|
49 |
+
'show_ui' => true
|
50 |
+
), 'names');
|
51 |
+
|
52 |
+
acf_render_field($field);
|
53 |
+
|
54 |
+
}
|
55 |
+
|
56 |
+
function render_field_checkbox($field){
|
57 |
+
|
58 |
+
acf_hidden_input(array(
|
59 |
+
'type' => 'hidden',
|
60 |
+
'name' => $field['name'],
|
61 |
+
));
|
62 |
+
|
63 |
+
if($field['field_type'] == 'checkbox')
|
64 |
+
$field['name'] .= '[]';
|
65 |
+
|
66 |
+
$taxonomies = get_post_types(array(
|
67 |
+
'public' => true,
|
68 |
+
'show_ui' => true
|
69 |
+
), 'objects');
|
70 |
+
|
71 |
+
?>
|
72 |
+
<div class="categorychecklist-holder">
|
73 |
+
<ul class="acf-checkbox-list acf-bl">
|
74 |
+
|
75 |
+
<?php if(!empty($taxonomies)){ ?>
|
76 |
+
<?php foreach($taxonomies as $taxonomy){ ?>
|
77 |
+
<?php $selected = in_array($taxonomy->name, $field['value']); ?>
|
78 |
+
<li>
|
79 |
+
<label <?php echo $selected ? 'class="selected"' : ''; ?>>
|
80 |
+
<input type="<?php echo $field['field_type']; ?>" name="<?php echo $field['name']; ?>" value="<?php echo $taxonomy->name; ?>" <?php echo $selected ? 'checked="checked"' : ''; ?> />
|
81 |
+
<span><?php echo $taxonomy->label; ?></span>
|
82 |
+
</label>
|
83 |
+
</li>
|
84 |
+
|
85 |
+
<?php } ?>
|
86 |
+
<?php } ?>
|
87 |
+
|
88 |
+
</ul>
|
89 |
+
</div>
|
90 |
+
<?php
|
91 |
+
|
92 |
+
}
|
93 |
+
|
94 |
+
function render_field_settings($field){
|
95 |
+
|
96 |
+
// field_type
|
97 |
+
acf_render_field_setting( $field, array(
|
98 |
+
'label' => __('Appearance','acf'),
|
99 |
+
'instructions' => __('Select the appearance of this field', 'acf'),
|
100 |
+
'type' => 'select',
|
101 |
+
'name' => 'field_type',
|
102 |
+
'optgroup' => true,
|
103 |
+
'choices' => array(
|
104 |
+
'checkbox' => __('Checkbox', 'acf'),
|
105 |
+
'radio' => __('Radio Buttons', 'acf'),
|
106 |
+
'select' => _x('Select', 'noun', 'acf')
|
107 |
+
)
|
108 |
+
));
|
109 |
+
|
110 |
+
// return_format
|
111 |
+
acf_render_field_setting( $field, array(
|
112 |
+
'label' => __('Return Value', 'acf'),
|
113 |
+
'instructions' => '',
|
114 |
+
'type' => 'radio',
|
115 |
+
'name' => 'return_format',
|
116 |
+
'choices' => array(
|
117 |
+
'object' => __("Post Type Object", 'acfe'),
|
118 |
+
'name' => __("Post Type Name", 'acfe')
|
119 |
+
),
|
120 |
+
'layout' => 'horizontal',
|
121 |
+
));
|
122 |
+
|
123 |
+
}
|
124 |
+
|
125 |
+
function format_value($value, $post_id, $field){
|
126 |
+
|
127 |
+
if(empty($value))
|
128 |
+
return false;
|
129 |
+
|
130 |
+
// force value to array
|
131 |
+
$value = acf_get_array($value);
|
132 |
+
|
133 |
+
// format = name
|
134 |
+
if($field['return_format'] == 'name'){
|
135 |
+
|
136 |
+
if($field['field_type'] == 'select' || $field['field_type'] == 'radio')
|
137 |
+
return array_shift($value);
|
138 |
+
|
139 |
+
return $value;
|
140 |
+
|
141 |
+
}
|
142 |
+
|
143 |
+
// format = object
|
144 |
+
elseif($field['return_format'] == 'object'){
|
145 |
+
|
146 |
+
$post_types = array();
|
147 |
+
|
148 |
+
foreach($value as $post_type){
|
149 |
+
$post_types[] = get_post_type_object($post_type);
|
150 |
+
}
|
151 |
+
|
152 |
+
if($field['field_type'] == 'select' || $field['field_type'] == 'radio')
|
153 |
+
return array_shift($post_types);
|
154 |
+
|
155 |
+
return $post_types;
|
156 |
+
|
157 |
+
}
|
158 |
+
|
159 |
+
// return
|
160 |
+
return $value;
|
161 |
+
|
162 |
+
}
|
163 |
+
|
164 |
+
}
|
165 |
+
|
166 |
+
new acfe_field_post_types();
|
includes/fields/field-slug.php
ADDED
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if(!defined('ABSPATH'))
|
4 |
+
exit;
|
5 |
+
|
6 |
+
class acfe_field_slug extends acf_field{
|
7 |
+
|
8 |
+
function __construct(){
|
9 |
+
$this->name = 'acfe_slug';
|
10 |
+
$this->label = __('Slug', 'acfe');
|
11 |
+
$this->category = 'basic';
|
12 |
+
$this->defaults = array(
|
13 |
+
'default_value' => '',
|
14 |
+
'maxlength' => '',
|
15 |
+
'placeholder' => '',
|
16 |
+
'prepend' => '',
|
17 |
+
'append' => ''
|
18 |
+
);
|
19 |
+
|
20 |
+
parent::__construct();
|
21 |
+
}
|
22 |
+
|
23 |
+
function render_field( $field ) {
|
24 |
+
|
25 |
+
// vars
|
26 |
+
$atts = array();
|
27 |
+
$keys = array('type', 'id', 'class', 'name', 'value', 'placeholder', 'maxlength', 'pattern');
|
28 |
+
$keys2 = array('readonly', 'disabled', 'required');
|
29 |
+
$html = '';
|
30 |
+
|
31 |
+
// prepend
|
32 |
+
if($field['prepend'] !== ''){
|
33 |
+
$field['class'] .= ' acf-is-prepended';
|
34 |
+
$html .= '<div class="acf-input-prepend">' . acf_esc_html($field['prepend']) . '</div>';
|
35 |
+
}
|
36 |
+
|
37 |
+
// append
|
38 |
+
if($field['append'] !== ''){
|
39 |
+
$field['class'] .= ' acf-is-appended';
|
40 |
+
$html .= '<div class="acf-input-append">' . acf_esc_html($field['append']) . '</div>';
|
41 |
+
}
|
42 |
+
|
43 |
+
// atts (value="123")
|
44 |
+
foreach($keys as $k){
|
45 |
+
if(isset($field[ $k ]))
|
46 |
+
$atts[ $k ] = $field[ $k ];
|
47 |
+
}
|
48 |
+
|
49 |
+
// atts2 (disabled="disabled")
|
50 |
+
foreach($keys2 as $k ){
|
51 |
+
if(!empty($field[ $k ]))
|
52 |
+
$atts[ $k ] = $k;
|
53 |
+
}
|
54 |
+
|
55 |
+
// remove empty atts
|
56 |
+
$atts = acf_clean_atts($atts);
|
57 |
+
|
58 |
+
// override type
|
59 |
+
$atts['type'] = 'text';
|
60 |
+
|
61 |
+
// render
|
62 |
+
$html .= '<div class="acf-input-wrap">' . acf_get_text_input($atts) . '</div>';
|
63 |
+
|
64 |
+
|
65 |
+
// return
|
66 |
+
echo $html;
|
67 |
+
|
68 |
+
}
|
69 |
+
|
70 |
+
function render_field_settings($field){
|
71 |
+
|
72 |
+
// default_value
|
73 |
+
acf_render_field_setting( $field, array(
|
74 |
+
'label' => __('Default Value','acf'),
|
75 |
+
'instructions' => __('Appears when creating a new post','acf'),
|
76 |
+
'type' => 'text',
|
77 |
+
'name' => 'default_value',
|
78 |
+
));
|
79 |
+
|
80 |
+
|
81 |
+
// placeholder
|
82 |
+
acf_render_field_setting( $field, array(
|
83 |
+
'label' => __('Placeholder Text','acf'),
|
84 |
+
'instructions' => __('Appears within the input','acf'),
|
85 |
+
'type' => 'text',
|
86 |
+
'name' => 'placeholder',
|
87 |
+
));
|
88 |
+
|
89 |
+
|
90 |
+
// prepend
|
91 |
+
acf_render_field_setting( $field, array(
|
92 |
+
'label' => __('Prepend','acf'),
|
93 |
+
'instructions' => __('Appears before the input','acf'),
|
94 |
+
'type' => 'text',
|
95 |
+
'name' => 'prepend',
|
96 |
+
));
|
97 |
+
|
98 |
+
|
99 |
+
// append
|
100 |
+
acf_render_field_setting( $field, array(
|
101 |
+
'label' => __('Append','acf'),
|
102 |
+
'instructions' => __('Appears after the input','acf'),
|
103 |
+
'type' => 'text',
|
104 |
+
'name' => 'append',
|
105 |
+
));
|
106 |
+
|
107 |
+
|
108 |
+
// maxlength
|
109 |
+
acf_render_field_setting( $field, array(
|
110 |
+
'label' => __('Character Limit','acf'),
|
111 |
+
'instructions' => __('Leave blank for no limit','acf'),
|
112 |
+
'type' => 'number',
|
113 |
+
'name' => 'maxlength',
|
114 |
+
));
|
115 |
+
|
116 |
+
}
|
117 |
+
|
118 |
+
function validate_value($valid, $value, $field, $input){
|
119 |
+
|
120 |
+
$value = sanitize_title($value);
|
121 |
+
|
122 |
+
if($field['maxlength'] && mb_strlen(wp_unslash($value)) > $field['maxlength'])
|
123 |
+
return sprintf(__('Value must not exceed %d characters', 'acf'), $field['maxlength']);
|
124 |
+
|
125 |
+
return $valid;
|
126 |
+
|
127 |
+
}
|
128 |
+
|
129 |
+
function update_value($value, $post_id, $field){
|
130 |
+
|
131 |
+
return sanitize_title($value);
|
132 |
+
|
133 |
+
}
|
134 |
+
|
135 |
+
}
|
136 |
+
|
137 |
+
new acfe_field_slug();
|
includes/fields/field-taxonomies.php
ADDED
@@ -0,0 +1,166 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if(!defined('ABSPATH'))
|
4 |
+
exit;
|
5 |
+
|
6 |
+
class acfe_field_taxonomies extends acf_field{
|
7 |
+
|
8 |
+
function __construct(){
|
9 |
+
$this->name = 'acfe_taxonomies';
|
10 |
+
$this->label = __('Taxonomies', 'acfe');
|
11 |
+
$this->category = 'relational';
|
12 |
+
$this->defaults = array(
|
13 |
+
'field_type' => 'checkbox',
|
14 |
+
'return_format' => 'name',
|
15 |
+
);
|
16 |
+
|
17 |
+
parent::__construct();
|
18 |
+
}
|
19 |
+
|
20 |
+
function render_field($field){
|
21 |
+
|
22 |
+
// force value to array
|
23 |
+
$field['value'] = acf_get_array($field['value']);
|
24 |
+
|
25 |
+
if( $field['field_type'] == 'select' ) {
|
26 |
+
|
27 |
+
$this->render_field_select( $field );
|
28 |
+
|
29 |
+
} elseif( $field['field_type'] == 'radio' ) {
|
30 |
+
|
31 |
+
$this->render_field_checkbox( $field );
|
32 |
+
|
33 |
+
} elseif( $field['field_type'] == 'checkbox' ) {
|
34 |
+
|
35 |
+
$this->render_field_checkbox( $field );
|
36 |
+
|
37 |
+
}
|
38 |
+
|
39 |
+
}
|
40 |
+
|
41 |
+
function render_field_select($field){
|
42 |
+
|
43 |
+
// Change Field into a select
|
44 |
+
$field['type'] = 'select';
|
45 |
+
$field['ui'] = 0;
|
46 |
+
$field['ajax'] = 0;
|
47 |
+
$field['choices'] = get_taxonomies(array(
|
48 |
+
'public' => true,
|
49 |
+
'show_ui' => true
|
50 |
+
), 'names');
|
51 |
+
|
52 |
+
acf_render_field($field);
|
53 |
+
|
54 |
+
}
|
55 |
+
|
56 |
+
function render_field_checkbox($field){
|
57 |
+
|
58 |
+
acf_hidden_input(array(
|
59 |
+
'type' => 'hidden',
|
60 |
+
'name' => $field['name'],
|
61 |
+
));
|
62 |
+
|
63 |
+
if($field['field_type'] == 'checkbox')
|
64 |
+
$field['name'] .= '[]';
|
65 |
+
|
66 |
+
$taxonomies = get_taxonomies(array(
|
67 |
+
'public' => true,
|
68 |
+
'show_ui' => true
|
69 |
+
), 'objects');
|
70 |
+
|
71 |
+
?>
|
72 |
+
<div class="categorychecklist-holder">
|
73 |
+
<ul class="acf-checkbox-list acf-bl">
|
74 |
+
|
75 |
+
<?php if(!empty($taxonomies)){ ?>
|
76 |
+
<?php foreach($taxonomies as $taxonomy){ ?>
|
77 |
+
<?php $selected = in_array($taxonomy->name, $field['value']); ?>
|
78 |
+
<li>
|
79 |
+
<label <?php echo $selected ? 'class="selected"' : ''; ?>>
|
80 |
+
<input type="<?php echo $field['field_type']; ?>" name="<?php echo $field['name']; ?>" value="<?php echo $taxonomy->name; ?>" <?php echo $selected ? 'checked="checked"' : ''; ?> />
|
81 |
+
<span><?php echo $taxonomy->label; ?></span>
|
82 |
+
</label>
|
83 |
+
</li>
|
84 |
+
|
85 |
+
<?php } ?>
|
86 |
+
<?php } ?>
|
87 |
+
|
88 |
+
</ul>
|
89 |
+
</div>
|
90 |
+
<?php
|
91 |
+
|
92 |
+
}
|
93 |
+
|
94 |
+
function render_field_settings($field){
|
95 |
+
|
96 |
+
// field_type
|
97 |
+
acf_render_field_setting( $field, array(
|
98 |
+
'label' => __('Appearance','acf'),
|
99 |
+
'instructions' => __('Select the appearance of this field', 'acf'),
|
100 |
+
'type' => 'select',
|
101 |
+
'name' => 'field_type',
|
102 |
+
'optgroup' => true,
|
103 |
+
'choices' => array(
|
104 |
+
'checkbox' => __('Checkbox', 'acf'),
|
105 |
+
'radio' => __('Radio Buttons', 'acf'),
|
106 |
+
'select' => _x('Select', 'noun', 'acf')
|
107 |
+
)
|
108 |
+
));
|
109 |
+
|
110 |
+
// return_format
|
111 |
+
acf_render_field_setting( $field, array(
|
112 |
+
'label' => __('Return Value', 'acf'),
|
113 |
+
'instructions' => '',
|
114 |
+
'type' => 'radio',
|
115 |
+
'name' => 'return_format',
|
116 |
+
'choices' => array(
|
117 |
+
'object' => __("Taxonomy Object", 'acfe'),
|
118 |
+
'name' => __("Taxonomy Name", 'acfe')
|
119 |
+
),
|
120 |
+
'layout' => 'horizontal',
|
121 |
+
));
|
122 |
+
|
123 |
+
}
|
124 |
+
|
125 |
+
function format_value($value, $post_id, $field){
|
126 |
+
|
127 |
+
if(empty($value))
|
128 |
+
return false;
|
129 |
+
|
130 |
+
// force value to array
|
131 |
+
$value = acf_get_array($value);
|
132 |
+
|
133 |
+
// format = name
|
134 |
+
if($field['return_format'] == 'name'){
|
135 |
+
|
136 |
+
if($field['field_type'] == 'select' || $field['field_type'] == 'radio')
|
137 |
+
return array_shift($value);
|
138 |
+
|
139 |
+
return $value;
|
140 |
+
|
141 |
+
}
|
142 |
+
|
143 |
+
// format = object
|
144 |
+
elseif($field['return_format'] == 'object'){
|
145 |
+
|
146 |
+
$taxonomies = array();
|
147 |
+
|
148 |
+
foreach($value as $taxonomy){
|
149 |
+
$taxonomies[] = get_taxonomy($taxonomy);
|
150 |
+
}
|
151 |
+
|
152 |
+
if($field['field_type'] == 'select' || $field['field_type'] == 'radio')
|
153 |
+
return array_shift($taxonomies);
|
154 |
+
|
155 |
+
return $taxonomies;
|
156 |
+
|
157 |
+
}
|
158 |
+
|
159 |
+
// return
|
160 |
+
return $value;
|
161 |
+
|
162 |
+
}
|
163 |
+
|
164 |
+
}
|
165 |
+
|
166 |
+
new acfe_field_taxonomies();
|
includes/locations/post-type-all.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if(!defined('ABSPATH'))
|
4 |
+
exit;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Hooks: Locations - Post Type - All (Values)
|
8 |
+
*/
|
9 |
+
add_filter('acf/location/rule_values/post_type', 'acfe_field_group_locations_values_post_type_all');
|
10 |
+
function acfe_field_group_locations_values_post_type_all($choices){
|
11 |
+
|
12 |
+
$choices = array_merge(array('all' => __('All')), $choices);
|
13 |
+
return $choices;
|
14 |
+
|
15 |
+
}
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Hooks: Locations - Post Type - All (Match)
|
19 |
+
*/
|
20 |
+
add_filter('acf/location/rule_match', 'acfe_field_group_locations_match_post_type_all', 10, 3);
|
21 |
+
function acfe_field_group_locations_match_post_type_all($match, $rule, $options){
|
22 |
+
|
23 |
+
if($rule['param'] != 'post_type' || $rule['value'] != 'all')
|
24 |
+
return $match;
|
25 |
+
|
26 |
+
if($rule['operator'] == "=="){
|
27 |
+
$match = isset($options['post_type']) && !empty($options['post_type']);
|
28 |
+
}
|
29 |
+
|
30 |
+
elseif($rule['operator'] == "!="){
|
31 |
+
$match = !isset($options['post_type']) || empty($options['post_type']);
|
32 |
+
}
|
33 |
+
|
34 |
+
return $match;
|
35 |
+
|
36 |
+
}
|
includes/modules/dynamic-post-type.php
ADDED
@@ -0,0 +1,2359 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if(!defined('ABSPATH'))
|
4 |
+
exit;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Register Dynamic Post Type
|
8 |
+
*/
|
9 |
+
add_action('init', 'acfe_dpt_register');
|
10 |
+
function acfe_dpt_register(){
|
11 |
+
|
12 |
+
register_post_type('acfe-dpt', array(
|
13 |
+
'label' => 'Post Types',
|
14 |
+
'description' => 'Post Types',
|
15 |
+
'labels' => array(
|
16 |
+
'name' => 'Post Types',
|
17 |
+
'singular_name' => 'Post Type',
|
18 |
+
'menu_name' => 'Post Types',
|
19 |
+
),
|
20 |
+
'supports' => array('custom-fields'),
|
21 |
+
'hierarchical' => false,
|
22 |
+
'public' => false,
|
23 |
+
//'show_ui' => true,
|
24 |
+
'show_ui' => 'ACFE', // Hack to show_ui, but do not list in get_post_types() ie: ACF field group location
|
25 |
+
'show_in_menu' => 'tools.php',
|
26 |
+
'menu_icon' => 'dashicons-layout',
|
27 |
+
'show_in_admin_bar' => false,
|
28 |
+
'show_in_nav_menus' => false,
|
29 |
+
'can_export' => false,
|
30 |
+
'has_archive' => false,
|
31 |
+
'rewrite' => false,
|
32 |
+
'exclude_from_search' => true,
|
33 |
+
'publicly_queryable' => false,
|
34 |
+
'capability_type' => 'page',
|
35 |
+
));
|
36 |
+
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* WP Register Post Types
|
41 |
+
*/
|
42 |
+
add_action('init', 'acfe_dpt_registers');
|
43 |
+
function acfe_dpt_registers(){
|
44 |
+
|
45 |
+
$dynamic_post_types = get_option('acfe_dynamic_post_types', array());
|
46 |
+
if(empty($dynamic_post_types))
|
47 |
+
return;
|
48 |
+
|
49 |
+
foreach($dynamic_post_types as $name => $register_args){
|
50 |
+
|
51 |
+
// Register: Execute
|
52 |
+
register_post_type($name, $register_args);
|
53 |
+
|
54 |
+
}
|
55 |
+
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Dynamic Post Type Save
|
60 |
+
*/
|
61 |
+
add_action('acf/save_post', 'acfe_dpt_filter_save', 20);
|
62 |
+
function acfe_dpt_filter_save($post_id){
|
63 |
+
|
64 |
+
if(get_post_type($post_id) != 'acfe-dpt')
|
65 |
+
return;
|
66 |
+
|
67 |
+
$title = get_field('label', $post_id);
|
68 |
+
$name = get_field('acfe_dpt_name', $post_id);
|
69 |
+
|
70 |
+
// Update post
|
71 |
+
wp_update_post(array(
|
72 |
+
'ID' => $post_id,
|
73 |
+
'post_title' => $title,
|
74 |
+
'post_name' => $name,
|
75 |
+
));
|
76 |
+
|
77 |
+
// Register Args
|
78 |
+
$label = get_field('label', $post_id);
|
79 |
+
$description = get_field('description', $post_id);
|
80 |
+
$hierarchical = get_field('hierarchical', $post_id);
|
81 |
+
$supports = get_field('supports', $post_id);
|
82 |
+
$taxonomies = acf_get_array(get_field('taxonomies', $post_id));
|
83 |
+
$public = get_field('public', $post_id);
|
84 |
+
$exclude_from_search = get_field('exclude_from_search', $post_id);
|
85 |
+
$publicly_queryable = get_field('publicly_queryable', $post_id);
|
86 |
+
$can_export = get_field('can_export', $post_id);
|
87 |
+
$delete_with_user = get_field('delete_with_user', $post_id);
|
88 |
+
|
89 |
+
// Labels
|
90 |
+
$labels = get_field('labels', $post_id);
|
91 |
+
$labels_args = array();
|
92 |
+
foreach($labels as $k => $l){
|
93 |
+
if(empty($l))
|
94 |
+
continue;
|
95 |
+
|
96 |
+
$labels_args[$k] = $l;
|
97 |
+
}
|
98 |
+
|
99 |
+
// Menu
|
100 |
+
$menu_position = get_field('menu_position', $post_id);
|
101 |
+
$menu_icon = get_field('menu_icon', $post_id);
|
102 |
+
$show_ui = get_field('show_ui', $post_id);
|
103 |
+
$show_in_menu = get_field('show_in_menu', $post_id);
|
104 |
+
$show_in_menu_text = get_field('show_in_menu_text', $post_id);
|
105 |
+
$show_in_nav_menus = get_field('show_in_nav_menus', $post_id);
|
106 |
+
$show_in_admin_bar = get_field('show_in_admin_bar', $post_id);
|
107 |
+
|
108 |
+
// Capability
|
109 |
+
$capability_type = acf_decode_choices(get_field('capability_type', $post_id), true);
|
110 |
+
$capabilities = acf_decode_choices(get_field('capabilities', $post_id), true);
|
111 |
+
$map_meta_cap = get_field('map_meta_cap', $post_id);
|
112 |
+
|
113 |
+
// Archive
|
114 |
+
$archive_template = get_field('acfe_dpt_archive_template', $post_id);
|
115 |
+
$archive_posts_per_page = get_field('acfe_dpt_archive_posts_per_page', $post_id);
|
116 |
+
$archive_orderby = get_field('acfe_dpt_archive_orderby', $post_id);
|
117 |
+
$archive_order = get_field('acfe_dpt_archive_order', $post_id);
|
118 |
+
$has_archive = get_field('has_archive', $post_id);
|
119 |
+
$has_archive_slug = get_field('has_archive_slug', $post_id);
|
120 |
+
|
121 |
+
// Single
|
122 |
+
$single_template = get_field('acfe_dpt_single_template', $post_id);
|
123 |
+
$rewrite = get_field('rewrite', $post_id);
|
124 |
+
$rewrite_args_select = get_field('rewrite_args_select', $post_id);
|
125 |
+
$rewrite_args = get_field('rewrite_args', $post_id);
|
126 |
+
|
127 |
+
// Admin
|
128 |
+
$admin_posts_per_page = get_field('acfe_dpt_admin_posts_per_page', $post_id);
|
129 |
+
$admin_orderby = get_field('acfe_dpt_admin_orderby', $post_id);
|
130 |
+
$admin_order = get_field('acfe_dpt_admin_order', $post_id);
|
131 |
+
|
132 |
+
// REST
|
133 |
+
$show_in_rest = get_field('show_in_rest', $post_id);
|
134 |
+
$rest_base = get_field('rest_base', $post_id);
|
135 |
+
$rest_controller_class = get_field('rest_controller_class', $post_id);
|
136 |
+
|
137 |
+
// Register: Args
|
138 |
+
$register_args = array(
|
139 |
+
'label' => $label,
|
140 |
+
'description' => $description,
|
141 |
+
'hierarchical' => $hierarchical,
|
142 |
+
'supports' => $supports,
|
143 |
+
'taxonomies' => $taxonomies,
|
144 |
+
'public' => $public,
|
145 |
+
'exclude_from_search' => $exclude_from_search,
|
146 |
+
'publicly_queryable' => $publicly_queryable,
|
147 |
+
'can_export' => $can_export,
|
148 |
+
'delete_with_user' => $delete_with_user,
|
149 |
+
|
150 |
+
// Labels
|
151 |
+
'labels' => $labels_args,
|
152 |
+
|
153 |
+
// Menu
|
154 |
+
'menu_position' => $menu_position,
|
155 |
+
'menu_icon' => $menu_icon,
|
156 |
+
'show_ui' => $show_ui,
|
157 |
+
'show_in_menu' => $show_in_menu,
|
158 |
+
'show_in_nav_menus' => $show_in_nav_menus,
|
159 |
+
'show_in_admin_bar' => $show_in_admin_bar,
|
160 |
+
|
161 |
+
// Single
|
162 |
+
'rewrite' => $rewrite,
|
163 |
+
|
164 |
+
// Archive
|
165 |
+
'has_archive' => $has_archive,
|
166 |
+
|
167 |
+
// REST
|
168 |
+
'show_in_rest' => $show_in_rest,
|
169 |
+
'rest_base' => $rest_base,
|
170 |
+
'rest_controller_class' => $rest_controller_class,
|
171 |
+
|
172 |
+
// ACFE: Archive
|
173 |
+
'acfe_archive_template' => $archive_template,
|
174 |
+
'acfe_archive_ppp' => $archive_posts_per_page,
|
175 |
+
'acfe_archive_orderby' => $archive_orderby,
|
176 |
+
'acfe_archive_order' => $archive_order,
|
177 |
+
|
178 |
+
// ACFE: Single
|
179 |
+
'acfe_single_template' => $single_template,
|
180 |
+
|
181 |
+
// ACFE: Admin
|
182 |
+
'acfe_admin_ppp' => $admin_posts_per_page,
|
183 |
+
'acfe_admin_orderby' => $admin_orderby,
|
184 |
+
'acfe_admin_order' => $admin_order,
|
185 |
+
);
|
186 |
+
|
187 |
+
// Has archive: override
|
188 |
+
if($has_archive && $has_archive_slug)
|
189 |
+
$register_args['has_archive'] = $has_archive_slug;
|
190 |
+
|
191 |
+
// Rewrite: override
|
192 |
+
if($rewrite && $rewrite_args_select){
|
193 |
+
$register_args['rewrite'] = array(
|
194 |
+
'slug' => $rewrite_args['acfe_dpt_rewrite_slug'],
|
195 |
+
'with_front' => $rewrite_args['acfe_dpt_rewrite_with_front'],
|
196 |
+
'feeds' => $rewrite_args['feeds'],
|
197 |
+
'pages' => $rewrite_args['pages'],
|
198 |
+
);
|
199 |
+
}
|
200 |
+
|
201 |
+
// Show in menu (text)
|
202 |
+
if($show_in_menu && !empty($show_in_menu_text))
|
203 |
+
$register_args['show_in_menu'] = $show_in_menu_text;
|
204 |
+
|
205 |
+
// Capability type
|
206 |
+
$register_args['capability_type'] = $capability_type;
|
207 |
+
if(is_array($capability_type) && count($capability_type) == 1)
|
208 |
+
$register_args['capability_type'] = $capability_type[0];
|
209 |
+
|
210 |
+
// Capabilities
|
211 |
+
if(!empty($capabilities))
|
212 |
+
$register_args['capabilities'] = $capabilities;
|
213 |
+
|
214 |
+
// Map meta cap
|
215 |
+
$register_args['map_meta_cap'] = null;
|
216 |
+
|
217 |
+
if($map_meta_cap == 'false')
|
218 |
+
$register_args['map_meta_cap'] = false;
|
219 |
+
|
220 |
+
elseif($map_meta_cap == 'true')
|
221 |
+
$register_args['map_meta_cap'] = true;
|
222 |
+
|
223 |
+
// Get ACFE option
|
224 |
+
$option = get_option('acfe_dynamic_post_types', array());
|
225 |
+
|
226 |
+
// Create ACFE option
|
227 |
+
$option[$name] = $register_args;
|
228 |
+
|
229 |
+
// Update ACFE option
|
230 |
+
update_option('acfe_dynamic_post_types', $option);
|
231 |
+
|
232 |
+
// Flush permalinks
|
233 |
+
flush_rewrite_rules();
|
234 |
+
|
235 |
+
}
|
236 |
+
|
237 |
+
/**
|
238 |
+
* Filter Admin: List
|
239 |
+
*/
|
240 |
+
add_action('pre_get_posts', 'acfe_dpt_filter_admin_list');
|
241 |
+
function acfe_dpt_filter_admin_list($query){
|
242 |
+
|
243 |
+
if(!is_admin() || !$query->is_main_query() || !is_post_type_archive())
|
244 |
+
return;
|
245 |
+
|
246 |
+
$post_type = $query->get('post_type');
|
247 |
+
$post_type_obj = get_post_type_object($post_type);
|
248 |
+
|
249 |
+
$acfe_archive_ppp = (isset($post_type_obj->acfe_archive_ppp) && !empty($post_type_obj->acfe_archive_ppp));
|
250 |
+
$acfe_archive_orderby = (isset($post_type_obj->acfe_archive_orderby) && !empty($post_type_obj->acfe_archive_orderby));
|
251 |
+
$acfe_archive_order = (isset($post_type_obj->acfe_archive_order) && !empty($post_type_obj->acfe_archive_order));
|
252 |
+
|
253 |
+
if($acfe_archive_ppp){
|
254 |
+
$query->set('posts_per_page', $post_type_obj->acfe_archive_ppp);
|
255 |
+
$query->query['posts_per_page'] = $post_type_obj->acfe_archive_ppp;
|
256 |
+
}
|
257 |
+
|
258 |
+
if($acfe_archive_orderby){
|
259 |
+
$query->set('orderby', $post_type_obj->acfe_archive_orderby);
|
260 |
+
$query->query['orderby'] = $post_type_obj->acfe_archive_orderby;
|
261 |
+
}
|
262 |
+
|
263 |
+
if($acfe_archive_order){
|
264 |
+
$query->set('order', $post_type_obj->acfe_archive_order);
|
265 |
+
$query->query['order'] = $post_type_obj->acfe_archive_order;
|
266 |
+
}
|
267 |
+
|
268 |
+
}
|
269 |
+
|
270 |
+
/**
|
271 |
+
* Filter Admin: Posts Per Page
|
272 |
+
*/
|
273 |
+
add_filter('edit_posts_per_page', 'acfe_dpt_filter_admin_ppp', 10, 2);
|
274 |
+
function acfe_dpt_filter_admin_ppp($ppp, $post_type){
|
275 |
+
|
276 |
+
global $pagenow;
|
277 |
+
if($pagenow != 'edit.php')
|
278 |
+
return $ppp;
|
279 |
+
|
280 |
+
$post_type_obj = get_post_type_object($post_type);
|
281 |
+
if(!isset($post_type_obj->acfe_admin_ppp) || empty($post_type_obj->acfe_admin_ppp))
|
282 |
+
return $ppp;
|
283 |
+
|
284 |
+
return $post_type_obj->acfe_admin_ppp;
|
285 |
+
|
286 |
+
}
|
287 |
+
|
288 |
+
/**
|
289 |
+
* Filter Front: List + Posts Per Page
|
290 |
+
*/
|
291 |
+
add_action('pre_get_posts', 'acfe_dpt_filter_front_list');
|
292 |
+
function acfe_dpt_filter_front_list($query){
|
293 |
+
|
294 |
+
if(is_admin() || !$query->is_main_query() || !is_post_type_archive())
|
295 |
+
return;
|
296 |
+
|
297 |
+
$post_type = $query->get('post_type');
|
298 |
+
$post_type_obj = get_post_type_object($post_type);
|
299 |
+
|
300 |
+
$acfe_archive_ppp = (isset($post_type_obj->acfe_archive_ppp) && !empty($post_type_obj->acfe_archive_ppp));
|
301 |
+
$acfe_archive_orderby = (isset($post_type_obj->acfe_archive_orderby) && !empty($post_type_obj->acfe_archive_orderby));
|
302 |
+
$acfe_archive_order = (isset($post_type_obj->acfe_archive_order) && !empty($post_type_obj->acfe_archive_order));
|
303 |
+
|
304 |
+
if($acfe_archive_ppp){
|
305 |
+
$query->set('posts_per_page', $post_type_obj->acfe_archive_ppp);
|
306 |
+
$query->query['posts_per_page'] = $post_type_obj->acfe_archive_ppp;
|
307 |
+
}
|
308 |
+
|
309 |
+
if($acfe_archive_orderby){
|
310 |
+
$query->set('orderby', $post_type_obj->acfe_archive_orderby);
|
311 |
+
$query->query['orderby'] = $post_type_obj->acfe_archive_orderby;
|
312 |
+
}
|
313 |
+
|
314 |
+
if($acfe_archive_order){
|
315 |
+
$query->set('order', $post_type_obj->acfe_archive_order);
|
316 |
+
$query->query['order'] = $post_type_obj->acfe_archive_order;
|
317 |
+
}
|
318 |
+
|
319 |
+
}
|
320 |
+
|
321 |
+
/**
|
322 |
+
* Filter Front: Template
|
323 |
+
*/
|
324 |
+
add_filter('template_include', 'acfe_dpt_filter_template', 999);
|
325 |
+
function acfe_dpt_filter_template($template){
|
326 |
+
|
327 |
+
if(!is_single() && !is_post_type_archive() && !is_home())
|
328 |
+
return $template;
|
329 |
+
|
330 |
+
// Get_query_var
|
331 |
+
$query_var = get_query_var('post_type', false);
|
332 |
+
if(is_array($query_var) && !empty($query_var))
|
333 |
+
$query_var = $query_var[0];
|
334 |
+
|
335 |
+
foreach(get_post_types(array(), 'objects') as $post_type){
|
336 |
+
|
337 |
+
// Get_query_var check
|
338 |
+
$is_query_var = ($query_var && $query_var == $post_type->name);
|
339 |
+
|
340 |
+
// Get_post_type check
|
341 |
+
$get_post_type = (get_post_type() == $post_type->name);
|
342 |
+
|
343 |
+
// Acfe_archive_template
|
344 |
+
$acfe_archive_template = (isset($post_type->acfe_archive_template) && !empty($post_type->acfe_archive_template));
|
345 |
+
|
346 |
+
// Acfe_archive_template
|
347 |
+
$acfe_single_template = (isset($post_type->acfe_single_template) && !empty($post_type->acfe_single_template));
|
348 |
+
|
349 |
+
// Global check
|
350 |
+
if(!$get_post_type || !$is_query_var || (!$acfe_archive_template && !$acfe_single_template))
|
351 |
+
continue;
|
352 |
+
|
353 |
+
$rule = array();
|
354 |
+
$rule['is_archive'] = is_post_type_archive($post_type->name);
|
355 |
+
$rule['has_archive'] = $post_type->has_archive;
|
356 |
+
$rule['is_single'] = is_singular($post_type->name);
|
357 |
+
|
358 |
+
// Post Exception
|
359 |
+
if($post_type->name == 'post'){
|
360 |
+
$rule['is_archive'] = is_home();
|
361 |
+
$rule['has_archive'] = true;
|
362 |
+
}
|
363 |
+
|
364 |
+
// Archive
|
365 |
+
if($rule['has_archive'] && $rule['is_archive'] && $acfe_archive_template && ($locate = locate_template(array($post_type->acfe_archive_template))))
|
366 |
+
return $locate;
|
367 |
+
|
368 |
+
// Single
|
369 |
+
elseif($rule['is_single'] && $acfe_single_template && ($locate = locate_template(array($post_type->acfe_single_template))))
|
370 |
+
return $locate;
|
371 |
+
}
|
372 |
+
|
373 |
+
return $template;
|
374 |
+
|
375 |
+
}
|
376 |
+
|
377 |
+
/**
|
378 |
+
* Admin List Columns
|
379 |
+
*/
|
380 |
+
add_filter('manage_edit-acfe-dpt_columns', 'acfe_dpt_admin_columns');
|
381 |
+
function acfe_dpt_admin_columns($columns){
|
382 |
+
|
383 |
+
if(isset($columns['date']))
|
384 |
+
unset($columns['date']);
|
385 |
+
|
386 |
+
$columns['acfe-taxonomies'] = __('Taxonomies');
|
387 |
+
return $columns;
|
388 |
+
|
389 |
+
}
|
390 |
+
|
391 |
+
/**
|
392 |
+
* Admin List Columns HTML
|
393 |
+
*/
|
394 |
+
add_action('manage_acfe-dpt_posts_custom_column', 'acfe_dpt_admin_columns_html', 10, 2);
|
395 |
+
function acfe_dpt_admin_columns_html($column, $post_id){
|
396 |
+
|
397 |
+
if($column == 'acfe-taxonomies'){
|
398 |
+
|
399 |
+
$taxonomies = acf_get_array(get_field('taxonomies', $post_id));
|
400 |
+
if(empty($taxonomies)){
|
401 |
+
echo '—';
|
402 |
+
return;
|
403 |
+
}
|
404 |
+
|
405 |
+
$taxonomies_names = array();
|
406 |
+
foreach($taxonomies as $taxonomy_slug){
|
407 |
+
$taxonomy_obj = get_taxonomy($taxonomy_slug);
|
408 |
+
$taxonomies_names[] = $taxonomy_obj->label;
|
409 |
+
}
|
410 |
+
|
411 |
+
if(empty($taxonomies_names)){
|
412 |
+
echo '—';
|
413 |
+
return;
|
414 |
+
}
|
415 |
+
|
416 |
+
echo implode(', ', $taxonomies_names);
|
417 |
+
|
418 |
+
}
|
419 |
+
|
420 |
+
}
|
421 |
+
|
422 |
+
/**
|
423 |
+
* Admin Validate Name
|
424 |
+
*/
|
425 |
+
add_filter('acf/validate_value/name=acfe_dpt_name', 'acfe_dpt_admin_validate_name', 10, 4);
|
426 |
+
function acfe_dpt_admin_validate_name($valid, $value, $field, $input){
|
427 |
+
|
428 |
+
if(!$valid)
|
429 |
+
return $valid;
|
430 |
+
|
431 |
+
// Reserved WP post types: https://codex.wordpress.org/Function_Reference/register_post_type
|
432 |
+
$excludes = array('post', 'page', 'attachment', 'revision', 'nav_menu_item', 'custom_css', 'customize_changeset', 'oembed_cache', 'user_request', 'action', 'author', 'order', 'theme', 'acfe-dpt');
|
433 |
+
if(in_array($value, $excludes))
|
434 |
+
return __('This post type name is reserved');
|
435 |
+
|
436 |
+
// Editing Current Dynamic Post Type
|
437 |
+
$current_post_id = $_POST['_acf_post_id'];
|
438 |
+
$current_post_type = false;
|
439 |
+
if(!empty($current_post_id))
|
440 |
+
$current_post_type = get_field('acfe_dpt_name', $current_post_id);
|
441 |
+
|
442 |
+
if($value == $current_post_type)
|
443 |
+
return $valid;
|
444 |
+
|
445 |
+
// Listing WP Post Types
|
446 |
+
global $wp_post_types;
|
447 |
+
if(!empty($wp_post_types)){
|
448 |
+
foreach($wp_post_types as $post_type){
|
449 |
+
if($value != $post_type->name)
|
450 |
+
continue;
|
451 |
+
|
452 |
+
$valid = __('This post type name already exists');
|
453 |
+
}
|
454 |
+
}
|
455 |
+
|
456 |
+
return $valid;
|
457 |
+
|
458 |
+
}
|
459 |
+
|
460 |
+
add_action('init', 'acfe_dpt_local_field_group');
|
461 |
+
function acfe_dpt_local_field_group(){
|
462 |
+
|
463 |
+
acf_add_local_field_group(array(
|
464 |
+
'key' => 'group_acfe_dynamic_post_type',
|
465 |
+
'title' => __('Dynamic Post Type', 'acfe'),
|
466 |
+
|
467 |
+
'location' => array(
|
468 |
+
array(
|
469 |
+
array(
|
470 |
+
'param' => 'post_type',
|
471 |
+
'operator' => '==',
|
472 |
+
'value' => 'acfe-dpt',
|
473 |
+
),
|
474 |
+
),
|
475 |
+
),
|
476 |
+
|
477 |
+
'menu_order' => 0,
|
478 |
+
'position' => 'normal',
|
479 |
+
'style' => 'default',
|
480 |
+
'label_placement' => 'left',
|
481 |
+
'instruction_placement' => 'label',
|
482 |
+
'hide_on_screen' => '',
|
483 |
+
'active' => 1,
|
484 |
+
'description' => '',
|
485 |
+
|
486 |
+
'fields' => array(
|
487 |
+
array(
|
488 |
+
'key' => 'field_acfe_dpt_tab_general',
|
489 |
+
'label' => 'General',
|
490 |
+
'name' => '',
|
491 |
+
'type' => 'tab',
|
492 |
+
'instructions' => '',
|
493 |
+
'required' => 0,
|
494 |
+
'conditional_logic' => 0,
|
495 |
+
'wrapper' => array(
|
496 |
+
'width' => '',
|
497 |
+
'class' => '',
|
498 |
+
'id' => '',
|
499 |
+
),
|
500 |
+
'acfe_permissions' => '',
|
501 |
+
'placement' => 'top',
|
502 |
+
'endpoint' => 0,
|
503 |
+
),
|
504 |
+
array(
|
505 |
+
'key' => 'field_acfe_dpt_label',
|
506 |
+
'label' => 'Label',
|
507 |
+
'name' => 'label',
|
508 |
+
'type' => 'text',
|
509 |
+
'instructions' => 'General name for the post type, usually plural. Default is Posts/Pages',
|
510 |
+
'required' => 1,
|
511 |
+
'conditional_logic' => 0,
|
512 |
+
'wrapper' => array(
|
513 |
+
'width' => '',
|
514 |
+
'class' => '',
|
515 |
+
'id' => '',
|
516 |
+
),
|
517 |
+
'acfe_validate' => '',
|
518 |
+
'acfe_update' => '',
|
519 |
+
'acfe_permissions' => '',
|
520 |
+
'user_roles' => array(
|
521 |
+
0 => 'all',
|
522 |
+
),
|
523 |
+
'default_value' => '',
|
524 |
+
'placeholder' => '',
|
525 |
+
'prepend' => '',
|
526 |
+
'append' => '',
|
527 |
+
'maxlength' => '',
|
528 |
+
),
|
529 |
+
array(
|
530 |
+
'key' => 'field_acfe_dpt_name',
|
531 |
+
'label' => 'Name',
|
532 |
+
'name' => 'acfe_dpt_name',
|
533 |
+
'type' => 'acfe_slug',
|
534 |
+
'instructions' => 'Post type name. Max. 20 characters, cannot contain capital letters or spaces',
|
535 |
+
'required' => 1,
|
536 |
+
'conditional_logic' => 0,
|
537 |
+
'wrapper' => array(
|
538 |
+
'width' => '',
|
539 |
+
'class' => '',
|
540 |
+
'id' => '',
|
541 |
+
),
|
542 |
+
'acfe_validate' => '',
|
543 |
+
'acfe_update' => '',
|
544 |
+
'acfe_permissions' => '',
|
545 |
+
'default_value' => '',
|
546 |
+
'placeholder' => '',
|
547 |
+
'prepend' => '',
|
548 |
+
'append' => '',
|
549 |
+
'maxlength' => 20,
|
550 |
+
),
|
551 |
+
array(
|
552 |
+
'key' => 'field_acfe_dpt_description',
|
553 |
+
'label' => 'Description',
|
554 |
+
'name' => 'description',
|
555 |
+
'type' => 'text',
|
556 |
+
'instructions' => 'A short descriptive summary of the post type',
|
557 |
+
'required' => 0,
|
558 |
+
'conditional_logic' => 0,
|
559 |
+
'wrapper' => array(
|
560 |
+
'width' => '',
|
561 |
+
'class' => '',
|
562 |
+
'id' => '',
|
563 |
+
),
|
564 |
+
'acfe_validate' => '',
|
565 |
+
'acfe_update' => '',
|
566 |
+
'acfe_permissions' => '',
|
567 |
+
'default_value' => '',
|
568 |
+
'placeholder' => '',
|
569 |
+
'prepend' => '',
|
570 |
+
'append' => '',
|
571 |
+
'maxlength' => '',
|
572 |
+
),
|
573 |
+
array(
|
574 |
+
'key' => 'field_acfe_dpt_hierarchical',
|
575 |
+
'label' => 'Hierarchical',
|
576 |
+
'name' => 'hierarchical',
|
577 |
+
'type' => 'true_false',
|
578 |
+
'instructions' => 'Whether the post type is hierarchical (e.g. page). Allows Parent to be specified. The \'supports\' parameter should contain \'page-attributes\' to show the parent select box on the editor page.',
|
579 |
+
'required' => 0,
|
580 |
+
'conditional_logic' => 0,
|
581 |
+
'wrapper' => array(
|
582 |
+
'width' => '',
|
583 |
+
'class' => '',
|
584 |
+
'id' => '',
|
585 |
+
),
|
586 |
+
'acfe_validate' => '',
|
587 |
+
'acfe_update' => '',
|
588 |
+
'acfe_permissions' => '',
|
589 |
+
'message' => '',
|
590 |
+
'default_value' => 0,
|
591 |
+
'ui' => 1,
|
592 |
+
'ui_on_text' => '',
|
593 |
+
'ui_off_text' => '',
|
594 |
+
),
|
595 |
+
array(
|
596 |
+
'key' => 'field_acfe_dpt_supports',
|
597 |
+
'label' => 'Supports',
|
598 |
+
'name' => 'supports',
|
599 |
+
'type' => 'checkbox',
|
600 |
+
'instructions' => 'An alias for calling add_post_type_support() directly. As of 3.5, boolean false can be passed as value instead of an array to prevent default (title and editor) behavior.',
|
601 |
+
'required' => 0,
|
602 |
+
'conditional_logic' => 0,
|
603 |
+
'wrapper' => array(
|
604 |
+
'width' => '',
|
605 |
+
'class' => '',
|
606 |
+
'id' => '',
|
607 |
+
),
|
608 |
+
'acfe_validate' => '',
|
609 |
+
'acfe_update' => '',
|
610 |
+
'acfe_permissions' => '',
|
611 |
+
'choices' => array(
|
612 |
+
'title' => 'Title',
|
613 |
+
'editor' => 'Editor',
|
614 |
+
'author' => 'Author',
|
615 |
+
'thumbnail' => 'Thumbnail',
|
616 |
+
'excerpt' => 'Excerpt',
|
617 |
+
'trackbacks' => 'Trackbacks',
|
618 |
+
'custom-fields' => 'Custom fields',
|
619 |
+
'comments' => 'Comments',
|
620 |
+
'revisions' => 'Revisions',
|
621 |
+
'page-attributes' => 'Page attributes',
|
622 |
+
'post-formats' => 'Post formats',
|
623 |
+
),
|
624 |
+
'allow_custom' => 1,
|
625 |
+
'save_custom' => 1,
|
626 |
+
'default_value' => array(
|
627 |
+
0 => 'title',
|
628 |
+
1 => 'thumbnail',
|
629 |
+
2 => 'custom-fields',
|
630 |
+
),
|
631 |
+
'layout' => 'vertical',
|
632 |
+
'toggle' => 0,
|
633 |
+
'return_format' => 'value',
|
634 |
+
),
|
635 |
+
array(
|
636 |
+
'key' => 'field_acfe_dpt_taxonomies',
|
637 |
+
'label' => 'Taxonomies',
|
638 |
+
'name' => 'taxonomies',
|
639 |
+
'type' => 'acfe_taxonomies',
|
640 |
+
'instructions' => 'An array of registered taxonomies like category or post_tag that will be used with this post type. This can be used in lieu of calling register_taxonomy_for_object_type() directly. Custom taxonomies still need to be registered with register_taxonomy()',
|
641 |
+
'required' => 0,
|
642 |
+
'conditional_logic' => 0,
|
643 |
+
'wrapper' => array(
|
644 |
+
'width' => '',
|
645 |
+
'class' => '',
|
646 |
+
'id' => '',
|
647 |
+
),
|
648 |
+
'acfe_validate' => '',
|
649 |
+
'acfe_update' => '',
|
650 |
+
'acfe_permissions' => '',
|
651 |
+
'field_type' => 'checkbox',
|
652 |
+
'return_format' => 'name',
|
653 |
+
'multiple' => 0,
|
654 |
+
'allow_null' => 0,
|
655 |
+
),
|
656 |
+
array(
|
657 |
+
'key' => 'field_acfe_dpt_public',
|
658 |
+
'label' => 'Public',
|
659 |
+
'name' => 'public',
|
660 |
+
'type' => 'true_false',
|
661 |
+
'instructions' => 'Controls how the type is visible to authors (show_in_nav_menus, show_ui) and readers (exclude_from_search, publicly_queryable)',
|
662 |
+
'required' => 0,
|
663 |
+
'conditional_logic' => 0,
|
664 |
+
'wrapper' => array(
|
665 |
+
'width' => '',
|
666 |
+
'class' => '',
|
667 |
+
'id' => '',
|
668 |
+
),
|
669 |
+
'acfe_validate' => '',
|
670 |
+
'acfe_update' => '',
|
671 |
+
'acfe_permissions' => '',
|
672 |
+
'message' => '',
|
673 |
+
'default_value' => 1,
|
674 |
+
'ui' => 1,
|
675 |
+
'ui_on_text' => '',
|
676 |
+
'ui_off_text' => '',
|
677 |
+
),
|
678 |
+
array(
|
679 |
+
'key' => 'field_acfe_dpt_exclude_from_search',
|
680 |
+
'label' => 'Exclude from search',
|
681 |
+
'name' => 'exclude_from_search',
|
682 |
+
'type' => 'true_false',
|
683 |
+
'instructions' => 'Whether to exclude posts with this post type from front end search results',
|
684 |
+
'required' => 0,
|
685 |
+
'conditional_logic' => 0,
|
686 |
+
'wrapper' => array(
|
687 |
+
'width' => '',
|
688 |
+
'class' => '',
|
689 |
+
'id' => '',
|
690 |
+
),
|
691 |
+
'acfe_validate' => '',
|
692 |
+
'acfe_update' => '',
|
693 |
+
'acfe_permissions' => '',
|
694 |
+
'message' => '',
|
695 |
+
'default_value' => 0,
|
696 |
+
'ui' => 1,
|
697 |
+
'ui_on_text' => '',
|
698 |
+
'ui_off_text' => '',
|
699 |
+
),
|
700 |
+
array(
|
701 |
+
'key' => 'field_acfe_dpt_publicly_queryable',
|
702 |
+
'label' => 'Publicly queryable',
|
703 |
+
'name' => 'publicly_queryable',
|
704 |
+
'type' => 'true_false',
|
705 |
+
'instructions' => 'Whether queries can be performed on the front end as part of parse_request()',
|
706 |
+
'required' => 0,
|
707 |
+
'conditional_logic' => 0,
|
708 |
+
'wrapper' => array(
|
709 |
+
'width' => '',
|
710 |
+
'class' => '',
|
711 |
+
'id' => '',
|
712 |
+
),
|
713 |
+
'acfe_validate' => '',
|
714 |
+
'acfe_update' => '',
|
715 |
+
'acfe_permissions' => '',
|
716 |
+
'message' => '',
|
717 |
+
'default_value' => 1,
|
718 |
+
'ui' => 1,
|
719 |
+
'ui_on_text' => '',
|
720 |
+
'ui_off_text' => '',
|
721 |
+
),
|
722 |
+
array(
|
723 |
+
'key' => 'field_acfe_dpt_can_export',
|
724 |
+
'label' => 'Can export',
|
725 |
+
'name' => 'can_export',
|
726 |
+
'type' => 'true_false',
|
727 |
+
'instructions' => 'Can this post type be exported',
|
728 |
+
'required' => 0,
|
729 |
+
'conditional_logic' => 0,
|
730 |
+
'wrapper' => array(
|
731 |
+
'width' => '',
|
732 |
+
'class' => '',
|
733 |
+
'id' => '',
|
734 |
+
),
|
735 |
+
'acfe_validate' => '',
|
736 |
+
'acfe_update' => '',
|
737 |
+
'acfe_permissions' => '',
|
738 |
+
'message' => '',
|
739 |
+
'default_value' => 1,
|
740 |
+
'ui' => 1,
|
741 |
+
'ui_on_text' => '',
|
742 |
+
'ui_off_text' => '',
|
743 |
+
),
|
744 |
+
array(
|
745 |
+
'key' => 'field_acfe_dpt_delete_with_user',
|
746 |
+
'label' => 'Delete with user',
|
747 |
+
'name' => 'delete_with_user',
|
748 |
+
'type' => 'select',
|
749 |
+
'instructions' => 'Whether to delete posts of this type when deleting a user. If true, posts of this type belonging to the user will be moved to trash when then user is deleted.<br /><br />If false, posts of this type belonging to the user will not be trashed or deleted. If not set (the default), posts are trashed if the post type supports author. Otherwise posts are not trashed or deleted',
|
750 |
+
'required' => 0,
|
751 |
+
'conditional_logic' => 0,
|
752 |
+
'wrapper' => array(
|
753 |
+
'width' => '',
|
754 |
+
'class' => '',
|
755 |
+
'id' => '',
|
756 |
+
),
|
757 |
+
'acfe_validate' => '',
|
758 |
+
'acfe_update' => '',
|
759 |
+
'acfe_permissions' => '',
|
760 |
+
'choices' => array(
|
761 |
+
'null' => 'Null (default)',
|
762 |
+
'false' => 'False',
|
763 |
+
'true' => 'True',
|
764 |
+
),
|
765 |
+
'default_value' => array(
|
766 |
+
),
|
767 |
+
'allow_null' => 0,
|
768 |
+
'multiple' => 0,
|
769 |
+
'ui' => 0,
|
770 |
+
'return_format' => 'value',
|
771 |
+
'ajax' => 0,
|
772 |
+
'placeholder' => '',
|
773 |
+
),
|
774 |
+
array(
|
775 |
+
'key' => 'field_acfe_dpt_tab_labels',
|
776 |
+
'label' => 'Labels',
|
777 |
+
'name' => '',
|
778 |
+
'type' => 'tab',
|
779 |
+
'instructions' => '',
|
780 |
+
'required' => 0,
|
781 |
+
'conditional_logic' => 0,
|
782 |
+
'wrapper' => array(
|
783 |
+
'width' => '',
|
784 |
+
'class' => '',
|
785 |
+
'id' => '',
|
786 |
+
),
|
787 |
+
'acfe_permissions' => '',
|
788 |
+
'placement' => 'top',
|
789 |
+
'endpoint' => 0,
|
790 |
+
),
|
791 |
+
array(
|
792 |
+
'key' => 'field_acfe_dpt_labels',
|
793 |
+
'label' => 'Labels',
|
794 |
+
'name' => 'labels',
|
795 |
+
'type' => 'group',
|
796 |
+
'instructions' => 'An array of labels for this post type. By default, post labels are used for non-hierarchical post types and page labels for hierarchical ones.<br /><br />
|
797 |
+
Default: if empty, \'name\' is set to value of \'label\', and \'singular_name\' is set to value of \'name\'.',
|
798 |
+
'required' => 0,
|
799 |
+
'conditional_logic' => 0,
|
800 |
+
'wrapper' => array(
|
801 |
+
'width' => '',
|
802 |
+
'class' => '',
|
803 |
+
'id' => '',
|
804 |
+
),
|
805 |
+
'acfe_permissions' => '',
|
806 |
+
'layout' => 'row',
|
807 |
+
'sub_fields' => array(
|
808 |
+
array(
|
809 |
+
'key' => 'field_acfe_dpt_singular_name',
|
810 |
+
'label' => 'Singular name',
|
811 |
+
'name' => 'singular_name',
|
812 |
+
'type' => 'text',
|
813 |
+
'instructions' => '',
|
814 |
+
'required' => 0,
|
815 |
+
'conditional_logic' => 0,
|
816 |
+
'wrapper' => array(
|
817 |
+
'width' => '',
|
818 |
+
'class' => '',
|
819 |
+
'id' => '',
|
820 |
+
),
|
821 |
+
'acfe_validate' => '',
|
822 |
+
'acfe_update' => '',
|
823 |
+
'acfe_permissions' => '',
|
824 |
+
'default_value' => '',
|
825 |
+
'placeholder' => '',
|
826 |
+
'prepend' => '',
|
827 |
+
'append' => '',
|
828 |
+
'maxlength' => '',
|
829 |
+
),
|
830 |
+
array(
|
831 |
+
'key' => 'field_acfe_dpt_add_new',
|
832 |
+
'label' => 'Add new',
|
833 |
+
'name' => 'add_new',
|
834 |
+
'type' => 'text',
|
835 |
+
'instructions' => '',
|
836 |
+
'required' => 0,
|
837 |
+
'conditional_logic' => 0,
|
838 |
+
'wrapper' => array(
|
839 |
+
'width' => '',
|
840 |
+
'class' => '',
|
841 |
+
'id' => '',
|
842 |
+
),
|
843 |
+
'acfe_validate' => '',
|
844 |
+
'acfe_update' => '',
|
845 |
+
'acfe_permissions' => '',
|
846 |
+
'default_value' => '',
|
847 |
+
'placeholder' => '',
|
848 |
+
'prepend' => '',
|
849 |
+
'append' => '',
|
850 |
+
'maxlength' => '',
|
851 |
+
),
|
852 |
+
array(
|
853 |
+
'key' => 'field_acfe_dpt_add_new_item',
|
854 |
+
'label' => 'Add new item',
|
855 |
+
'name' => 'add_new_item',
|
856 |
+
'type' => 'text',
|
857 |
+
'instructions' => '',
|
858 |
+
'required' => 0,
|
859 |
+
'conditional_logic' => 0,
|
860 |
+
'wrapper' => array(
|
861 |
+
'width' => '',
|
862 |
+
'class' => '',
|
863 |
+
'id' => '',
|
864 |
+
),
|
865 |
+
'acfe_validate' => '',
|
866 |
+
'acfe_update' => '',
|
867 |
+
'acfe_permissions' => '',
|
868 |
+
'default_value' => '',
|
869 |
+
'placeholder' => '',
|
870 |
+
'prepend' => '',
|
871 |
+
'append' => '',
|
872 |
+
'maxlength' => '',
|
873 |
+
),
|
874 |
+
array(
|
875 |
+
'key' => 'field_acfe_dpt_edit_item',
|
876 |
+
'label' => 'Edit item',
|
877 |
+
'name' => 'edit_item',
|
878 |
+
'type' => 'text',
|
879 |
+
'instructions' => '',
|
880 |
+
'required' => 0,
|
881 |
+
'conditional_logic' => 0,
|
882 |
+
'wrapper' => array(
|
883 |
+
'width' => '',
|
884 |
+
'class' => '',
|
885 |
+
'id' => '',
|
886 |
+
),
|
887 |
+
'acfe_validate' => '',
|
888 |
+
'acfe_update' => '',
|
889 |
+
'acfe_permissions' => '',
|
890 |
+
'default_value' => '',
|
891 |
+
'placeholder' => '',
|
892 |
+
'prepend' => '',
|
893 |
+
'append' => '',
|
894 |
+
'maxlength' => '',
|
895 |
+
),
|
896 |
+
array(
|
897 |
+
'key' => 'field_acfe_dpt_new_item',
|
898 |
+
'label' => 'New item',
|
899 |
+
'name' => 'new_item',
|
900 |
+
'type' => 'text',
|
901 |
+
'instructions' => '',
|
902 |
+
'required' => 0,
|
903 |
+
'conditional_logic' => 0,
|
904 |
+
'wrapper' => array(
|
905 |
+
'width' => '',
|
906 |
+
'class' => '',
|
907 |
+
'id' => '',
|
908 |
+
),
|
909 |
+
'acfe_validate' => '',
|
910 |
+
'acfe_update' => '',
|
911 |
+
'acfe_permissions' => '',
|
912 |
+
'default_value' => '',
|
913 |
+
'placeholder' => '',
|
914 |
+
'prepend' => '',
|
915 |
+
'append' => '',
|
916 |
+
'maxlength' => '',
|
917 |
+
),
|
918 |
+
array(
|
919 |
+
'key' => 'field_acfe_dpt_view_item',
|
920 |
+
'label' => 'View item',
|
921 |
+
'name' => 'view_item',
|
922 |
+
'type' => 'text',
|
923 |
+
'instructions' => '',
|
924 |
+
'required' => 0,
|
925 |
+
'conditional_logic' => 0,
|
926 |
+
'wrapper' => array(
|
927 |
+
'width' => '',
|
928 |
+
'class' => '',
|
929 |
+
'id' => '',
|
930 |
+
),
|
931 |
+
'acfe_validate' => '',
|
932 |
+
'acfe_update' => '',
|
933 |
+
'acfe_permissions' => '',
|
934 |
+
'default_value' => '',
|
935 |
+
'placeholder' => '',
|
936 |
+
'prepend' => '',
|
937 |
+
'append' => '',
|
938 |
+
'maxlength' => '',
|
939 |
+
),
|
940 |
+
array(
|
941 |
+
'key' => 'field_acfe_dpt_view_items',
|
942 |
+
'label' => 'View items',
|
943 |
+
'name' => 'view_items',
|
944 |
+
'type' => 'text',
|
945 |
+
'instructions' => '',
|
946 |
+
'required' => 0,
|
947 |
+
'conditional_logic' => 0,
|
948 |
+
'wrapper' => array(
|
949 |
+
'width' => '',
|
950 |
+
'class' => '',
|
951 |
+
'id' => '',
|
952 |
+
),
|
953 |
+
'acfe_validate' => '',
|
954 |
+
'acfe_update' => '',
|
955 |
+
'acfe_permissions' => '',
|
956 |
+
'default_value' => '',
|
957 |
+
'placeholder' => '',
|
958 |
+
'prepend' => '',
|
959 |
+
'append' => '',
|
960 |
+
'maxlength' => '',
|
961 |
+
),
|
962 |
+
array(
|
963 |
+
'key' => 'field_acfe_dpt_search_items',
|
964 |
+
'label' => 'Search items',
|
965 |
+
'name' => 'search_items',
|
966 |
+
'type' => 'text',
|
967 |
+
'instructions' => '',
|
968 |
+
'required' => 0,
|
969 |
+
'conditional_logic' => 0,
|
970 |
+
'wrapper' => array(
|
971 |
+
'width' => '',
|
972 |
+
'class' => '',
|
973 |
+
'id' => '',
|
974 |
+
),
|
975 |
+
'acfe_validate' => '',
|
976 |
+
'acfe_update' => '',
|
977 |
+
'acfe_permissions' => '',
|
978 |
+
'default_value' => '',
|
979 |
+
'placeholder' => '',
|
980 |
+
'prepend' => '',
|
981 |
+
'append' => '',
|
982 |
+
'maxlength' => '',
|
983 |
+
),
|
984 |
+
array(
|
985 |
+
'key' => 'field_acfe_dpt_not_found',
|
986 |
+
'label' => 'Not found',
|
987 |
+
'name' => 'not_found',
|
988 |
+
'type' => 'text',
|
989 |
+
'instructions' => '',
|
990 |
+
'required' => 0,
|
991 |
+
'conditional_logic' => 0,
|
992 |
+
'wrapper' => array(
|
993 |
+
'width' => '',
|
994 |
+
'class' => '',
|
995 |
+
'id' => '',
|
996 |
+
),
|
997 |
+
'acfe_validate' => '',
|
998 |
+
'acfe_update' => '',
|
999 |
+
'acfe_permissions' => '',
|
1000 |
+
'default_value' => '',
|
1001 |
+
'placeholder' => '',
|
1002 |
+
'prepend' => '',
|
1003 |
+
'append' => '',
|
1004 |
+
'maxlength' => '',
|
1005 |
+
),
|
1006 |
+
array(
|
1007 |
+
'key' => 'field_acfe_dpt_not_found_in_trash',
|
1008 |
+
'label' => 'Not found in trash',
|
1009 |
+
'name' => 'not_found_in_trash',
|
1010 |
+
'type' => 'text',
|
1011 |
+
'instructions' => '',
|
1012 |
+
'required' => 0,
|
1013 |
+
'conditional_logic' => 0,
|
1014 |
+
'wrapper' => array(
|
1015 |
+
'width' => '',
|
1016 |
+
'class' => '',
|
1017 |
+
'id' => '',
|
1018 |
+
),
|
1019 |
+
'acfe_validate' => '',
|
1020 |
+
'acfe_update' => '',
|
1021 |
+
'acfe_permissions' => '',
|
1022 |
+
'default_value' => '',
|
1023 |
+
'placeholder' => '',
|
1024 |
+
'prepend' => '',
|
1025 |
+
'append' => '',
|
1026 |
+
'maxlength' => '',
|
1027 |
+
),
|
1028 |
+
array(
|
1029 |
+
'key' => 'field_acfe_dpt_parent_item_colon',
|
1030 |
+
'label' => 'Parent item colon',
|
1031 |
+
'name' => 'parent_item_colon',
|
1032 |
+
'type' => 'text',
|
1033 |
+
'instructions' => '',
|
1034 |
+
'required' => 0,
|
1035 |
+
'conditional_logic' => 0,
|
1036 |
+
'wrapper' => array(
|
1037 |
+
'width' => '',
|
1038 |
+
'class' => '',
|
1039 |
+
'id' => '',
|
1040 |
+
),
|
1041 |
+
'acfe_validate' => '',
|
1042 |
+
'acfe_update' => '',
|
1043 |
+
'acfe_permissions' => '',
|
1044 |
+
'default_value' => '',
|
1045 |
+
'placeholder' => '',
|
1046 |
+
'prepend' => '',
|
1047 |
+
'append' => '',
|
1048 |
+
'maxlength' => '',
|
1049 |
+
),
|
1050 |
+
array(
|
1051 |
+
'key' => 'field_acfe_dpt_all_items',
|
1052 |
+
'label' => 'All items',
|
1053 |
+
'name' => 'all_items',
|
1054 |
+
'type' => 'text',
|
1055 |
+
'instructions' => '',
|
1056 |
+
'required' => 0,
|
1057 |
+
'conditional_logic' => 0,
|
1058 |
+
'wrapper' => array(
|
1059 |
+
'width' => '',
|
1060 |
+
'class' => '',
|
1061 |
+
'id' => '',
|
1062 |
+
),
|
1063 |
+
'acfe_validate' => '',
|
1064 |
+
'acfe_update' => '',
|
1065 |
+
'acfe_permissions' => '',
|
1066 |
+
'default_value' => '',
|
1067 |
+
'placeholder' => '',
|
1068 |
+
'prepend' => '',
|
1069 |
+
'append' => '',
|
1070 |
+
'maxlength' => '',
|
1071 |
+
),
|
1072 |
+
array(
|
1073 |
+
'key' => 'field_acfe_dpt_archives',
|
1074 |
+
'label' => 'Archives',
|
1075 |
+
'name' => 'archives',
|
1076 |
+
'type' => 'text',
|
1077 |
+
'instructions' => '',
|
1078 |
+
'required' => 0,
|
1079 |
+
'conditional_logic' => 0,
|
1080 |
+
'wrapper' => array(
|
1081 |
+
'width' => '',
|
1082 |
+
'class' => '',
|
1083 |
+
'id' => '',
|
1084 |
+
),
|
1085 |
+
'acfe_validate' => '',
|
1086 |
+
'acfe_update' => '',
|
1087 |
+
'acfe_permissions' => '',
|
1088 |
+
'default_value' => '',
|
1089 |
+
'placeholder' => '',
|
1090 |
+
'prepend' => '',
|
1091 |
+
'append' => '',
|
1092 |
+
'maxlength' => '',
|
1093 |
+
),
|
1094 |
+
array(
|
1095 |
+
'key' => 'field_acfe_dpt_attributes',
|
1096 |
+
'label' => 'Attributes',
|
1097 |
+
'name' => 'attributes',
|
1098 |
+
'type' => 'text',
|
1099 |
+
'instructions' => '',
|
1100 |
+
'required' => 0,
|
1101 |
+
'conditional_logic' => 0,
|
1102 |
+
'wrapper' => array(
|
1103 |
+
'width' => '',
|
1104 |
+
'class' => '',
|
1105 |
+
'id' => '',
|
1106 |
+
),
|
1107 |
+
'acfe_validate' => '',
|
1108 |
+
'acfe_update' => '',
|
1109 |
+
'acfe_permissions' => '',
|
1110 |
+
'default_value' => '',
|
1111 |
+
'placeholder' => '',
|
1112 |
+
'prepend' => '',
|
1113 |
+
'append' => '',
|
1114 |
+
'maxlength' => '',
|
1115 |
+
),
|
1116 |
+
array(
|
1117 |
+
'key' => 'field_acfe_dpt_insert_into_item',
|
1118 |
+
'label' => 'Insert into item',
|
1119 |
+
'name' => 'insert_into_item',
|
1120 |
+
'type' => 'text',
|
1121 |
+
'instructions' => '',
|
1122 |
+
'required' => 0,
|
1123 |
+
'conditional_logic' => 0,
|
1124 |
+
'wrapper' => array(
|
1125 |
+
'width' => '',
|
1126 |
+
'class' => '',
|
1127 |
+
'id' => '',
|
1128 |
+
),
|
1129 |
+
'acfe_validate' => '',
|
1130 |
+
'acfe_update' => '',
|
1131 |
+
'acfe_permissions' => '',
|
1132 |
+
'default_value' => '',
|
1133 |
+
'placeholder' => '',
|
1134 |
+
'prepend' => '',
|
1135 |
+
'append' => '',
|
1136 |
+
'maxlength' => '',
|
1137 |
+
),
|
1138 |
+
array(
|
1139 |
+
'key' => 'field_acfe_dpt_uploaded_to_this_item',
|
1140 |
+
'label' => 'Uploaded to this item',
|
1141 |
+
'name' => 'uploaded_to_this_item',
|
1142 |
+
'type' => 'text',
|
1143 |
+
'instructions' => '',
|
1144 |
+
'required' => 0,
|
1145 |
+
'conditional_logic' => 0,
|
1146 |
+
'wrapper' => array(
|
1147 |
+
'width' => '',
|
1148 |
+
'class' => '',
|
1149 |
+
'id' => '',
|
1150 |
+
),
|
1151 |
+
'acfe_validate' => '',
|
1152 |
+
'acfe_update' => '',
|
1153 |
+
'acfe_permissions' => '',
|
1154 |
+
'default_value' => '',
|
1155 |
+
'placeholder' => '',
|
1156 |
+
'prepend' => '',
|
1157 |
+
'append' => '',
|
1158 |
+
'maxlength' => '',
|
1159 |
+
),
|
1160 |
+
array(
|
1161 |
+
'key' => 'field_acfe_dpt_featured_image',
|
1162 |
+
'label' => 'Featured image',
|
1163 |
+
'name' => 'featured_image',
|
1164 |
+
'type' => 'text',
|
1165 |
+
'instructions' => '',
|
1166 |
+
'required' => 0,
|
1167 |
+
'conditional_logic' => 0,
|
1168 |
+
'wrapper' => array(
|
1169 |
+
'width' => '',
|
1170 |
+
'class' => '',
|
1171 |
+
'id' => '',
|
1172 |
+
),
|
1173 |
+
'acfe_validate' => '',
|
1174 |
+
'acfe_update' => '',
|
1175 |
+
'acfe_permissions' => '',
|
1176 |
+
'default_value' => '',
|
1177 |
+
'placeholder' => '',
|
1178 |
+
'prepend' => '',
|
1179 |
+
'append' => '',
|
1180 |
+
'maxlength' => '',
|
1181 |
+
),
|
1182 |
+
array(
|
1183 |
+
'key' => 'field_acfe_dpt_set_featured_image',
|
1184 |
+
'label' => 'Set featured image',
|
1185 |
+
'name' => 'set_featured_image',
|
1186 |
+
'type' => 'text',
|
1187 |
+
'instructions' => '',
|
1188 |
+
'required' => 0,
|
1189 |
+
'conditional_logic' => 0,
|
1190 |
+
'wrapper' => array(
|
1191 |
+
'width' => '',
|
1192 |
+
'class' => '',
|
1193 |
+
'id' => '',
|
1194 |
+
),
|
1195 |
+
'acfe_validate' => '',
|
1196 |
+
'acfe_update' => '',
|
1197 |
+
'acfe_permissions' => '',
|
1198 |
+
'default_value' => '',
|
1199 |
+
'placeholder' => '',
|
1200 |
+
'prepend' => '',
|
1201 |
+
'append' => '',
|
1202 |
+
'maxlength' => '',
|
1203 |
+
),
|
1204 |
+
array(
|
1205 |
+
'key' => 'field_acfe_dpt_remove_featured_image',
|
1206 |
+
'label' => 'Remove featured image',
|
1207 |
+
'name' => 'remove_featured_image',
|
1208 |
+
'type' => 'text',
|
1209 |
+
'instructions' => '',
|
1210 |
+
'required' => 0,
|
1211 |
+
'conditional_logic' => 0,
|
1212 |
+
'wrapper' => array(
|
1213 |
+
'width' => '',
|
1214 |
+
'class' => '',
|
1215 |
+
'id' => '',
|
1216 |
+
),
|
1217 |
+
'acfe_validate' => '',
|
1218 |
+
'acfe_update' => '',
|
1219 |
+
'acfe_permissions' => '',
|
1220 |
+
'default_value' => '',
|
1221 |
+
'placeholder' => '',
|
1222 |
+
'prepend' => '',
|
1223 |
+
'append' => '',
|
1224 |
+
'maxlength' => '',
|
1225 |
+
),
|
1226 |
+
array(
|
1227 |
+
'key' => 'field_acfe_dpt_use_featured_image',
|
1228 |
+
'label' => 'Use featured image',
|
1229 |
+
'name' => 'use_featured_image',
|
1230 |
+
'type' => 'text',
|
1231 |
+
'instructions' => '',
|
1232 |
+
'required' => 0,
|
1233 |
+
'conditional_logic' => 0,
|
1234 |
+
'wrapper' => array(
|
1235 |
+
'width' => '',
|
1236 |
+
'class' => '',
|
1237 |
+
'id' => '',
|
1238 |
+
),
|
1239 |
+
'acfe_validate' => '',
|
1240 |
+
'acfe_update' => '',
|
1241 |
+
'acfe_permissions' => '',
|
1242 |
+
'default_value' => '',
|
1243 |
+
'placeholder' => '',
|
1244 |
+
'prepend' => '',
|
1245 |
+
'append' => '',
|
1246 |
+
'maxlength' => '',
|
1247 |
+
),
|
1248 |
+
array(
|
1249 |
+
'key' => 'field_acfe_dpt_menu_name',
|
1250 |
+
'label' => 'Menu name',
|
1251 |
+
'name' => 'menu_name',
|
1252 |
+
'type' => 'text',
|
1253 |
+
'instructions' => '',
|
1254 |
+
'required' => 0,
|
1255 |
+
'conditional_logic' => 0,
|
1256 |
+
'wrapper' => array(
|
1257 |
+
'width' => '',
|
1258 |
+
'class' => '',
|
1259 |
+
'id' => '',
|
1260 |
+
),
|
1261 |
+
'acfe_validate' => '',
|
1262 |
+
'acfe_update' => '',
|
1263 |
+
'acfe_permissions' => '',
|
1264 |
+
'default_value' => '',
|
1265 |
+
'placeholder' => '',
|
1266 |
+
'prepend' => '',
|
1267 |
+
'append' => '',
|
1268 |
+
'maxlength' => '',
|
1269 |
+
),
|
1270 |
+
array(
|
1271 |
+
'key' => 'field_acfe_dpt_filter_items_list',
|
1272 |
+
'label' => 'Filter items list',
|
1273 |
+
'name' => 'filter_items_list',
|
1274 |
+
'type' => 'text',
|
1275 |
+
'instructions' => '',
|
1276 |
+
'required' => 0,
|
1277 |
+
'conditional_logic' => 0,
|
1278 |
+
'wrapper' => array(
|
1279 |
+
'width' => '',
|
1280 |
+
'class' => '',
|
1281 |
+
'id' => '',
|
1282 |
+
),
|
1283 |
+
'acfe_validate' => '',
|
1284 |
+
'acfe_update' => '',
|
1285 |
+
'acfe_permissions' => '',
|
1286 |
+
'default_value' => '',
|
1287 |
+
'placeholder' => '',
|
1288 |
+
'prepend' => '',
|
1289 |
+
'append' => '',
|
1290 |
+
'maxlength' => '',
|
1291 |
+
),
|
1292 |
+
array(
|
1293 |
+
'key' => 'field_acfe_dpt_items_list_navigation',
|
1294 |
+
'label' => 'Items list navigation',
|
1295 |
+
'name' => 'items_list_navigation',
|
1296 |
+
'type' => 'text',
|
1297 |
+
'instructions' => '',
|
1298 |
+
'required' => 0,
|
1299 |
+
'conditional_logic' => 0,
|
1300 |
+
'wrapper' => array(
|
1301 |
+
'width' => '',
|
1302 |
+
'class' => '',
|
1303 |
+
'id' => '',
|
1304 |
+
),
|
1305 |
+
'acfe_validate' => '',
|
1306 |
+
'acfe_update' => '',
|
1307 |
+
'acfe_permissions' => '',
|
1308 |
+
'default_value' => '',
|
1309 |
+
'placeholder' => '',
|
1310 |
+
'prepend' => '',
|
1311 |
+
'append' => '',
|
1312 |
+
'maxlength' => '',
|
1313 |
+
),
|
1314 |
+
array(
|
1315 |
+
'key' => 'field_acfe_dpt_items_list',
|
1316 |
+
'label' => 'Items list',
|
1317 |
+
'name' => 'items_list',
|
1318 |
+
'type' => 'text',
|
1319 |
+
'instructions' => '',
|
1320 |
+
'required' => 0,
|
1321 |
+
'conditional_logic' => 0,
|
1322 |
+
'wrapper' => array(
|
1323 |
+
'width' => '',
|
1324 |
+
'class' => '',
|
1325 |
+
'id' => '',
|
1326 |
+
),
|
1327 |
+
'acfe_validate' => '',
|
1328 |
+
'acfe_update' => '',
|
1329 |
+
'acfe_permissions' => '',
|
1330 |
+
'default_value' => '',
|
1331 |
+
'placeholder' => '',
|
1332 |
+
'prepend' => '',
|
1333 |
+
'append' => '',
|
1334 |
+
'maxlength' => '',
|
1335 |
+
),
|
1336 |
+
array(
|
1337 |
+
'key' => 'field_acfe_dpt_name_admin_bar',
|
1338 |
+
'label' => 'Name admin bar',
|
1339 |
+
'name' => 'name_admin_bar',
|
1340 |
+
'type' => 'text',
|
1341 |
+
'instructions' => '',
|
1342 |
+
'required' => 0,
|
1343 |
+
'conditional_logic' => 0,
|
1344 |
+
'wrapper' => array(
|
1345 |
+
'width' => '',
|
1346 |
+
'class' => '',
|
1347 |
+
'id' => '',
|
1348 |
+
),
|
1349 |
+
'acfe_validate' => '',
|
1350 |
+
'acfe_update' => '',
|
1351 |
+
'acfe_permissions' => '',
|
1352 |
+
'default_value' => '',
|
1353 |
+
'placeholder' => '',
|
1354 |
+
'prepend' => '',
|
1355 |
+
'append' => '',
|
1356 |
+
'maxlength' => '',
|
1357 |
+
),
|
1358 |
+
array(
|
1359 |
+
'key' => 'field_acfe_dpt_item_published',
|
1360 |
+
'label' => 'Item published',
|
1361 |
+
'name' => 'item_published',
|
1362 |
+
'type' => 'text',
|
1363 |
+
'instructions' => '',
|
1364 |
+
'required' => 0,
|
1365 |
+
'conditional_logic' => 0,
|
1366 |
+
'wrapper' => array(
|
1367 |
+
'width' => '',
|
1368 |
+
'class' => '',
|
1369 |
+
'id' => '',
|
1370 |
+
),
|
1371 |
+
'acfe_validate' => '',
|
1372 |
+
'acfe_update' => '',
|
1373 |
+
'acfe_permissions' => '',
|
1374 |
+
'default_value' => '',
|
1375 |
+
'placeholder' => '',
|
1376 |
+
'prepend' => '',
|
1377 |
+
'append' => '',
|
1378 |
+
'maxlength' => '',
|
1379 |
+
),
|
1380 |
+
array(
|
1381 |
+
'key' => 'field_acfe_dpt_item_published_privately',
|
1382 |
+
'label' => 'Item published privately',
|
1383 |
+
'name' => 'item_published_privately',
|
1384 |
+
'type' => 'text',
|
1385 |
+
'instructions' => '',
|
1386 |
+
'required' => 0,
|
1387 |
+
'conditional_logic' => 0,
|
1388 |
+
'wrapper' => array(
|
1389 |
+
'width' => '',
|
1390 |
+
'class' => '',
|
1391 |
+
'id' => '',
|
1392 |
+
),
|
1393 |
+
'acfe_validate' => '',
|
1394 |
+
'acfe_update' => '',
|
1395 |
+
'acfe_permissions' => '',
|
1396 |
+
'default_value' => '',
|
1397 |
+
'placeholder' => '',
|
1398 |
+
'prepend' => '',
|
1399 |
+
'append' => '',
|
1400 |
+
'maxlength' => '',
|
1401 |
+
),
|
1402 |
+
array(
|
1403 |
+
'key' => 'field_acfe_dpt_item_reverted_to_draft',
|
1404 |
+
'label' => 'Item reverted to draft',
|
1405 |
+
'name' => 'item_reverted_to_draft',
|
1406 |
+
'type' => 'text',
|
1407 |
+
'instructions' => '',
|
1408 |
+
'required' => 0,
|
1409 |
+
'conditional_logic' => 0,
|
1410 |
+
'wrapper' => array(
|
1411 |
+
'width' => '',
|
1412 |
+
'class' => '',
|
1413 |
+
'id' => '',
|
1414 |
+
),
|
1415 |
+
'acfe_validate' => '',
|
1416 |
+
'acfe_update' => '',
|
1417 |
+
'acfe_permissions' => '',
|
1418 |
+
'default_value' => '',
|
1419 |
+
'placeholder' => '',
|
1420 |
+
'prepend' => '',
|
1421 |
+
'append' => '',
|
1422 |
+
'maxlength' => '',
|
1423 |
+
),
|
1424 |
+
array(
|
1425 |
+
'key' => 'field_acfe_dpt_item_scheduled',
|
1426 |
+
'label' => 'Item scheduled',
|
1427 |
+
'name' => 'item_scheduled',
|
1428 |
+
'type' => 'text',
|
1429 |
+
'instructions' => '',
|
1430 |
+
'required' => 0,
|
1431 |
+
'conditional_logic' => 0,
|
1432 |
+
'wrapper' => array(
|
1433 |
+
'width' => '',
|
1434 |
+
'class' => '',
|
1435 |
+
'id' => '',
|
1436 |
+
),
|
1437 |
+
'acfe_validate' => '',
|
1438 |
+
'acfe_update' => '',
|
1439 |
+
'acfe_permissions' => '',
|
1440 |
+
'default_value' => '',
|
1441 |
+
'placeholder' => '',
|
1442 |
+
'prepend' => '',
|
1443 |
+
'append' => '',
|
1444 |
+
'maxlength' => '',
|
1445 |
+
),
|
1446 |
+
array(
|
1447 |
+
'key' => 'field_acfe_dpt_item_updated',
|
1448 |
+
'label' => 'Item updated',
|
1449 |
+
'name' => 'item_updated',
|
1450 |
+
'type' => 'text',
|
1451 |
+
'instructions' => '',
|
1452 |
+
'required' => 0,
|
1453 |
+
'conditional_logic' => 0,
|
1454 |
+
'wrapper' => array(
|
1455 |
+
'width' => '',
|
1456 |
+
'class' => '',
|
1457 |
+
'id' => '',
|
1458 |
+
),
|
1459 |
+
'acfe_validate' => '',
|
1460 |
+
'acfe_update' => '',
|
1461 |
+
'acfe_permissions' => '',
|
1462 |
+
'default_value' => '',
|
1463 |
+
'placeholder' => '',
|
1464 |
+
'prepend' => '',
|
1465 |
+
'append' => '',
|
1466 |
+
'maxlength' => '',
|
1467 |
+
),
|
1468 |
+
),
|
1469 |
+
),
|
1470 |
+
array(
|
1471 |
+
'key' => 'field_acfe_dpt_tab_menu',
|
1472 |
+
'label' => 'Menu',
|
1473 |
+
'name' => '',
|
1474 |
+
'type' => 'tab',
|
1475 |
+
'instructions' => '',
|
1476 |
+
'required' => 0,
|
1477 |
+
'conditional_logic' => 0,
|
1478 |
+
'wrapper' => array(
|
1479 |
+
'width' => '',
|
1480 |
+
'class' => '',
|
1481 |
+
'id' => '',
|
1482 |
+
),
|
1483 |
+
'acfe_permissions' => '',
|
1484 |
+
'placement' => 'top',
|
1485 |
+
'endpoint' => 0,
|
1486 |
+
),
|
1487 |
+
array(
|
1488 |
+
'key' => 'field_acfe_dpt_menu_position',
|
1489 |
+
'label' => 'Menu position',
|
1490 |
+
'name' => 'menu_position',
|
1491 |
+
'type' => 'number',
|
1492 |
+
'instructions' => 'The position in the menu order the post type should appear. show_in_menu must be true',
|
1493 |
+
'required' => 0,
|
1494 |
+
'conditional_logic' => 0,
|
1495 |
+
'wrapper' => array(
|
1496 |
+
'width' => '',
|
1497 |
+
'class' => '',
|
1498 |
+
'id' => '',
|
1499 |
+
),
|
1500 |
+
'acfe_validate' => '',
|
1501 |
+
'acfe_update' => '',
|
1502 |
+
'acfe_permissions' => '',
|
1503 |
+
'default_value' => 20,
|
1504 |
+
'placeholder' => '',
|
1505 |
+
'prepend' => '',
|
1506 |
+
'append' => '',
|
1507 |
+
'min' => 0,
|
1508 |
+
'max' => '',
|
1509 |
+
'step' => '',
|
1510 |
+
),
|
1511 |
+
array(
|
1512 |
+
'key' => 'field_acfe_dpt_menu_icon',
|
1513 |
+
'label' => 'Menu icon',
|
1514 |
+
'name' => 'menu_icon',
|
1515 |
+
'type' => 'text',
|
1516 |
+
'instructions' => 'The url to the icon to be used for this menu or the name of the icon from the iconfont (<a href="https://developer.wordpress.org/resource/dashicons/" target="_blank">Dashicons</a>)',
|
1517 |
+
'required' => 0,
|
1518 |
+
'conditional_logic' => 0,
|
1519 |
+
'wrapper' => array(
|
1520 |
+
'width' => '',
|
1521 |
+
'class' => '',
|
1522 |
+
'id' => '',
|
1523 |
+
),
|
1524 |
+
'acfe_validate' => '',
|
1525 |
+
'acfe_update' => '',
|
1526 |
+
'acfe_permissions' => '',
|
1527 |
+
'default_value' => 'dashicons-admin-post',
|
1528 |
+
'placeholder' => '',
|
1529 |
+
'prepend' => '',
|
1530 |
+
'append' => '',
|
1531 |
+
'maxlength' => '',
|
1532 |
+
),
|
1533 |
+
array(
|
1534 |
+
'key' => 'field_acfe_dpt_show_ui',
|
1535 |
+
'label' => 'Show UI',
|
1536 |
+
'name' => 'show_ui',
|
1537 |
+
'type' => 'true_false',
|
1538 |
+
'instructions' => 'Whether to generate a default UI for managing this post type in the admin',
|
1539 |
+
'required' => 0,
|
1540 |
+
'conditional_logic' => 0,
|
1541 |
+
'wrapper' => array(
|
1542 |
+
'width' => '',
|
1543 |
+
'class' => '',
|
1544 |
+
'id' => '',
|
1545 |
+
),
|
1546 |
+
'acfe_validate' => '',
|
1547 |
+
'acfe_update' => '',
|
1548 |
+
'acfe_permissions' => '',
|
1549 |
+
'message' => '',
|
1550 |
+
'default_value' => 1,
|
1551 |
+
'ui' => 1,
|
1552 |
+
'ui_on_text' => '',
|
1553 |
+
'ui_off_text' => '',
|
1554 |
+
),
|
1555 |
+
array(
|
1556 |
+
'key' => 'field_acfe_dpt_show_in_menu',
|
1557 |
+
'label' => 'Show in menu',
|
1558 |
+
'name' => 'show_in_menu',
|
1559 |
+
'type' => 'true_false',
|
1560 |
+
'instructions' => 'Where to show the post type in the admin menu. show_ui must be true',
|
1561 |
+
'required' => 0,
|
1562 |
+
'conditional_logic' => 0,
|
1563 |
+
'wrapper' => array(
|
1564 |
+
'width' => '',
|
1565 |
+
'class' => '',
|
1566 |
+
'id' => '',
|
1567 |
+
),
|
1568 |
+
'acfe_validate' => '',
|
1569 |
+
'acfe_update' => '',
|
1570 |
+
'acfe_permissions' => '',
|
1571 |
+
'message' => '',
|
1572 |
+
'default_value' => 1,
|
1573 |
+
'ui' => 1,
|
1574 |
+
'ui_on_text' => '',
|
1575 |
+
'ui_off_text' => '',
|
1576 |
+
),
|
1577 |
+
array(
|
1578 |
+
'key' => 'field_acfe_dpt_show_in_menu_text',
|
1579 |
+
'label' => 'Show in menu (text)',
|
1580 |
+
'name' => 'show_in_menu_text',
|
1581 |
+
'type' => 'text',
|
1582 |
+
'instructions' => 'If an existing top level page such as \'tools.php\' or \'edit.php?post_type=page\', the post type will be placed as a sub menu of that',
|
1583 |
+
'required' => 0,
|
1584 |
+
'conditional_logic' => array(
|
1585 |
+
array(
|
1586 |
+
array(
|
1587 |
+
'field' => 'field_5c9f5dd58d5ee',
|
1588 |
+
'operator' => '==',
|
1589 |
+
'value' => '1',
|
1590 |
+
),
|
1591 |
+
),
|
1592 |
+
),
|
1593 |
+
'wrapper' => array(
|
1594 |
+
'width' => '',
|
1595 |
+
'class' => '',
|
1596 |
+
'id' => '',
|
1597 |
+
),
|
1598 |
+
'acfe_validate' => '',
|
1599 |
+
'acfe_update' => '',
|
1600 |
+
'acfe_permissions' => '',
|
1601 |
+
'default_value' => '',
|
1602 |
+
'placeholder' => '',
|
1603 |
+
'prepend' => '',
|
1604 |
+
'append' => '',
|
1605 |
+
'maxlength' => '',
|
1606 |
+
),
|
1607 |
+
array(
|
1608 |
+
'key' => 'field_acfe_dpt_show_in_nav_menus',
|
1609 |
+
'label' => 'Show in nav menus',
|
1610 |
+
'name' => 'show_in_nav_menus',
|
1611 |
+
'type' => 'true_false',
|
1612 |
+
'instructions' => 'Whether post_type is available for selection in navigation menus',
|
1613 |
+
'required' => 0,
|
1614 |
+
'conditional_logic' => 0,
|
1615 |
+
'wrapper' => array(
|
1616 |
+
'width' => '',
|
1617 |
+
'class' => '',
|
1618 |
+
'id' => '',
|
1619 |
+
),
|
1620 |
+
'acfe_validate' => '',
|
1621 |
+
'acfe_update' => '',
|
1622 |
+
'acfe_permissions' => '',
|
1623 |
+
'message' => '',
|
1624 |
+
'default_value' => 1,
|
1625 |
+
'ui' => 1,
|
1626 |
+
'ui_on_text' => '',
|
1627 |
+
'ui_off_text' => '',
|
1628 |
+
),
|
1629 |
+
array(
|
1630 |
+
'key' => 'field_acfe_dpt_show_in_admin_bar',
|
1631 |
+
'label' => 'Show in admin bar',
|
1632 |
+
'name' => 'show_in_admin_bar',
|
1633 |
+
'type' => 'true_false',
|
1634 |
+
'instructions' => 'Where to show the post type in the admin menu. show_ui must be true',
|
1635 |
+
'required' => 0,
|
1636 |
+
'conditional_logic' => 0,
|
1637 |
+
'wrapper' => array(
|
1638 |
+
'width' => '',
|
1639 |
+
'class' => '',
|
1640 |
+
'id' => '',
|
1641 |
+
),
|
1642 |
+
'acfe_validate' => '',
|
1643 |
+
'acfe_update' => '',
|
1644 |
+
'acfe_permissions' => '',
|
1645 |
+
'message' => '',
|
1646 |
+
'default_value' => 1,
|
1647 |
+
'ui' => 1,
|
1648 |
+
'ui_on_text' => '',
|
1649 |
+
'ui_off_text' => '',
|
1650 |
+
),
|
1651 |
+
array(
|
1652 |
+
'key' => 'field_acfe_dpt_tab_capability',
|
1653 |
+
'label' => 'Capability',
|
1654 |
+
'name' => '',
|
1655 |
+
'type' => 'tab',
|
1656 |
+
'instructions' => '',
|
1657 |
+
'required' => 0,
|
1658 |
+
'conditional_logic' => 0,
|
1659 |
+
'wrapper' => array(
|
1660 |
+
'width' => '',
|
1661 |
+
'class' => '',
|
1662 |
+
'id' => '',
|
1663 |
+
),
|
1664 |
+
'acfe_permissions' => '',
|
1665 |
+
'placement' => 'top',
|
1666 |
+
'endpoint' => 0,
|
1667 |
+
),
|
1668 |
+
array(
|
1669 |
+
'key' => 'field_acfe_dpt_capability_type',
|
1670 |
+
'label' => 'Capability type',
|
1671 |
+
'name' => 'capability_type',
|
1672 |
+
'type' => 'textarea',
|
1673 |
+
'instructions' => 'The string to use to build the read, edit, and delete capabilities.<br />
|
1674 |
+
May be passed as an array to allow for alternative plurals when using this argument as a base to construct the capabilities, like this:<br /><br />
|
1675 |
+
|
1676 |
+
story<br />
|
1677 |
+
stories',
|
1678 |
+
'required' => 0,
|
1679 |
+
'conditional_logic' => 0,
|
1680 |
+
'wrapper' => array(
|
1681 |
+
'width' => '',
|
1682 |
+
'class' => '',
|
1683 |
+
'id' => '',
|
1684 |
+
),
|
1685 |
+
'acfe_validate' => '',
|
1686 |
+
'acfe_update' => '',
|
1687 |
+
'acfe_permissions' => '',
|
1688 |
+
'default_value' => 'post',
|
1689 |
+
'placeholder' => '',
|
1690 |
+
'maxlength' => '',
|
1691 |
+
'rows' => '',
|
1692 |
+
'new_lines' => '',
|
1693 |
+
),
|
1694 |
+
array(
|
1695 |
+
'key' => 'field_acfe_dpt_capabilities',
|
1696 |
+
'label' => 'Capabilities',
|
1697 |
+
'name' => 'capabilities',
|
1698 |
+
'type' => 'textarea',
|
1699 |
+
'instructions' => 'An array of the capabilities for this post type. Specify capabilities like this:<br /><br />
|
1700 |
+
|
1701 |
+
edit_post<br />
|
1702 |
+
read_post<br />
|
1703 |
+
delete_post<br />
|
1704 |
+
edit_posts<br />
|
1705 |
+
etc...',
|
1706 |
+
'required' => 0,
|
1707 |
+
'conditional_logic' => 0,
|
1708 |
+
'wrapper' => array(
|
1709 |
+
'width' => '',
|
1710 |
+
'class' => '',
|
1711 |
+
'id' => '',
|
1712 |
+
),
|
1713 |
+
'acfe_validate' => '',
|
1714 |
+
'acfe_update' => '',
|
1715 |
+
'acfe_permissions' => '',
|
1716 |
+
'default_value' => '',
|
1717 |
+
'placeholder' => '',
|
1718 |
+
'maxlength' => '',
|
1719 |
+
'rows' => '',
|
1720 |
+
'new_lines' => '',
|
1721 |
+
),
|
1722 |
+
array(
|
1723 |
+
'key' => 'field_acfe_dpt_map_meta_cap',
|
1724 |
+
'label' => 'Map meta cap',
|
1725 |
+
'name' => 'map_meta_cap',
|
1726 |
+
'type' => 'select',
|
1727 |
+
'instructions' => '',
|
1728 |
+
'required' => 0,
|
1729 |
+
'conditional_logic' => 0,
|
1730 |
+
'wrapper' => array(
|
1731 |
+
'width' => '',
|
1732 |
+
'class' => '',
|
1733 |
+
'id' => '',
|
1734 |
+
),
|
1735 |
+
'acfe_validate' => '',
|
1736 |
+
'acfe_update' => '',
|
1737 |
+
'acfe_permissions' => '',
|
1738 |
+
'choices' => array(
|
1739 |
+
'null' => 'Null (default)',
|
1740 |
+
'false' => 'False',
|
1741 |
+
'true' => 'True',
|
1742 |
+
),
|
1743 |
+
'default_value' => array(
|
1744 |
+
0 => 'null',
|
1745 |
+
),
|
1746 |
+
'allow_null' => 0,
|
1747 |
+
'multiple' => 0,
|
1748 |
+
'ui' => 0,
|
1749 |
+
'return_format' => 'value',
|
1750 |
+
'ajax' => 0,
|
1751 |
+
'placeholder' => '',
|
1752 |
+
),
|
1753 |
+
array(
|
1754 |
+
'key' => 'field_acfe_dpt_tab_archive',
|
1755 |
+
'label' => 'Archive',
|
1756 |
+
'name' => '',
|
1757 |
+
'type' => 'tab',
|
1758 |
+
'instructions' => '',
|
1759 |
+
'required' => 0,
|
1760 |
+
'conditional_logic' => 0,
|
1761 |
+
'wrapper' => array(
|
1762 |
+
'width' => '',
|
1763 |
+
'class' => '',
|
1764 |
+
'id' => '',
|
1765 |
+
),
|
1766 |
+
'acfe_permissions' => '',
|
1767 |
+
'placement' => 'top',
|
1768 |
+
'endpoint' => 0,
|
1769 |
+
),
|
1770 |
+
array(
|
1771 |
+
'key' => 'field_acfe_dpt_archive_template',
|
1772 |
+
'label' => 'Template',
|
1773 |
+
'name' => 'acfe_dpt_archive_template',
|
1774 |
+
'type' => 'text',
|
1775 |
+
'instructions' => 'ACF Extended: Which template file to load for the archive query. More informations on <a href="https://developer.wordpress.org/themes/basics/template-hierarchy/">Template hierarchy</a>',
|
1776 |
+
'required' => 0,
|
1777 |
+
'conditional_logic' => 0,
|
1778 |
+
'wrapper' => array(
|
1779 |
+
'width' => '',
|
1780 |
+
'class' => '',
|
1781 |
+
'id' => '',
|
1782 |
+
),
|
1783 |
+
'acfe_validate' => '',
|
1784 |
+
'acfe_update' => '',
|
1785 |
+
'acfe_permissions' => '',
|
1786 |
+
'default_value' => '',
|
1787 |
+
'placeholder' => 'my-template.php',
|
1788 |
+
'prepend' => str_replace(home_url(), '', ACFE_THEME_URL) . '/',
|
1789 |
+
'append' => '',
|
1790 |
+
'maxlength' => '',
|
1791 |
+
),
|
1792 |
+
array(
|
1793 |
+
'key' => 'field_acfe_dpt_has_archive',
|
1794 |
+
'label' => 'Has archive',
|
1795 |
+
'name' => 'has_archive',
|
1796 |
+
'type' => 'true_false',
|
1797 |
+
'instructions' => 'Enables post type archives.',
|
1798 |
+
'required' => 0,
|
1799 |
+
'conditional_logic' => 0,
|
1800 |
+
'wrapper' => array(
|
1801 |
+
'width' => '',
|
1802 |
+
'class' => '',
|
1803 |
+
'id' => '',
|
1804 |
+
),
|
1805 |
+
'acfe_validate' => '',
|
1806 |
+
'acfe_update' => '',
|
1807 |
+
'acfe_permissions' => '',
|
1808 |
+
'message' => '',
|
1809 |
+
'default_value' => 1,
|
1810 |
+
'ui' => 1,
|
1811 |
+
'ui_on_text' => '',
|
1812 |
+
'ui_off_text' => '',
|
1813 |
+
),
|
1814 |
+
array(
|
1815 |
+
'key' => 'field_acfe_dpt_has_archive_slug',
|
1816 |
+
'label' => 'Slug',
|
1817 |
+
'name' => 'has_archive_slug',
|
1818 |
+
'type' => 'text',
|
1819 |
+
'instructions' => 'Will use post type name as archive slug by default.',
|
1820 |
+
'required' => 0,
|
1821 |
+
'conditional_logic' => array(
|
1822 |
+
array(
|
1823 |
+
array(
|
1824 |
+
'field' => 'field_acfe_dpt_has_archive',
|
1825 |
+
'operator' => '==',
|
1826 |
+
'value' => '1',
|
1827 |
+
),
|
1828 |
+
),
|
1829 |
+
),
|
1830 |
+
'wrapper' => array(
|
1831 |
+
'width' => '',
|
1832 |
+
'class' => '',
|
1833 |
+
'id' => '',
|
1834 |
+
),
|
1835 |
+
'acfe_validate' => '',
|
1836 |
+
'acfe_update' => array(
|
1837 |
+
'5c94746ae2fb0' => array(
|
1838 |
+
'acfe_update_function' => 'sanitize_title',
|
1839 |
+
),
|
1840 |
+
),
|
1841 |
+
'acfe_permissions' => '',
|
1842 |
+
'default_value' => '',
|
1843 |
+
'placeholder' => 'Default',
|
1844 |
+
'prepend' => '',
|
1845 |
+
'append' => '',
|
1846 |
+
'maxlength' => '',
|
1847 |
+
),
|
1848 |
+
array(
|
1849 |
+
'key' => 'field_acfe_dpt_archive_posts_per_page',
|
1850 |
+
'label' => 'Posts per page',
|
1851 |
+
'name' => 'acfe_dpt_archive_posts_per_page',
|
1852 |
+
'type' => 'number',
|
1853 |
+
'instructions' => 'ACF Extended: Number of posts to display in the archive page',
|
1854 |
+
'required' => 0,
|
1855 |
+
'conditional_logic' => 0,
|
1856 |
+
'wrapper' => array(
|
1857 |
+
'width' => '',
|
1858 |
+
'class' => '',
|
1859 |
+
'id' => '',
|
1860 |
+
),
|
1861 |
+
'acfe_validate' => '',
|
1862 |
+
'acfe_update' => '',
|
1863 |
+
'acfe_permissions' => '',
|
1864 |
+
'default_value' => 10,
|
1865 |
+
'placeholder' => '',
|
1866 |
+
'prepend' => '',
|
1867 |
+
'append' => '',
|
1868 |
+
'min' => -1,
|
1869 |
+
'max' => '',
|
1870 |
+
'step' => '',
|
1871 |
+
),
|
1872 |
+
array(
|
1873 |
+
'key' => 'field_acfe_dpt_archive_orderby',
|
1874 |
+
'label' => 'Order by',
|
1875 |
+
'name' => 'acfe_dpt_archive_orderby',
|
1876 |
+
'type' => 'text',
|
1877 |
+
'instructions' => 'ACF Extended: Sort retrieved posts by parameter in the archive page. Defaults to \'date (post_date)\'.',
|
1878 |
+
'required' => 0,
|
1879 |
+
'conditional_logic' => 0,
|
1880 |
+
'wrapper' => array(
|
1881 |
+
'width' => '',
|
1882 |
+
'class' => '',
|
1883 |
+
'id' => '',
|
1884 |
+
),
|
1885 |
+
'acfe_validate' => '',
|
1886 |
+
'acfe_update' => array(
|
1887 |
+
'5c9479dec93c4' => array(
|
1888 |
+
'acfe_update_function' => 'sanitize_title',
|
1889 |
+
),
|
1890 |
+
),
|
1891 |
+
'acfe_permissions' => '',
|
1892 |
+
'default_value' => 'date',
|
1893 |
+
'placeholder' => '',
|
1894 |
+
'prepend' => '',
|
1895 |
+
'append' => '',
|
1896 |
+
'maxlength' => '',
|
1897 |
+
),
|
1898 |
+
array(
|
1899 |
+
'key' => 'field_acfe_dpt_archive_order',
|
1900 |
+
'label' => 'Order',
|
1901 |
+
'name' => 'acfe_dpt_archive_order',
|
1902 |
+
'type' => 'select',
|
1903 |
+
'instructions' => 'ACF Extended: Designates the ascending or descending order of the \'orderby\' parameter in the archive page. Defaults to \'DESC\'.',
|
1904 |
+
'required' => 0,
|
1905 |
+
'conditional_logic' => 0,
|
1906 |
+
'wrapper' => array(
|
1907 |
+
'width' => '',
|
1908 |
+
'class' => '',
|
1909 |
+
'id' => '',
|
1910 |
+
),
|
1911 |
+
'acfe_validate' => '',
|
1912 |
+
'acfe_update' => '',
|
1913 |
+
'acfe_permissions' => '',
|
1914 |
+
'choices' => array(
|
1915 |
+
'ASC' => 'ASC',
|
1916 |
+
'DESC' => 'DESC',
|
1917 |
+
),
|
1918 |
+
'default_value' => array(
|
1919 |
+
0 => 'DESC',
|
1920 |
+
),
|
1921 |
+
'allow_null' => 0,
|
1922 |
+
'multiple' => 0,
|
1923 |
+
'ui' => 0,
|
1924 |
+
'return_format' => 'value',
|
1925 |
+
'ajax' => 0,
|
1926 |
+
'placeholder' => '',
|
1927 |
+
),
|
1928 |
+
array(
|
1929 |
+
'key' => 'field_acfe_dpt_tab_single',
|
1930 |
+
'label' => 'Single',
|
1931 |
+
'name' => '',
|
1932 |
+
'type' => 'tab',
|
1933 |
+
'instructions' => '',
|
1934 |
+
'required' => 0,
|
1935 |
+
'conditional_logic' => 0,
|
1936 |
+
'wrapper' => array(
|
1937 |
+
'width' => '',
|
1938 |
+
'class' => '',
|
1939 |
+
'id' => '',
|
1940 |
+
),
|
1941 |
+
'acfe_permissions' => '',
|
1942 |
+
'placement' => 'top',
|
1943 |
+
'endpoint' => 0,
|
1944 |
+
),
|
1945 |
+
array(
|
1946 |
+
'key' => 'field_acfe_dpt_single_template',
|
1947 |
+
'label' => 'Template',
|
1948 |
+
'name' => 'acfe_dpt_single_template',
|
1949 |
+
'type' => 'text',
|
1950 |
+
'instructions' => 'ACF Extended: Which template file to load for the archive query. More informations on <a href="https://developer.wordpress.org/themes/basics/template-hierarchy/">Template hierarchy</a>',
|
1951 |
+
'required' => 0,
|
1952 |
+
'conditional_logic' => 0,
|
1953 |
+
'wrapper' => array(
|
1954 |
+
'width' => '',
|
1955 |
+
'class' => '',
|
1956 |
+
'id' => '',
|
1957 |
+
),
|
1958 |
+
'acfe_validate' => '',
|
1959 |
+
'acfe_update' => '',
|
1960 |
+
'acfe_permissions' => '',
|
1961 |
+
'default_value' => '',
|
1962 |
+
'placeholder' => 'my-template.php',
|
1963 |
+
'prepend' => str_replace(home_url(), '', ACFE_THEME_URL) . '/',
|
1964 |
+
'append' => '',
|
1965 |
+
'maxlength' => '',
|
1966 |
+
),
|
1967 |
+
array(
|
1968 |
+
'key' => 'field_acfe_dpt_rewrite',
|
1969 |
+
'label' => 'Rewrite',
|
1970 |
+
'name' => 'rewrite',
|
1971 |
+
'type' => 'true_false',
|
1972 |
+
'instructions' => 'Triggers the handling of rewrites for this post type. To prevent rewrites, set to false.',
|
1973 |
+
'required' => 0,
|
1974 |
+
'conditional_logic' => 0,
|
1975 |
+
'wrapper' => array(
|
1976 |
+
'width' => '',
|
1977 |
+
'class' => '',
|
1978 |
+
'id' => '',
|
1979 |
+
),
|
1980 |
+
'acfe_validate' => '',
|
1981 |
+
'acfe_update' => '',
|
1982 |
+
'acfe_permissions' => '',
|
1983 |
+
'message' => '',
|
1984 |
+
'default_value' => 1,
|
1985 |
+
'ui' => 1,
|
1986 |
+
'ui_on_text' => '',
|
1987 |
+
'ui_off_text' => '',
|
1988 |
+
),
|
1989 |
+
array(
|
1990 |
+
'key' => 'field_acfe_dpt_rewrite_args_select',
|
1991 |
+
'label' => 'Rewrite Arguments',
|
1992 |
+
'name' => 'rewrite_args_select',
|
1993 |
+
'type' => 'true_false',
|
1994 |
+
'instructions' => 'Use additional rewrite arguments',
|
1995 |
+
'required' => 0,
|
1996 |
+
'conditional_logic' => array(
|
1997 |
+
array(
|
1998 |
+
array(
|
1999 |
+
'field' => 'field_acfe_dpt_rewrite',
|
2000 |
+
'operator' => '==',
|
2001 |
+
'value' => '1',
|
2002 |
+
),
|
2003 |
+
),
|
2004 |
+
),
|
2005 |
+
'wrapper' => array(
|
2006 |
+
'width' => '',
|
2007 |
+
'class' => '',
|
2008 |
+
'id' => '',
|
2009 |
+
),
|
2010 |
+
'acfe_validate' => '',
|
2011 |
+
'acfe_update' => '',
|
2012 |
+
'acfe_permissions' => '',
|
2013 |
+
'message' => '',
|
2014 |
+
'default_value' => 0,
|
2015 |
+
'ui' => 1,
|
2016 |
+
'ui_on_text' => '',
|
2017 |
+
'ui_off_text' => '',
|
2018 |
+
),
|
2019 |
+
array(
|
2020 |
+
'key' => 'field_acfe_dpt_rewrite_args',
|
2021 |
+
'label' => 'Rewrite Arguments',
|
2022 |
+
'name' => 'rewrite_args',
|
2023 |
+
'type' => 'group',
|
2024 |
+
'instructions' => 'Additional arguments',
|
2025 |
+
'required' => 0,
|
2026 |
+
'conditional_logic' => array(
|
2027 |
+
array(
|
2028 |
+
array(
|
2029 |
+
'field' => 'field_acfe_dpt_rewrite',
|
2030 |
+
'operator' => '==',
|
2031 |
+
'value' => '1',
|
2032 |
+
),
|
2033 |
+
array(
|
2034 |
+
'field' => 'field_acfe_dpt_rewrite_args_select',
|
2035 |
+
'operator' => '==',
|
2036 |
+
'value' => '1',
|
2037 |
+
),
|
2038 |
+
),
|
2039 |
+
),
|
2040 |
+
'wrapper' => array(
|
2041 |
+
'width' => '',
|
2042 |
+
'class' => '',
|
2043 |
+
'id' => '',
|
2044 |
+
),
|
2045 |
+
'acfe_validate' => '',
|
2046 |
+
'acfe_update' => '',
|
2047 |
+
'acfe_permissions' => '',
|
2048 |
+
'layout' => 'row',
|
2049 |
+
'sub_fields' => array(
|
2050 |
+
array(
|
2051 |
+
'key' => 'field_acfe_dpt_rewrite_slug',
|
2052 |
+
'label' => 'Slug',
|
2053 |
+
'name' => 'acfe_dpt_rewrite_slug',
|
2054 |
+
'type' => 'text',
|
2055 |
+
'instructions' => 'Customize the permalink structure slug. Defaults to the post type name value. Should be translatable.',
|
2056 |
+
'required' => 0,
|
2057 |
+
'conditional_logic' => array(
|
2058 |
+
array(
|
2059 |
+
array(
|
2060 |
+
'field' => 'field_acfe_dpt_rewrite_args_select',
|
2061 |
+
'operator' => '==',
|
2062 |
+
'value' => '1',
|
2063 |
+
),
|
2064 |
+
),
|
2065 |
+
),
|
2066 |
+
'wrapper' => array(
|
2067 |
+
'width' => '',
|
2068 |
+
'class' => '',
|
2069 |
+
'id' => '',
|
2070 |
+
),
|
2071 |
+
'acfe_validate' => '',
|
2072 |
+
'acfe_update' => array(
|
2073 |
+
'5c94746ae2fb0' => array(
|
2074 |
+
'acfe_update_function' => 'sanitize_title',
|
2075 |
+
),
|
2076 |
+
),
|
2077 |
+
'acfe_permissions' => '',
|
2078 |
+
'default_value' => '',
|
2079 |
+
'placeholder' => 'Default',
|
2080 |
+
'prepend' => '',
|
2081 |
+
'append' => '',
|
2082 |
+
'maxlength' => '',
|
2083 |
+
),
|
2084 |
+
array(
|
2085 |
+
'key' => 'field_acfe_dpt_rewrite_with_front',
|
2086 |
+
'label' => 'With front',
|
2087 |
+
'name' => 'acfe_dpt_rewrite_with_front',
|
2088 |
+
'type' => 'true_false',
|
2089 |
+
'instructions' => 'Should the permalink structure be prepended with the front base. (example: if your permalink structure is /blog/, then your links will be: false->/news/, true->/blog/news/). Defaults to true.',
|
2090 |
+
'required' => 0,
|
2091 |
+
'conditional_logic' => array(
|
2092 |
+
array(
|
2093 |
+
array(
|
2094 |
+
'field' => 'field_acfe_dpt_rewrite_args_select',
|
2095 |
+
'operator' => '==',
|
2096 |
+
'value' => '1',
|
2097 |
+
),
|
2098 |
+
),
|
2099 |
+
),
|
2100 |
+
'wrapper' => array(
|
2101 |
+
'width' => '',
|
2102 |
+
'class' => '',
|
2103 |
+
'id' => '',
|
2104 |
+
),
|
2105 |
+
'acfe_validate' => '',
|
2106 |
+
'acfe_update' => '',
|
2107 |
+
'acfe_permissions' => '',
|
2108 |
+
'message' => '',
|
2109 |
+
'default_value' => 1,
|
2110 |
+
'ui' => 1,
|
2111 |
+
'ui_on_text' => '',
|
2112 |
+
'ui_off_text' => '',
|
2113 |
+
),
|
2114 |
+
array(
|
2115 |
+
'key' => 'field_acfe_dpt_rewrite_feeds',
|
2116 |
+
'label' => 'Feeds',
|
2117 |
+
'name' => 'feeds',
|
2118 |
+
'type' => 'true_false',
|
2119 |
+
'instructions' => 'Should a feed permalink structure be built for this post type. Defaults to has_archive value.',
|
2120 |
+
'required' => 0,
|
2121 |
+
'conditional_logic' => array(
|
2122 |
+
array(
|
2123 |
+
array(
|
2124 |
+
'field' => 'field_acfe_dpt_rewrite_args_select',
|
2125 |
+
'operator' => '==',
|
2126 |
+
'value' => '1',
|
2127 |
+
),
|
2128 |
+
),
|
2129 |
+
),
|
2130 |
+
'wrapper' => array(
|
2131 |
+
'width' => '',
|
2132 |
+
'class' => '',
|
2133 |
+
'id' => '',
|
2134 |
+
),
|
2135 |
+
'acfe_validate' => '',
|
2136 |
+
'acfe_update' => '',
|
2137 |
+
'acfe_permissions' => '',
|
2138 |
+
'message' => '',
|
2139 |
+
'default_value' => 1,
|
2140 |
+
'ui' => 1,
|
2141 |
+
'ui_on_text' => '',
|
2142 |
+
'ui_off_text' => '',
|
2143 |
+
),
|
2144 |
+
array(
|
2145 |
+
'key' => 'field_acfe_dpt_rewrite_pages',
|
2146 |
+
'label' => 'Pages',
|
2147 |
+
'name' => 'pages',
|
2148 |
+
'type' => 'true_false',
|
2149 |
+
'instructions' => 'Should the permalink structure provide for pagination. Defaults to true.',
|
2150 |
+
'required' => 0,
|
2151 |
+
'conditional_logic' => array(
|
2152 |
+
array(
|
2153 |
+
array(
|
2154 |
+
'field' => 'field_acfe_dpt_rewrite_args_select',
|
2155 |
+
'operator' => '==',
|
2156 |
+
'value' => '1',
|
2157 |
+
),
|
2158 |
+
),
|
2159 |
+
),
|
2160 |
+
'wrapper' => array(
|
2161 |
+
'width' => '',
|
2162 |
+
'class' => '',
|
2163 |
+
'id' => '',
|
2164 |
+
),
|
2165 |
+
'acfe_validate' => '',
|
2166 |
+
'acfe_update' => '',
|
2167 |
+
'acfe_permissions' => '',
|
2168 |
+
'message' => '',
|
2169 |
+
'default_value' => 1,
|
2170 |
+
'ui' => 1,
|
2171 |
+
'ui_on_text' => '',
|
2172 |
+
'ui_off_text' => '',
|
2173 |
+
),
|
2174 |
+
),
|
2175 |
+
),
|
2176 |
+
array(
|
2177 |
+
'key' => 'field_acfe_dpt_tab_admin',
|
2178 |
+
'label' => 'Admin',
|
2179 |
+
'name' => '',
|
2180 |
+
'type' => 'tab',
|
2181 |
+
'instructions' => '',
|
2182 |
+
'required' => 0,
|
2183 |
+
'conditional_logic' => 0,
|
2184 |
+
'wrapper' => array(
|
2185 |
+
'width' => '',
|
2186 |
+
'class' => '',
|
2187 |
+
'id' => '',
|
2188 |
+
),
|
2189 |
+
'acfe_permissions' => '',
|
2190 |
+
'placement' => 'top',
|
2191 |
+
'endpoint' => 0,
|
2192 |
+
),
|
2193 |
+
array(
|
2194 |
+
'key' => 'field_acfe_dpt_admin_posts_per_page',
|
2195 |
+
'label' => 'Posts per page',
|
2196 |
+
'name' => 'acfe_dpt_admin_posts_per_page',
|
2197 |
+
'type' => 'number',
|
2198 |
+
'instructions' => 'ACF Extended: Number of posts to display on the admin list screen',
|
2199 |
+
'required' => 0,
|
2200 |
+
'conditional_logic' => 0,
|
2201 |
+
'wrapper' => array(
|
2202 |
+
'width' => '',
|
2203 |
+
'class' => '',
|
2204 |
+
'id' => '',
|
2205 |
+
),
|
2206 |
+
'acfe_validate' => '',
|
2207 |
+
'acfe_update' => '',
|
2208 |
+
'acfe_permissions' => '',
|
2209 |
+
'default_value' => 10,
|
2210 |
+
'placeholder' => '',
|
2211 |
+
'prepend' => '',
|
2212 |
+
'append' => '',
|
2213 |
+
'min' => -1,
|
2214 |
+
'max' => '',
|
2215 |
+
'step' => '',
|
2216 |
+
),
|
2217 |
+
array(
|
2218 |
+
'key' => 'field_acfe_dpt_admin_orderby',
|
2219 |
+
'label' => 'Order by',
|
2220 |
+
'name' => 'acfe_dpt_admin_orderby',
|
2221 |
+
'type' => 'text',
|
2222 |
+
'instructions' => 'ACF Extended: Sort retrieved posts by parameter in the admin list screen. Defaults to \'date (post_date)\'.',
|
2223 |
+
'required' => 0,
|
2224 |
+
'conditional_logic' => 0,
|
2225 |
+
'wrapper' => array(
|
2226 |
+
'width' => '',
|
2227 |
+
'class' => '',
|
2228 |
+
'id' => '',
|
2229 |
+
),
|
2230 |
+
'acfe_validate' => '',
|
2231 |
+
'acfe_update' => array(
|
2232 |
+
'5c9479dec93c4' => array(
|
2233 |
+
'acfe_update_function' => 'sanitize_title',
|
2234 |
+
),
|
2235 |
+
),
|
2236 |
+
'acfe_permissions' => '',
|
2237 |
+
'default_value' => 'date',
|
2238 |
+
'placeholder' => '',
|
2239 |
+
'prepend' => '',
|
2240 |
+
'append' => '',
|
2241 |
+
'maxlength' => '',
|
2242 |
+
),
|
2243 |
+
array(
|
2244 |
+
'key' => 'field_acfe_dpt_admin_order',
|
2245 |
+
'label' => 'Order',
|
2246 |
+
'name' => 'acfe_dpt_admin_order',
|
2247 |
+
'type' => 'select',
|
2248 |
+
'instructions' => 'ACF Extended: Designates the ascending or descending order of the \'orderby\' parameter in the admin list screen. Defaults to \'DESC\'.',
|
2249 |
+
'required' => 0,
|
2250 |
+
'conditional_logic' => 0,
|
2251 |
+
'wrapper' => array(
|
2252 |
+
'width' => '',
|
2253 |
+
'class' => '',
|
2254 |
+
'id' => '',
|
2255 |
+
),
|
2256 |
+
'acfe_validate' => '',
|
2257 |
+
'acfe_update' => '',
|
2258 |
+
'acfe_permissions' => '',
|
2259 |
+
'choices' => array(
|
2260 |
+
'ASC' => 'ASC',
|
2261 |
+
'DESC' => 'DESC',
|
2262 |
+
),
|
2263 |
+
'default_value' => array(
|
2264 |
+
0 => 'DESC',
|
2265 |
+
),
|
2266 |
+
'allow_null' => 0,
|
2267 |
+
'multiple' => 0,
|
2268 |
+
'ui' => 0,
|
2269 |
+
'return_format' => 'value',
|
2270 |
+
'ajax' => 0,
|
2271 |
+
'placeholder' => '',
|
2272 |
+
),
|
2273 |
+
array(
|
2274 |
+
'key' => 'field_acfe_dpt_tab_rest',
|
2275 |
+
'label' => 'REST',
|
2276 |
+
'name' => '',
|
2277 |
+
'type' => 'tab',
|
2278 |
+
'instructions' => '',
|
2279 |
+
'required' => 0,
|
2280 |
+
'conditional_logic' => 0,
|
2281 |
+
'wrapper' => array(
|
2282 |
+
'width' => '',
|
2283 |
+
'class' => '',
|
2284 |
+
'id' => '',
|
2285 |
+
),
|
2286 |
+
'acfe_permissions' => '',
|
2287 |
+
'placement' => 'top',
|
2288 |
+
'endpoint' => 0,
|
2289 |
+
),
|
2290 |
+
array(
|
2291 |
+
'key' => 'field_acfe_dpt_show_in_rest',
|
2292 |
+
'label' => 'Show in rest',
|
2293 |
+
'name' => 'show_in_rest',
|
2294 |
+
'type' => 'true_false',
|
2295 |
+
'instructions' => 'Whether to expose this post type in the REST API',
|
2296 |
+
'required' => 0,
|
2297 |
+
'conditional_logic' => 0,
|
2298 |
+
'wrapper' => array(
|
2299 |
+
'width' => '',
|
2300 |
+
'class' => '',
|
2301 |
+
'id' => '',
|
2302 |
+
),
|
2303 |
+
'acfe_validate' => '',
|
2304 |
+
'acfe_update' => '',
|
2305 |
+
'acfe_permissions' => '',
|
2306 |
+
'message' => '',
|
2307 |
+
'default_value' => 0,
|
2308 |
+
'ui' => 1,
|
2309 |
+
'ui_on_text' => '',
|
2310 |
+
'ui_off_text' => '',
|
2311 |
+
),
|
2312 |
+
array(
|
2313 |
+
'key' => 'field_acfe_dpt_rest_base',
|
2314 |
+
'label' => 'Rest base',
|
2315 |
+
'name' => 'rest_base',
|
2316 |
+
'type' => 'text',
|
2317 |
+
'instructions' => 'The base slug that this post type will use when accessed using the REST API',
|
2318 |
+
'required' => 0,
|
2319 |
+
'conditional_logic' => 0,
|
2320 |
+
'wrapper' => array(
|
2321 |
+
'width' => '',
|
2322 |
+
'class' => '',
|
2323 |
+
'id' => '',
|
2324 |
+
),
|
2325 |
+
'acfe_validate' => '',
|
2326 |
+
'acfe_update' => '',
|
2327 |
+
'acfe_permissions' => '',
|
2328 |
+
'default_value' => '',
|
2329 |
+
'placeholder' => '',
|
2330 |
+
'prepend' => '',
|
2331 |
+
'append' => '',
|
2332 |
+
'maxlength' => '',
|
2333 |
+
),
|
2334 |
+
array(
|
2335 |
+
'key' => 'field_acfe_dpt_rest_controller_class',
|
2336 |
+
'label' => 'Rest controller class',
|
2337 |
+
'name' => 'rest_controller_class',
|
2338 |
+
'type' => 'text',
|
2339 |
+
'instructions' => 'An optional custom controller to use instead of WP_REST_Posts_Controller. Must be a subclass of WP_REST_Controller',
|
2340 |
+
'required' => 0,
|
2341 |
+
'conditional_logic' => 0,
|
2342 |
+
'wrapper' => array(
|
2343 |
+
'width' => '',
|
2344 |
+
'class' => '',
|
2345 |
+
'id' => '',
|
2346 |
+
),
|
2347 |
+
'acfe_validate' => '',
|
2348 |
+
'acfe_update' => '',
|
2349 |
+
'acfe_permissions' => '',
|
2350 |
+
'default_value' => 'WP_REST_Posts_Controller',
|
2351 |
+
'placeholder' => '',
|
2352 |
+
'prepend' => '',
|
2353 |
+
'append' => '',
|
2354 |
+
'maxlength' => '',
|
2355 |
+
),
|
2356 |
+
),
|
2357 |
+
));
|
2358 |
+
|
2359 |
+
}
|
includes/modules/dynamic-taxonomy.php
ADDED
@@ -0,0 +1,1719 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if(!defined('ABSPATH'))
|
4 |
+
exit;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Register Dynamic Taxonomy
|
8 |
+
*/
|
9 |
+
add_action('init', 'acfe_dt_register');
|
10 |
+
function acfe_dt_register(){
|
11 |
+
|
12 |
+
register_post_type('acfe-dt', array(
|
13 |
+
'label' => 'Taxonomies',
|
14 |
+
'description' => 'Taxonomies',
|
15 |
+
'labels' => array(
|
16 |
+
'name' => 'Taxonomies',
|
17 |
+
'singular_name' => 'Taxonomy',
|
18 |
+
'menu_name' => 'Taxonomies',
|
19 |
+
),
|
20 |
+
'supports' => array('custom-fields'),
|
21 |
+
'hierarchical' => false,
|
22 |
+
'public' => false,
|
23 |
+
//'show_ui' => true,
|
24 |
+
'show_ui' => 'ACFE', // Hack to show_ui, but do not list in get_post_types() ie: ACF field group location
|
25 |
+
'show_in_menu' => 'tools.php',
|
26 |
+
'menu_icon' => 'dashicons-layout',
|
27 |
+
'show_in_admin_bar' => false,
|
28 |
+
'show_in_nav_menus' => false,
|
29 |
+
'can_export' => false,
|
30 |
+
'has_archive' => false,
|
31 |
+
'rewrite' => false,
|
32 |
+
'exclude_from_search' => true,
|
33 |
+
'publicly_queryable' => false,
|
34 |
+
'capability_type' => 'page',
|
35 |
+
));
|
36 |
+
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* WP Register Taxonomies
|
41 |
+
*/
|
42 |
+
add_action('init', 'acfe_dt_registers');
|
43 |
+
function acfe_dt_registers(){
|
44 |
+
|
45 |
+
$dynamic_taxonomies = get_option('acfe_dynamic_taxonomies', array());
|
46 |
+
if(empty($dynamic_taxonomies))
|
47 |
+
return;
|
48 |
+
|
49 |
+
foreach($dynamic_taxonomies as $name => $register_args){
|
50 |
+
|
51 |
+
// Extract 'post_types' from 'register_args'
|
52 |
+
$post_types = acf_extract_var($register_args, 'post_types', array());
|
53 |
+
|
54 |
+
// Register: Execute
|
55 |
+
register_taxonomy($name, $post_types, $register_args);
|
56 |
+
|
57 |
+
// Filter Admin: Posts Per Page
|
58 |
+
add_filter('edit_' . $name . '_per_page', 'acfe_dt_filter_admin_ppp');
|
59 |
+
|
60 |
+
}
|
61 |
+
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Dynamic Taxonomy Save
|
66 |
+
*/
|
67 |
+
add_action('acf/save_post', 'acfe_dt_filter_save', 20);
|
68 |
+
function acfe_dt_filter_save($post_id){
|
69 |
+
|
70 |
+
if(get_post_type($post_id) != 'acfe-dt')
|
71 |
+
return;
|
72 |
+
|
73 |
+
$title = get_field('label', $post_id);
|
74 |
+
$name = get_field('acfe_dt_name', $post_id);
|
75 |
+
|
76 |
+
// Update post
|
77 |
+
wp_update_post(array(
|
78 |
+
'ID' => $post_id,
|
79 |
+
'post_title' => $title,
|
80 |
+
'post_name' => $name,
|
81 |
+
));
|
82 |
+
|
83 |
+
// Register Args
|
84 |
+
$label = get_field('label', $post_id);
|
85 |
+
$description = get_field('description', $post_id);
|
86 |
+
$hierarchical = get_field('hierarchical', $post_id);
|
87 |
+
$post_types = get_field('post_types', $post_id);
|
88 |
+
$public = get_field('public', $post_id);
|
89 |
+
$publicly_queryable = get_field('publicly_queryable', $post_id);
|
90 |
+
$update_count_callback = get_field('update_count_callback', $post_id);
|
91 |
+
$sort = get_field('sort', $post_id);
|
92 |
+
|
93 |
+
// Labels
|
94 |
+
$labels = get_field('labels', $post_id);
|
95 |
+
$labels_args = array();
|
96 |
+
foreach($labels as $k => $l){
|
97 |
+
if(empty($l))
|
98 |
+
continue;
|
99 |
+
|
100 |
+
$labels_args[$k] = $l;
|
101 |
+
}
|
102 |
+
|
103 |
+
// Menu
|
104 |
+
$show_ui = get_field('show_ui', $post_id);
|
105 |
+
$show_in_menu = get_field('show_in_menu', $post_id);
|
106 |
+
$show_in_nav_menus = get_field('show_in_nav_menus', $post_id);
|
107 |
+
$show_tagcloud = get_field('show_tagcloud', $post_id);
|
108 |
+
$show_in_quick_edit = get_field('show_in_quick_edit', $post_id);
|
109 |
+
$show_admin_column = get_field('show_admin_column', $post_id);
|
110 |
+
|
111 |
+
// Capability
|
112 |
+
$capabilities = acf_decode_choices(get_field('capabilities', $post_id), true);
|
113 |
+
|
114 |
+
// Single
|
115 |
+
$single_template = get_field('acfe_dt_single_template', $post_id);
|
116 |
+
$single_posts_per_page = get_field('acfe_dt_single_posts_per_page', $post_id);
|
117 |
+
$single_orderby = get_field('acfe_dt_single_orderby', $post_id);
|
118 |
+
$single_order = get_field('acfe_dt_single_order', $post_id);
|
119 |
+
$rewrite = get_field('rewrite', $post_id);
|
120 |
+
$rewrite_args_select = get_field('rewrite_args_select', $post_id);
|
121 |
+
$rewrite_args = get_field('rewrite_args', $post_id);
|
122 |
+
|
123 |
+
// Admin
|
124 |
+
$admin_posts_per_page = get_field('acfe_dt_admin_terms_per_page', $post_id);
|
125 |
+
$admin_orderby = get_field('acfe_dt_admin_orderby', $post_id);
|
126 |
+
$admin_order = get_field('acfe_dt_admin_order', $post_id);
|
127 |
+
|
128 |
+
// REST
|
129 |
+
$show_in_rest = get_field('show_in_rest', $post_id);
|
130 |
+
$rest_base = get_field('rest_base', $post_id);
|
131 |
+
$rest_controller_class = get_field('rest_controller_class', $post_id);
|
132 |
+
|
133 |
+
// Register: Args
|
134 |
+
$register_args = array(
|
135 |
+
'label' => $label,
|
136 |
+
'description' => $description,
|
137 |
+
'hierarchical' => $hierarchical,
|
138 |
+
'post_types' => $post_types,
|
139 |
+
'public' => $public,
|
140 |
+
'publicly_queryable' => $publicly_queryable,
|
141 |
+
'update_count_callback' => $update_count_callback,
|
142 |
+
'sort' => $sort,
|
143 |
+
|
144 |
+
// Labels
|
145 |
+
'labels' => $labels_args,
|
146 |
+
|
147 |
+
// Menu
|
148 |
+
'show_ui' => $show_ui,
|
149 |
+
'show_in_menu' => $show_in_menu,
|
150 |
+
'show_in_nav_menus' => $show_in_nav_menus,
|
151 |
+
'show_tagcloud' => $show_tagcloud,
|
152 |
+
'show_in_quick_edit' => $show_in_quick_edit,
|
153 |
+
'show_admin_column' => $show_admin_column,
|
154 |
+
|
155 |
+
// Single
|
156 |
+
'rewrite' => $rewrite,
|
157 |
+
|
158 |
+
// REST
|
159 |
+
'show_in_rest' => $show_in_rest,
|
160 |
+
'rest_base' => $rest_base,
|
161 |
+
'rest_controller_class' => $rest_controller_class,
|
162 |
+
|
163 |
+
// ACFE: Single
|
164 |
+
'acfe_single_template' => $single_template,
|
165 |
+
'acfe_single_ppp' => $single_posts_per_page,
|
166 |
+
'acfe_single_orderby' => $single_orderby,
|
167 |
+
'acfe_single_order' => $single_order,
|
168 |
+
|
169 |
+
// ACFE: Admin
|
170 |
+
'acfe_admin_ppp' => $admin_posts_per_page,
|
171 |
+
'acfe_admin_orderby' => $admin_orderby,
|
172 |
+
'acfe_admin_order' => $admin_order,
|
173 |
+
);
|
174 |
+
|
175 |
+
// Rewrite: override
|
176 |
+
if($rewrite && $rewrite_args_select){
|
177 |
+
$register_args['rewrite'] = array(
|
178 |
+
'slug' => $rewrite_args['acfe_dt_rewrite_slug'],
|
179 |
+
'with_front' => $rewrite_args['acfe_dt_rewrite_with_front'],
|
180 |
+
'hierarchical' => $rewrite_args['hierarchical']
|
181 |
+
);
|
182 |
+
}
|
183 |
+
|
184 |
+
// Capabilities
|
185 |
+
if(!empty($capabilities))
|
186 |
+
$register_args['capabilities'] = $capabilities;
|
187 |
+
|
188 |
+
// Get ACFE option
|
189 |
+
$option = get_option('acfe_dynamic_taxonomies', array());
|
190 |
+
|
191 |
+
// Create ACFE option
|
192 |
+
$option[$name] = $register_args;
|
193 |
+
|
194 |
+
// Update ACFE option
|
195 |
+
update_option('acfe_dynamic_taxonomies', $option);
|
196 |
+
|
197 |
+
// Flush permalinks
|
198 |
+
flush_rewrite_rules();
|
199 |
+
|
200 |
+
}
|
201 |
+
|
202 |
+
/**
|
203 |
+
* Filter Admin: List
|
204 |
+
*/
|
205 |
+
add_filter('get_terms_args', 'acfe_dt_filter_admin_list', 10, 2);
|
206 |
+
function acfe_dt_filter_admin_list($args, $taxonomies){
|
207 |
+
|
208 |
+
if(!is_admin())
|
209 |
+
return;
|
210 |
+
|
211 |
+
global $pagenow;
|
212 |
+
if($pagenow != 'edit-tags.php')
|
213 |
+
return $args;
|
214 |
+
|
215 |
+
if(empty($taxonomies))
|
216 |
+
return $args;
|
217 |
+
|
218 |
+
$taxonomy = array_shift($taxonomies);
|
219 |
+
$taxonomy_obj = get_taxonomy($taxonomy);
|
220 |
+
|
221 |
+
$acfe_admin_orderby = (isset($taxonomy_obj->acfe_admin_orderby) && !empty($taxonomy_obj->acfe_admin_orderby));
|
222 |
+
$acfe_admin_order = (isset($taxonomy_obj->acfe_admin_order) && !empty($taxonomy_obj->acfe_admin_order));
|
223 |
+
|
224 |
+
if($acfe_admin_orderby)
|
225 |
+
$args['orderby'] = $taxonomy_obj->acfe_admin_orderby;
|
226 |
+
|
227 |
+
if($acfe_admin_order)
|
228 |
+
$args['order'] = $taxonomy_obj->acfe_admin_order;
|
229 |
+
|
230 |
+
return $args;
|
231 |
+
|
232 |
+
}
|
233 |
+
|
234 |
+
/**
|
235 |
+
* Filter Admin: Posts Per Page
|
236 |
+
* See acfe_dt_registers()
|
237 |
+
*/
|
238 |
+
function acfe_dt_filter_admin_ppp($ppp){
|
239 |
+
|
240 |
+
global $pagenow;
|
241 |
+
if($pagenow != 'edit-tags.php')
|
242 |
+
return $ppp;
|
243 |
+
|
244 |
+
$taxonomy = $_GET['taxonomy'];
|
245 |
+
if(empty($taxonomy))
|
246 |
+
return $ppp;
|
247 |
+
|
248 |
+
$taxonomy_obj = get_taxonomy($taxonomy);
|
249 |
+
if(!isset($taxonomy_obj->acfe_admin_ppp) || empty($taxonomy_obj->acfe_admin_ppp))
|
250 |
+
return $ppp;
|
251 |
+
|
252 |
+
return $taxonomy_obj->acfe_admin_ppp;
|
253 |
+
|
254 |
+
}
|
255 |
+
|
256 |
+
/**
|
257 |
+
* Filter Front: List + Posts Per Page
|
258 |
+
*/
|
259 |
+
add_action('pre_get_posts', 'acfe_dt_filter_front_list');
|
260 |
+
function acfe_dt_filter_front_list($query){
|
261 |
+
|
262 |
+
if(is_admin() || !$query->is_main_query() || !is_tax())
|
263 |
+
return;
|
264 |
+
|
265 |
+
$taxonomy = $query->get('taxonomy');
|
266 |
+
$taxonomy_obj = get_taxonomy($taxonomy);
|
267 |
+
|
268 |
+
$acfe_single_ppp = (isset($post_type_obj->acfe_single_ppp) && !empty($post_type_obj->acfe_single_ppp));
|
269 |
+
$acfe_single_orderby = (isset($post_type_obj->acfe_single_orderby) && !empty($post_type_obj->acfe_single_orderby));
|
270 |
+
$acfe_single_order = (isset($post_type_obj->acfe_single_order) && !empty($post_type_obj->acfe_single_order));
|
271 |
+
|
272 |
+
if($acfe_single_ppp){
|
273 |
+
$query->set('posts_per_page', $post_type_obj->acfe_single_ppp);
|
274 |
+
$query->query['posts_per_page'] = $post_type_obj->acfe_single_ppp;
|
275 |
+
}
|
276 |
+
|
277 |
+
if($acfe_single_orderby){
|
278 |
+
$query->set('orderby', $post_type_obj->acfe_single_orderby);
|
279 |
+
$query->query['orderby'] = $post_type_obj->acfe_single_orderby;
|
280 |
+
}
|
281 |
+
|
282 |
+
if($acfe_single_order){
|
283 |
+
$query->set('order', $post_type_obj->acfe_single_order);
|
284 |
+
$query->query['order'] = $post_type_obj->acfe_single_order;
|
285 |
+
}
|
286 |
+
|
287 |
+
}
|
288 |
+
|
289 |
+
/**
|
290 |
+
* Filter Front: Template
|
291 |
+
*/
|
292 |
+
add_filter('template_include', 'acfe_dt_filter_template', 999);
|
293 |
+
function acfe_dt_filter_template($template){
|
294 |
+
|
295 |
+
if(!is_tax() && !is_category() && !is_tag())
|
296 |
+
return $template;
|
297 |
+
|
298 |
+
if(!isset(get_queried_object()->taxonomy))
|
299 |
+
return $template;
|
300 |
+
|
301 |
+
$taxonomy_obj = get_queried_object()->taxonomy;
|
302 |
+
|
303 |
+
foreach(get_taxonomies(array('public' => true), 'objects') as $taxonomy){
|
304 |
+
if($taxonomy_obj != $taxonomy->name || !isset($taxonomy->acfe_single_template))
|
305 |
+
continue;
|
306 |
+
|
307 |
+
if($locate = locate_template(array($taxonomy->acfe_single_template)))
|
308 |
+
return $locate;
|
309 |
+
}
|
310 |
+
|
311 |
+
return $template;
|
312 |
+
|
313 |
+
}
|
314 |
+
|
315 |
+
/**
|
316 |
+
* Admin List Columns
|
317 |
+
*/
|
318 |
+
add_filter('manage_edit-acfe-dt_columns', 'acfe_dt_admin_columns');
|
319 |
+
function acfe_dt_admin_columns($columns){
|
320 |
+
|
321 |
+
if(isset($columns['date']))
|
322 |
+
unset($columns['date']);
|
323 |
+
|
324 |
+
$columns['acfe-post-types'] = __('Post Types');
|
325 |
+
return $columns;
|
326 |
+
|
327 |
+
}
|
328 |
+
|
329 |
+
/**
|
330 |
+
* Admin List Columns HTML
|
331 |
+
*/
|
332 |
+
add_action('manage_acfe-dt_posts_custom_column', 'acfe_dt_admin_columns_html', 10, 2);
|
333 |
+
function acfe_dt_admin_columns_html($column, $post_id){
|
334 |
+
|
335 |
+
if($column == 'acfe-post-types'){
|
336 |
+
|
337 |
+
$post_types = get_field('post_types', $post_id);
|
338 |
+
|
339 |
+
if(empty($post_types)){
|
340 |
+
echo '—';
|
341 |
+
return;
|
342 |
+
}
|
343 |
+
|
344 |
+
$post_types_names = array();
|
345 |
+
foreach($post_types as $post_type_slug){
|
346 |
+
$post_type_obj = get_post_type_object($post_type_slug);
|
347 |
+
$post_types_names[] = $post_type_obj->label;
|
348 |
+
}
|
349 |
+
|
350 |
+
if(empty($post_types_names)){
|
351 |
+
echo '—';
|
352 |
+
return;
|
353 |
+
}
|
354 |
+
|
355 |
+
echo implode(', ', $post_types_names);
|
356 |
+
|
357 |
+
}
|
358 |
+
|
359 |
+
}
|
360 |
+
|
361 |
+
/**
|
362 |
+
* Admin Validate Name
|
363 |
+
*/
|
364 |
+
add_filter('acf/validate_value/name=acfe_dt_name', 'acfe_dt_admin_validate_name', 10, 4);
|
365 |
+
function acfe_dt_admin_validate_name($valid, $value, $field, $input){
|
366 |
+
|
367 |
+
if(!$valid)
|
368 |
+
return $valid;
|
369 |
+
|
370 |
+
// Reserved taxonomies
|
371 |
+
$excludes = array('acf-field-group-category');
|
372 |
+
if(in_array($value, $excludes))
|
373 |
+
return __('This taxonomy name is reserved');
|
374 |
+
|
375 |
+
// Editing Current Dynamic Taxonomy
|
376 |
+
$current_post_id = $_POST['_acf_post_id'];
|
377 |
+
$current_post_type = false;
|
378 |
+
if(!empty($current_post_id))
|
379 |
+
$current_post_type = get_field('acfe_dt_name', $current_post_id);
|
380 |
+
|
381 |
+
if($value == $current_post_type)
|
382 |
+
return $valid;
|
383 |
+
|
384 |
+
// Listing WP Taxonomies
|
385 |
+
global $wp_taxonomies;
|
386 |
+
if(!empty($wp_taxonomies)){
|
387 |
+
foreach($wp_taxonomies as $taxonomy){
|
388 |
+
if($value != $taxonomy->name)
|
389 |
+
continue;
|
390 |
+
|
391 |
+
$valid = __('This taxonomy name already exists');
|
392 |
+
}
|
393 |
+
}
|
394 |
+
|
395 |
+
return $valid;
|
396 |
+
|
397 |
+
}
|
398 |
+
|
399 |
+
add_action('init', 'acfe_dt_local_field_group');
|
400 |
+
function acfe_dt_local_field_group(){
|
401 |
+
|
402 |
+
acf_add_local_field_group(array(
|
403 |
+
'key' => 'group_acfe_dynamic_taxonomy',
|
404 |
+
'title' => __('Dynamic Taxonomy', 'acfe'),
|
405 |
+
|
406 |
+
'location' => array(
|
407 |
+
array(
|
408 |
+
array(
|
409 |
+
'param' => 'post_type',
|
410 |
+
'operator' => '==',
|
411 |
+
'value' => 'acfe-dt',
|
412 |
+
),
|
413 |
+
),
|
414 |
+
),
|
415 |
+
|
416 |
+
'menu_order' => 0,
|
417 |
+
'position' => 'normal',
|
418 |
+
'style' => 'default',
|
419 |
+
'label_placement' => 'left',
|
420 |
+
'instruction_placement' => 'label',
|
421 |
+
'hide_on_screen' => '',
|
422 |
+
'active' => 1,
|
423 |
+
'description' => '',
|
424 |
+
|
425 |
+
'fields' => array(
|
426 |
+
array(
|
427 |
+
'key' => 'field_acfe_dt_tab_general',
|
428 |
+
'label' => 'General',
|
429 |
+
'name' => '',
|
430 |
+
'type' => 'tab',
|
431 |
+
'instructions' => '',
|
432 |
+
'required' => 0,
|
433 |
+
'conditional_logic' => 0,
|
434 |
+
'wrapper' => array(
|
435 |
+
'width' => '',
|
436 |
+
'class' => '',
|
437 |
+
'id' => '',
|
438 |
+
),
|
439 |
+
'acfe_permissions' => '',
|
440 |
+
'placement' => 'top',
|
441 |
+
'endpoint' => 0,
|
442 |
+
),
|
443 |
+
array(
|
444 |
+
'key' => 'field_acfe_dt_label',
|
445 |
+
'label' => 'Label',
|
446 |
+
'name' => 'label',
|
447 |
+
'type' => 'text',
|
448 |
+
'instructions' => 'A plural descriptive name for the taxonomy marked for translation',
|
449 |
+
'required' => 1,
|
450 |
+
'conditional_logic' => 0,
|
451 |
+
'wrapper' => array(
|
452 |
+
'width' => '',
|
453 |
+
'class' => '',
|
454 |
+
'id' => '',
|
455 |
+
),
|
456 |
+
'acfe_validate' => '',
|
457 |
+
'acfe_update' => '',
|
458 |
+
'acfe_permissions' => '',
|
459 |
+
'default_value' => '',
|
460 |
+
'placeholder' => '',
|
461 |
+
'prepend' => '',
|
462 |
+
'append' => '',
|
463 |
+
'maxlength' => '',
|
464 |
+
),
|
465 |
+
array(
|
466 |
+
'key' => 'field_acfe_dt_name',
|
467 |
+
'label' => 'Name',
|
468 |
+
'name' => 'acfe_dt_name',
|
469 |
+
'type' => 'acfe_slug',
|
470 |
+
'instructions' => 'The name of the taxonomy. Name should only contain lowercase letters and the underscore character, and not be more than 32 characters long (database structure restriction)',
|
471 |
+
'required' => 1,
|
472 |
+
'conditional_logic' => 0,
|
473 |
+
'wrapper' => array(
|
474 |
+
'width' => '',
|
475 |
+
'class' => '',
|
476 |
+
'id' => '',
|
477 |
+
),
|
478 |
+
'acfe_validate' => '',
|
479 |
+
'acfe_update' => '',
|
480 |
+
'acfe_permissions' => '',
|
481 |
+
'default_value' => '',
|
482 |
+
'placeholder' => '',
|
483 |
+
'prepend' => '',
|
484 |
+
'append' => '',
|
485 |
+
'maxlength' => 20,
|
486 |
+
),
|
487 |
+
array(
|
488 |
+
'key' => 'field_acfe_dt_description',
|
489 |
+
'label' => 'Description',
|
490 |
+
'name' => 'description',
|
491 |
+
'type' => 'text',
|
492 |
+
'instructions' => 'Include a description of the taxonomy',
|
493 |
+
'required' => 0,
|
494 |
+
'conditional_logic' => 0,
|
495 |
+
'wrapper' => array(
|
496 |
+
'width' => '',
|
497 |
+
'class' => '',
|
498 |
+
'id' => '',
|
499 |
+
),
|
500 |
+
'acfe_validate' => '',
|
501 |
+
'acfe_update' => '',
|
502 |
+
'acfe_permissions' => '',
|
503 |
+
'default_value' => '',
|
504 |
+
'placeholder' => '',
|
505 |
+
'prepend' => '',
|
506 |
+
'append' => '',
|
507 |
+
'maxlength' => '',
|
508 |
+
),
|
509 |
+
array(
|
510 |
+
'key' => 'field_acfe_dt_hierarchical',
|
511 |
+
'label' => 'Hierarchical',
|
512 |
+
'name' => 'hierarchical',
|
513 |
+
'type' => 'true_false',
|
514 |
+
'instructions' => 'Is this taxonomy hierarchical (have descendants) like categories or not hierarchical like tags',
|
515 |
+
'required' => 0,
|
516 |
+
'conditional_logic' => 0,
|
517 |
+
'wrapper' => array(
|
518 |
+
'width' => '',
|
519 |
+
'class' => '',
|
520 |
+
'id' => '',
|
521 |
+
),
|
522 |
+
'acfe_validate' => '',
|
523 |
+
'acfe_update' => '',
|
524 |
+
'acfe_permissions' => '',
|
525 |
+
'message' => '',
|
526 |
+
'default_value' => 0,
|
527 |
+
'ui' => 1,
|
528 |
+
'ui_on_text' => '',
|
529 |
+
'ui_off_text' => '',
|
530 |
+
),
|
531 |
+
array(
|
532 |
+
'key' => 'field_acfe_dt_post_types',
|
533 |
+
'label' => 'Post types',
|
534 |
+
'name' => 'post_types',
|
535 |
+
'type' => 'acfe_post_types',
|
536 |
+
'instructions' => '',
|
537 |
+
'required' => 0,
|
538 |
+
'conditional_logic' => 0,
|
539 |
+
'wrapper' => array(
|
540 |
+
'width' => '',
|
541 |
+
'class' => '',
|
542 |
+
'id' => '',
|
543 |
+
),
|
544 |
+
'acfe_validate' => '',
|
545 |
+
'acfe_update' => '',
|
546 |
+
'acfe_permissions' => '',
|
547 |
+
'field_type' => 'checkbox',
|
548 |
+
'return_format' => 'name',
|
549 |
+
),
|
550 |
+
array(
|
551 |
+
'key' => 'field_acfe_dt_public',
|
552 |
+
'label' => 'Public',
|
553 |
+
'name' => 'public',
|
554 |
+
'type' => 'true_false',
|
555 |
+
'instructions' => 'Whether a taxonomy is intended for use publicly either via the admin interface or by front-end users',
|
556 |
+
'required' => 0,
|
557 |
+
'conditional_logic' => 0,
|
558 |
+
'wrapper' => array(
|
559 |
+
'width' => '',
|
560 |
+
'class' => '',
|
561 |
+
'id' => '',
|
562 |
+
),
|
563 |
+
'acfe_validate' => '',
|
564 |
+
'acfe_update' => '',
|
565 |
+
'acfe_permissions' => '',
|
566 |
+
'message' => '',
|
567 |
+
'default_value' => 1,
|
568 |
+
'ui' => 1,
|
569 |
+
'ui_on_text' => '',
|
570 |
+
'ui_off_text' => '',
|
571 |
+
),
|
572 |
+
array(
|
573 |
+
'key' => 'field_acfe_dt_publicly_queryable',
|
574 |
+
'label' => 'Publicly queryable',
|
575 |
+
'name' => 'publicly_queryable',
|
576 |
+
'type' => 'true_false',
|
577 |
+
'instructions' => 'Whether the taxonomy is publicly queryable',
|
578 |
+
'required' => 0,
|
579 |
+
'conditional_logic' => 0,
|
580 |
+
'wrapper' => array(
|
581 |
+
'width' => '',
|
582 |
+
'class' => '',
|
583 |
+
'id' => '',
|
584 |
+
),
|
585 |
+
'acfe_validate' => '',
|
586 |
+
'acfe_update' => '',
|
587 |
+
'acfe_permissions' => '',
|
588 |
+
'message' => '',
|
589 |
+
'default_value' => 1,
|
590 |
+
'ui' => 1,
|
591 |
+
'ui_on_text' => '',
|
592 |
+
'ui_off_text' => '',
|
593 |
+
),
|
594 |
+
array(
|
595 |
+
'key' => 'field_acfe_dt_update_count_callback',
|
596 |
+
'label' => 'Update count callback',
|
597 |
+
'name' => 'update_count_callback',
|
598 |
+
'type' => 'text',
|
599 |
+
'instructions' => 'A function name that will be called when the count of an associated $object_type, such as post, is updated',
|
600 |
+
'required' => 0,
|
601 |
+
'conditional_logic' => 0,
|
602 |
+
'wrapper' => array(
|
603 |
+
'width' => '',
|
604 |
+
'class' => '',
|
605 |
+
'id' => '',
|
606 |
+
),
|
607 |
+
'acfe_validate' => '',
|
608 |
+
'acfe_update' => '',
|
609 |
+
'acfe_permissions' => '',
|
610 |
+
'default_value' => '',
|
611 |
+
'placeholder' => '',
|
612 |
+
'prepend' => '',
|
613 |
+
'append' => '',
|
614 |
+
'maxlength' => '',
|
615 |
+
),
|
616 |
+
array(
|
617 |
+
'key' => 'field_acfe_dt_sort',
|
618 |
+
'label' => 'Sort',
|
619 |
+
'name' => 'sort',
|
620 |
+
'type' => 'true_false',
|
621 |
+
'instructions' => 'Whether this taxonomy should remember the order in which terms are added to objects',
|
622 |
+
'required' => 0,
|
623 |
+
'conditional_logic' => 0,
|
624 |
+
'wrapper' => array(
|
625 |
+
'width' => '',
|
626 |
+
'class' => '',
|
627 |
+
'id' => '',
|
628 |
+
),
|
629 |
+
'acfe_validate' => '',
|
630 |
+
'acfe_update' => '',
|
631 |
+
'acfe_permissions' => '',
|
632 |
+
'message' => '',
|
633 |
+
'default_value' => 0,
|
634 |
+
'ui' => 1,
|
635 |
+
'ui_on_text' => '',
|
636 |
+
'ui_off_text' => '',
|
637 |
+
),
|
638 |
+
array(
|
639 |
+
'key' => 'field_acfe_dt_tab_labels',
|
640 |
+
'label' => 'Labels',
|
641 |
+
'name' => '',
|
642 |
+
'type' => 'tab',
|
643 |
+
'instructions' => '',
|
644 |
+
'required' => 0,
|
645 |
+
'conditional_logic' => 0,
|
646 |
+
'wrapper' => array(
|
647 |
+
'width' => '',
|
648 |
+
'class' => '',
|
649 |
+
'id' => '',
|
650 |
+
),
|
651 |
+
'acfe_permissions' => '',
|
652 |
+
'placement' => 'top',
|
653 |
+
'endpoint' => 0,
|
654 |
+
),
|
655 |
+
array(
|
656 |
+
'key' => 'field_acfe_dt_labels',
|
657 |
+
'label' => 'Labels',
|
658 |
+
'name' => 'labels',
|
659 |
+
'type' => 'group',
|
660 |
+
'instructions' => 'An array of labels for this taxonomy. By default tag labels are used for non-hierarchical types and category labels for hierarchical ones.<br /><br />
|
661 |
+
Default: if empty, name is set to label value, and singular_name is set to name value.',
|
662 |
+
'required' => 0,
|
663 |
+
'conditional_logic' => 0,
|
664 |
+
'wrapper' => array(
|
665 |
+
'width' => '',
|
666 |
+
'class' => '',
|
667 |
+
'id' => '',
|
668 |
+
),
|
669 |
+
'acfe_permissions' => '',
|
670 |
+
'layout' => 'row',
|
671 |
+
'sub_fields' => array(
|
672 |
+
array(
|
673 |
+
'key' => 'field_acfe_dt_singular_name',
|
674 |
+
'label' => 'Singular name',
|
675 |
+
'name' => 'singular_name',
|
676 |
+
'type' => 'text',
|
677 |
+
'instructions' => '',
|
678 |
+
'required' => 0,
|
679 |
+
'conditional_logic' => 0,
|
680 |
+
'wrapper' => array(
|
681 |
+
'width' => '',
|
682 |
+
'class' => '',
|
683 |
+
'id' => '',
|
684 |
+
),
|
685 |
+
'acfe_validate' => '',
|
686 |
+
'acfe_update' => '',
|
687 |
+
'acfe_permissions' => '',
|
688 |
+
'default_value' => '',
|
689 |
+
'placeholder' => '',
|
690 |
+
'prepend' => '',
|
691 |
+
'append' => '',
|
692 |
+
'maxlength' => '',
|
693 |
+
),
|
694 |
+
array(
|
695 |
+
'key' => 'field_acfe_dt_menu_name',
|
696 |
+
'label' => 'Menu name',
|
697 |
+
'name' => 'menu_name',
|
698 |
+
'type' => 'text',
|
699 |
+
'instructions' => '',
|
700 |
+
'required' => 0,
|
701 |
+
'conditional_logic' => 0,
|
702 |
+
'wrapper' => array(
|
703 |
+
'width' => '',
|
704 |
+
'class' => '',
|
705 |
+
'id' => '',
|
706 |
+
),
|
707 |
+
'acfe_validate' => '',
|
708 |
+
'acfe_update' => '',
|
709 |
+
'acfe_permissions' => '',
|
710 |
+
'default_value' => '',
|
711 |
+
'placeholder' => '',
|
712 |
+
'prepend' => '',
|
713 |
+
'append' => '',
|
714 |
+
'maxlength' => '',
|
715 |
+
),
|
716 |
+
array(
|
717 |
+
'key' => 'field_acfe_dt_all_items',
|
718 |
+
'label' => 'All items',
|
719 |
+
'name' => 'all_items',
|
720 |
+
'type' => 'text',
|
721 |
+
'instructions' => '',
|
722 |
+
'required' => 0,
|
723 |
+
'conditional_logic' => 0,
|
724 |
+
'wrapper' => array(
|
725 |
+
'width' => '',
|
726 |
+
'class' => '',
|
727 |
+
'id' => '',
|
728 |
+
),
|
729 |
+
'acfe_validate' => '',
|
730 |
+
'acfe_update' => '',
|
731 |
+
'acfe_permissions' => '',
|
732 |
+
'default_value' => '',
|
733 |
+
'placeholder' => '',
|
734 |
+
'prepend' => '',
|
735 |
+
'append' => '',
|
736 |
+
'maxlength' => '',
|
737 |
+
),
|
738 |
+
array(
|
739 |
+
'key' => 'field_acfe_dt_edit_item',
|
740 |
+
'label' => 'Edit item',
|
741 |
+
'name' => 'edit_item',
|
742 |
+
'type' => 'text',
|
743 |
+
'instructions' => '',
|
744 |
+
'required' => 0,
|
745 |
+
'conditional_logic' => 0,
|
746 |
+
'wrapper' => array(
|
747 |
+
'width' => '',
|
748 |
+
'class' => '',
|
749 |
+
'id' => '',
|
750 |
+
),
|
751 |
+
'acfe_validate' => '',
|
752 |
+
'acfe_update' => '',
|
753 |
+
'acfe_permissions' => '',
|
754 |
+
'default_value' => '',
|
755 |
+
'placeholder' => '',
|
756 |
+
'prepend' => '',
|
757 |
+
'append' => '',
|
758 |
+
'maxlength' => '',
|
759 |
+
),
|
760 |
+
array(
|
761 |
+
'key' => 'field_acfe_dt_view_item',
|
762 |
+
'label' => 'View item',
|
763 |
+
'name' => 'view_item',
|
764 |
+
'type' => 'text',
|
765 |
+
'instructions' => '',
|
766 |
+
'required' => 0,
|
767 |
+
'conditional_logic' => 0,
|
768 |
+
'wrapper' => array(
|
769 |
+
'width' => '',
|
770 |
+
'class' => '',
|
771 |
+
'id' => '',
|
772 |
+
),
|
773 |
+
'acfe_validate' => '',
|
774 |
+
'acfe_update' => '',
|
775 |
+
'acfe_permissions' => '',
|
776 |
+
'default_value' => '',
|
777 |
+
'placeholder' => '',
|
778 |
+
'prepend' => '',
|
779 |
+
'append' => '',
|
780 |
+
'maxlength' => '',
|
781 |
+
),
|
782 |
+
array(
|
783 |
+
'key' => 'field_acfe_dt_update_item',
|
784 |
+
'label' => 'Update item',
|
785 |
+
'name' => 'update_item',
|
786 |
+
'type' => 'text',
|
787 |
+
'instructions' => '',
|
788 |
+
'required' => 0,
|
789 |
+
'conditional_logic' => 0,
|
790 |
+
'wrapper' => array(
|
791 |
+
'width' => '',
|
792 |
+
'class' => '',
|
793 |
+
'id' => '',
|
794 |
+
),
|
795 |
+
'acfe_validate' => '',
|
796 |
+
'acfe_update' => '',
|
797 |
+
'acfe_permissions' => '',
|
798 |
+
'default_value' => '',
|
799 |
+
'placeholder' => '',
|
800 |
+
'prepend' => '',
|
801 |
+
'append' => '',
|
802 |
+
'maxlength' => '',
|
803 |
+
),
|
804 |
+
array(
|
805 |
+
'key' => 'field_acfe_dt_add_new_item',
|
806 |
+
'label' => 'Add new item',
|
807 |
+
'name' => 'add_new_item',
|
808 |
+
'type' => 'text',
|
809 |
+
'instructions' => '',
|
810 |
+
'required' => 0,
|
811 |
+
'conditional_logic' => 0,
|
812 |
+
'wrapper' => array(
|
813 |
+
'width' => '',
|
814 |
+
'class' => '',
|
815 |
+
'id' => '',
|
816 |
+
),
|
817 |
+
'acfe_validate' => '',
|
818 |
+
'acfe_update' => '',
|
819 |
+
'acfe_permissions' => '',
|
820 |
+
'default_value' => '',
|
821 |
+
'placeholder' => '',
|
822 |
+
'prepend' => '',
|
823 |
+
'append' => '',
|
824 |
+
'maxlength' => '',
|
825 |
+
),
|
826 |
+
array(
|
827 |
+
'key' => 'field_acfe_dt_new_item_name',
|
828 |
+
'label' => 'New item name',
|
829 |
+
'name' => 'new_item_name',
|
830 |
+
'type' => 'text',
|
831 |
+
'instructions' => '',
|
832 |
+
'required' => 0,
|
833 |
+
'conditional_logic' => 0,
|
834 |
+
'wrapper' => array(
|
835 |
+
'width' => '',
|
836 |
+
'class' => '',
|
837 |
+
'id' => '',
|
838 |
+
),
|
839 |
+
'acfe_validate' => '',
|
840 |
+
'acfe_update' => '',
|
841 |
+
'acfe_permissions' => '',
|
842 |
+
'default_value' => '',
|
843 |
+
'placeholder' => '',
|
844 |
+
'prepend' => '',
|
845 |
+
'append' => '',
|
846 |
+
'maxlength' => '',
|
847 |
+
),
|
848 |
+
array(
|
849 |
+
'key' => 'field_acfe_dt_parent_item',
|
850 |
+
'label' => 'Parent item',
|
851 |
+
'name' => 'parent_item',
|
852 |
+
'type' => 'text',
|
853 |
+
'instructions' => '',
|
854 |
+
'required' => 0,
|
855 |
+
'conditional_logic' => 0,
|
856 |
+
'wrapper' => array(
|
857 |
+
'width' => '',
|
858 |
+
'class' => '',
|
859 |
+
'id' => '',
|
860 |
+
),
|
861 |
+
'acfe_validate' => '',
|
862 |
+
'acfe_update' => '',
|
863 |
+
'acfe_permissions' => '',
|
864 |
+
'default_value' => '',
|
865 |
+
'placeholder' => '',
|
866 |
+
'prepend' => '',
|
867 |
+
'append' => '',
|
868 |
+
'maxlength' => '',
|
869 |
+
),
|
870 |
+
array(
|
871 |
+
'key' => 'field_acfe_dt_parent_item_colon',
|
872 |
+
'label' => 'Parent item colon',
|
873 |
+
'name' => 'parent_item_colon',
|
874 |
+
'type' => 'text',
|
875 |
+
'instructions' => '',
|
876 |
+
'required' => 0,
|
877 |
+
'conditional_logic' => 0,
|
878 |
+
'wrapper' => array(
|
879 |
+
'width' => '',
|
880 |
+
'class' => '',
|
881 |
+
'id' => '',
|
882 |
+
),
|
883 |
+
'acfe_validate' => '',
|
884 |
+
'acfe_update' => '',
|
885 |
+
'acfe_permissions' => '',
|
886 |
+
'default_value' => '',
|
887 |
+
'placeholder' => '',
|
888 |
+
'prepend' => '',
|
889 |
+
'append' => '',
|
890 |
+
'maxlength' => '',
|
891 |
+
),
|
892 |
+
array(
|
893 |
+
'key' => 'field_acfe_dt_search_items',
|
894 |
+
'label' => 'Search items',
|
895 |
+
'name' => 'search_items',
|
896 |
+
'type' => 'text',
|
897 |
+
'instructions' => '',
|
898 |
+
'required' => 0,
|
899 |
+
'conditional_logic' => 0,
|
900 |
+
'wrapper' => array(
|
901 |
+
'width' => '',
|
902 |
+
'class' => '',
|
903 |
+
'id' => '',
|
904 |
+
),
|
905 |
+
'acfe_validate' => '',
|
906 |
+
'acfe_update' => '',
|
907 |
+
'acfe_permissions' => '',
|
908 |
+
'default_value' => '',
|
909 |
+
'placeholder' => '',
|
910 |
+
'prepend' => '',
|
911 |
+
'append' => '',
|
912 |
+
'maxlength' => '',
|
913 |
+
),
|
914 |
+
array(
|
915 |
+
'key' => 'field_acfe_dt_popular_items',
|
916 |
+
'label' => 'Popular items',
|
917 |
+
'name' => 'popular_items',
|
918 |
+
'type' => 'text',
|
919 |
+
'instructions' => '',
|
920 |
+
'required' => 0,
|
921 |
+
'conditional_logic' => 0,
|
922 |
+
'wrapper' => array(
|
923 |
+
'width' => '',
|
924 |
+
'class' => '',
|
925 |
+
'id' => '',
|
926 |
+
),
|
927 |
+
'acfe_validate' => '',
|
928 |
+
'acfe_update' => '',
|
929 |
+
'acfe_permissions' => '',
|
930 |
+
'default_value' => '',
|
931 |
+
'placeholder' => '',
|
932 |
+
'prepend' => '',
|
933 |
+
'append' => '',
|
934 |
+
'maxlength' => '',
|
935 |
+
),
|
936 |
+
array(
|
937 |
+
'key' => 'field_acfe_dt_separate_items_with_commas',
|
938 |
+
'label' => 'Separate items with commas',
|
939 |
+
'name' => 'separate_items_with_commas',
|
940 |
+
'type' => 'text',
|
941 |
+
'instructions' => '',
|
942 |
+
'required' => 0,
|
943 |
+
'conditional_logic' => 0,
|
944 |
+
'wrapper' => array(
|
945 |
+
'width' => '',
|
946 |
+
'class' => '',
|
947 |
+
'id' => '',
|
948 |
+
),
|
949 |
+
'acfe_validate' => '',
|
950 |
+
'acfe_update' => '',
|
951 |
+
'acfe_permissions' => '',
|
952 |
+
'default_value' => '',
|
953 |
+
'placeholder' => '',
|
954 |
+
'prepend' => '',
|
955 |
+
'append' => '',
|
956 |
+
'maxlength' => '',
|
957 |
+
),
|
958 |
+
array(
|
959 |
+
'key' => 'field_acfe_dt_add_or_remove_items',
|
960 |
+
'label' => 'Add or remove items',
|
961 |
+
'name' => 'add_or_remove_items',
|
962 |
+
'type' => 'text',
|
963 |
+
'instructions' => '',
|
964 |
+
'required' => 0,
|
965 |
+
'conditional_logic' => 0,
|
966 |
+
'wrapper' => array(
|
967 |
+
'width' => '',
|
968 |
+
'class' => '',
|
969 |
+
'id' => '',
|
970 |
+
),
|
971 |
+
'acfe_validate' => '',
|
972 |
+
'acfe_update' => '',
|
973 |
+
'acfe_permissions' => '',
|
974 |
+
'default_value' => '',
|
975 |
+
'placeholder' => '',
|
976 |
+
'prepend' => '',
|
977 |
+
'append' => '',
|
978 |
+
'maxlength' => '',
|
979 |
+
),
|
980 |
+
array(
|
981 |
+
'key' => 'field_acfe_dt_choose_from_most_used',
|
982 |
+
'label' => 'Choose from most used',
|
983 |
+
'name' => 'choose_from_most_used',
|
984 |
+
'type' => 'text',
|
985 |
+
'instructions' => '',
|
986 |
+
'required' => 0,
|
987 |
+
'conditional_logic' => 0,
|
988 |
+
'wrapper' => array(
|
989 |
+
'width' => '',
|
990 |
+
'class' => '',
|
991 |
+
'id' => '',
|
992 |
+
),
|
993 |
+
'acfe_validate' => '',
|
994 |
+
'acfe_update' => '',
|
995 |
+
'acfe_permissions' => '',
|
996 |
+
'default_value' => '',
|
997 |
+
'placeholder' => '',
|
998 |
+
'prepend' => '',
|
999 |
+
'append' => '',
|
1000 |
+
'maxlength' => '',
|
1001 |
+
),
|
1002 |
+
array(
|
1003 |
+
'key' => 'field_acfe_dt_not_found',
|
1004 |
+
'label' => 'Not found',
|
1005 |
+
'name' => 'not_found',
|
1006 |
+
'type' => 'text',
|
1007 |
+
'instructions' => '',
|
1008 |
+
'required' => 0,
|
1009 |
+
'conditional_logic' => 0,
|
1010 |
+
'wrapper' => array(
|
1011 |
+
'width' => '',
|
1012 |
+
'class' => '',
|
1013 |
+
'id' => '',
|
1014 |
+
),
|
1015 |
+
'acfe_validate' => '',
|
1016 |
+
'acfe_update' => '',
|
1017 |
+
'acfe_permissions' => '',
|
1018 |
+
'default_value' => '',
|
1019 |
+
'placeholder' => '',
|
1020 |
+
'prepend' => '',
|
1021 |
+
'append' => '',
|
1022 |
+
'maxlength' => '',
|
1023 |
+
),
|
1024 |
+
array(
|
1025 |
+
'key' => 'field_acfe_dt_back_to_items',
|
1026 |
+
'label' => 'Back to items',
|
1027 |
+
'name' => 'back_to_items',
|
1028 |
+
'type' => 'text',
|
1029 |
+
'instructions' => '',
|
1030 |
+
'required' => 0,
|
1031 |
+
'conditional_logic' => 0,
|
1032 |
+
'wrapper' => array(
|
1033 |
+
'width' => '',
|
1034 |
+
'class' => '',
|
1035 |
+
'id' => '',
|
1036 |
+
),
|
1037 |
+
'acfe_validate' => '',
|
1038 |
+
'acfe_update' => '',
|
1039 |
+
'acfe_permissions' => '',
|
1040 |
+
'default_value' => '',
|
1041 |
+
'placeholder' => '',
|
1042 |
+
'prepend' => '',
|
1043 |
+
'append' => '',
|
1044 |
+
'maxlength' => '',
|
1045 |
+
),
|
1046 |
+
),
|
1047 |
+
),
|
1048 |
+
array(
|
1049 |
+
'key' => 'field_acfe_dt_tab_menu',
|
1050 |
+
'label' => 'Menu',
|
1051 |
+
'name' => '',
|
1052 |
+
'type' => 'tab',
|
1053 |
+
'instructions' => '',
|
1054 |
+
'required' => 0,
|
1055 |
+
'conditional_logic' => 0,
|
1056 |
+
'wrapper' => array(
|
1057 |
+
'width' => '',
|
1058 |
+
'class' => '',
|
1059 |
+
'id' => '',
|
1060 |
+
),
|
1061 |
+
'acfe_permissions' => '',
|
1062 |
+
'placement' => 'top',
|
1063 |
+
'endpoint' => 0,
|
1064 |
+
),
|
1065 |
+
array(
|
1066 |
+
'key' => 'field_acfe_dt_show_ui',
|
1067 |
+
'label' => 'Show UI',
|
1068 |
+
'name' => 'show_ui',
|
1069 |
+
'type' => 'true_false',
|
1070 |
+
'instructions' => 'Whether to generate a default UI for managing this post type in the admin',
|
1071 |
+
'required' => 0,
|
1072 |
+
'conditional_logic' => 0,
|
1073 |
+
'wrapper' => array(
|
1074 |
+
'width' => '',
|
1075 |
+
'class' => '',
|
1076 |
+
'id' => '',
|
1077 |
+
),
|
1078 |
+
'acfe_validate' => '',
|
1079 |
+
'acfe_update' => '',
|
1080 |
+
'acfe_permissions' => '',
|
1081 |
+
'message' => '',
|
1082 |
+
'default_value' => 1,
|
1083 |
+
'ui' => 1,
|
1084 |
+
'ui_on_text' => '',
|
1085 |
+
'ui_off_text' => '',
|
1086 |
+
),
|
1087 |
+
array(
|
1088 |
+
'key' => 'field_acfe_dt_show_in_menu',
|
1089 |
+
'label' => 'Show in menu',
|
1090 |
+
'name' => 'show_in_menu',
|
1091 |
+
'type' => 'true_false',
|
1092 |
+
'instructions' => 'Where to show the taxonomy in the admin menu. show_ui must be true',
|
1093 |
+
'required' => 0,
|
1094 |
+
'conditional_logic' => 0,
|
1095 |
+
'wrapper' => array(
|
1096 |
+
'width' => '',
|
1097 |
+
'class' => '',
|
1098 |
+
'id' => '',
|
1099 |
+
),
|
1100 |
+
'acfe_validate' => '',
|
1101 |
+
'acfe_update' => '',
|
1102 |
+
'acfe_permissions' => '',
|
1103 |
+
'message' => '',
|
1104 |
+
'default_value' => 1,
|
1105 |
+
'ui' => 1,
|
1106 |
+
'ui_on_text' => '',
|
1107 |
+
'ui_off_text' => '',
|
1108 |
+
),
|
1109 |
+
array(
|
1110 |
+
'key' => 'field_acfe_dt_show_in_nav_menus',
|
1111 |
+
'label' => 'Show in nav menus',
|
1112 |
+
'name' => 'show_in_nav_menus',
|
1113 |
+
'type' => 'true_false',
|
1114 |
+
'instructions' => 'true makes this taxonomy available for selection in navigation menus',
|
1115 |
+
'required' => 0,
|
1116 |
+
'conditional_logic' => 0,
|
1117 |
+
'wrapper' => array(
|
1118 |
+
'width' => '',
|
1119 |
+
'class' => '',
|
1120 |
+
'id' => '',
|
1121 |
+
),
|
1122 |
+
'acfe_validate' => '',
|
1123 |
+
'acfe_update' => '',
|
1124 |
+
'acfe_permissions' => '',
|
1125 |
+
'message' => '',
|
1126 |
+
'default_value' => 1,
|
1127 |
+
'ui' => 1,
|
1128 |
+
'ui_on_text' => '',
|
1129 |
+
'ui_off_text' => '',
|
1130 |
+
),
|
1131 |
+
array(
|
1132 |
+
'key' => 'field_acfe_dt_show_tagcloud',
|
1133 |
+
'label' => 'Show tagcloud',
|
1134 |
+
'name' => 'show_tagcloud',
|
1135 |
+
'type' => 'true_false',
|
1136 |
+
'instructions' => 'Whether to allow the Tag Cloud widget to use this taxonomy',
|
1137 |
+
'required' => 0,
|
1138 |
+
'conditional_logic' => 0,
|
1139 |
+
'wrapper' => array(
|
1140 |
+
'width' => '',
|
1141 |
+
'class' => '',
|
1142 |
+
'id' => '',
|
1143 |
+
),
|
1144 |
+
'acfe_validate' => '',
|
1145 |
+
'acfe_update' => '',
|
1146 |
+
'acfe_permissions' => '',
|
1147 |
+
'message' => '',
|
1148 |
+
'default_value' => 1,
|
1149 |
+
'ui' => 1,
|
1150 |
+
'ui_on_text' => '',
|
1151 |
+
'ui_off_text' => '',
|
1152 |
+
),
|
1153 |
+
array(
|
1154 |
+
'key' => 'field_acfe_dt_show_in_quick_edit',
|
1155 |
+
'label' => 'Show in quick edit',
|
1156 |
+
'name' => 'show_in_quick_edit',
|
1157 |
+
'type' => 'true_false',
|
1158 |
+
'instructions' => 'Whether to show the taxonomy in the quick/bulk edit panel',
|
1159 |
+
'required' => 0,
|
1160 |
+
'conditional_logic' => 0,
|
1161 |
+
'wrapper' => array(
|
1162 |
+
'width' => '',
|
1163 |
+
'class' => '',
|
1164 |
+
'id' => '',
|
1165 |
+
),
|
1166 |
+
'acfe_validate' => '',
|
1167 |
+
'acfe_update' => '',
|
1168 |
+
'acfe_permissions' => '',
|
1169 |
+
'message' => '',
|
1170 |
+
'default_value' => 1,
|
1171 |
+
'ui' => 1,
|
1172 |
+
'ui_on_text' => '',
|
1173 |
+
'ui_off_text' => '',
|
1174 |
+
),
|
1175 |
+
array(
|
1176 |
+
'key' => 'field_acfe_dt_show_admin_column',
|
1177 |
+
'label' => 'Show admin column',
|
1178 |
+
'name' => 'show_admin_column',
|
1179 |
+
'type' => 'true_false',
|
1180 |
+
'instructions' => 'Whether to allow automatic creation of taxonomy columns on associated post-types table',
|
1181 |
+
'required' => 0,
|
1182 |
+
'conditional_logic' => 0,
|
1183 |
+
'wrapper' => array(
|
1184 |
+
'width' => '',
|
1185 |
+
'class' => '',
|
1186 |
+
'id' => '',
|
1187 |
+
),
|
1188 |
+
'acfe_validate' => '',
|
1189 |
+
'acfe_update' => '',
|
1190 |
+
'acfe_permissions' => '',
|
1191 |
+
'message' => '',
|
1192 |
+
'default_value' => 1,
|
1193 |
+
'ui' => 1,
|
1194 |
+
'ui_on_text' => '',
|
1195 |
+
'ui_off_text' => '',
|
1196 |
+
),
|
1197 |
+
array(
|
1198 |
+
'key' => 'field_acfe_dt_tab_capability',
|
1199 |
+
'label' => 'Capability',
|
1200 |
+
'name' => '',
|
1201 |
+
'type' => 'tab',
|
1202 |
+
'instructions' => '',
|
1203 |
+
'required' => 0,
|
1204 |
+
'conditional_logic' => 0,
|
1205 |
+
'wrapper' => array(
|
1206 |
+
'width' => '',
|
1207 |
+
'class' => '',
|
1208 |
+
'id' => '',
|
1209 |
+
),
|
1210 |
+
'acfe_permissions' => '',
|
1211 |
+
'placement' => 'top',
|
1212 |
+
'endpoint' => 0,
|
1213 |
+
),
|
1214 |
+
array(
|
1215 |
+
'key' => 'field_acfe_dt_capabilities',
|
1216 |
+
'label' => 'Capabilities',
|
1217 |
+
'name' => 'capabilities',
|
1218 |
+
'type' => 'textarea',
|
1219 |
+
'instructions' => 'An array of the capabilities for this taxonomy:<br /><br />
|
1220 |
+
manage_terms<br />
|
1221 |
+
edit_terms<br />
|
1222 |
+
delete_terms<br />
|
1223 |
+
assign_terms',
|
1224 |
+
'required' => 0,
|
1225 |
+
'conditional_logic' => 0,
|
1226 |
+
'wrapper' => array(
|
1227 |
+
'width' => '',
|
1228 |
+
'class' => '',
|
1229 |
+
'id' => '',
|
1230 |
+
),
|
1231 |
+
'acfe_validate' => '',
|
1232 |
+
'acfe_update' => '',
|
1233 |
+
'acfe_permissions' => '',
|
1234 |
+
'default_value' => '',
|
1235 |
+
'placeholder' => '',
|
1236 |
+
'maxlength' => '',
|
1237 |
+
'rows' => '',
|
1238 |
+
'new_lines' => '',
|
1239 |
+
),
|
1240 |
+
array(
|
1241 |
+
'key' => 'field_acfe_dt_tab_single',
|
1242 |
+
'label' => 'Single',
|
1243 |
+
'name' => '',
|
1244 |
+
'type' => 'tab',
|
1245 |
+
'instructions' => '',
|
1246 |
+
'required' => 0,
|
1247 |
+
'conditional_logic' => 0,
|
1248 |
+
'wrapper' => array(
|
1249 |
+
'width' => '',
|
1250 |
+
'class' => '',
|
1251 |
+
'id' => '',
|
1252 |
+
),
|
1253 |
+
'acfe_permissions' => '',
|
1254 |
+
'placement' => 'top',
|
1255 |
+
'endpoint' => 0,
|
1256 |
+
),
|
1257 |
+
array(
|
1258 |
+
'key' => 'field_acfe_dt_single_template',
|
1259 |
+
'label' => 'Template',
|
1260 |
+
'name' => 'acfe_dt_single_template',
|
1261 |
+
'type' => 'text',
|
1262 |
+
'instructions' => 'ACF Extended: Which template file to load for the term query. More informations on <a href="https://developer.wordpress.org/themes/basics/template-hierarchy/">Template hierarchy</a>',
|
1263 |
+
'required' => 0,
|
1264 |
+
'conditional_logic' => 0,
|
1265 |
+
'wrapper' => array(
|
1266 |
+
'width' => '',
|
1267 |
+
'class' => '',
|
1268 |
+
'id' => '',
|
1269 |
+
),
|
1270 |
+
'acfe_validate' => '',
|
1271 |
+
'acfe_update' => '',
|
1272 |
+
'acfe_permissions' => '',
|
1273 |
+
'default_value' => '',
|
1274 |
+
'placeholder' => 'my-template.php',
|
1275 |
+
'prepend' => str_replace(home_url(), '', ACFE_THEME_URL) . '/',
|
1276 |
+
'append' => '',
|
1277 |
+
'maxlength' => '',
|
1278 |
+
),
|
1279 |
+
array(
|
1280 |
+
'key' => 'field_acfe_dt_single_posts_per_page',
|
1281 |
+
'label' => 'Posts per page',
|
1282 |
+
'name' => 'acfe_dt_single_posts_per_page',
|
1283 |
+
'type' => 'number',
|
1284 |
+
'instructions' => 'ACF Extended: Number of posts to display on the admin list screen',
|
1285 |
+
'required' => 0,
|
1286 |
+
'conditional_logic' => 0,
|
1287 |
+
'wrapper' => array(
|
1288 |
+
'width' => '',
|
1289 |
+
'class' => '',
|
1290 |
+
'id' => '',
|
1291 |
+
),
|
1292 |
+
'acfe_validate' => '',
|
1293 |
+
'acfe_update' => '',
|
1294 |
+
'acfe_permissions' => '',
|
1295 |
+
'default_value' => 10,
|
1296 |
+
'placeholder' => '',
|
1297 |
+
'prepend' => '',
|
1298 |
+
'append' => '',
|
1299 |
+
'min' => -1,
|
1300 |
+
'max' => '',
|
1301 |
+
'step' => '',
|
1302 |
+
),
|
1303 |
+
array(
|
1304 |
+
'key' => 'field_acfe_dt_single_orderby',
|
1305 |
+
'label' => 'Order by',
|
1306 |
+
'name' => 'acfe_dt_single_orderby',
|
1307 |
+
'type' => 'text',
|
1308 |
+
'instructions' => 'ACF Extended: Sort retrieved posts by parameter in the admin list screen. Defaults to \'date (post_date)\'.',
|
1309 |
+
'required' => 0,
|
1310 |
+
'conditional_logic' => 0,
|
1311 |
+
'wrapper' => array(
|
1312 |
+
'width' => '',
|
1313 |
+
'class' => '',
|
1314 |
+
'id' => '',
|
1315 |
+
),
|
1316 |
+
'acfe_validate' => '',
|
1317 |
+
'acfe_update' => array(
|
1318 |
+
'5c9479dec93c4' => array(
|
1319 |
+
'acfe_update_function' => 'sanitize_title',
|
1320 |
+
),
|
1321 |
+
),
|
1322 |
+
'acfe_permissions' => '',
|
1323 |
+
'default_value' => 'date',
|
1324 |
+
'placeholder' => '',
|
1325 |
+
'prepend' => '',
|
1326 |
+
'append' => '',
|
1327 |
+
'maxlength' => '',
|
1328 |
+
),
|
1329 |
+
array(
|
1330 |
+
'key' => 'field_acfe_dt_single_order',
|
1331 |
+
'label' => 'Order',
|
1332 |
+
'name' => 'acfe_dt_single_order',
|
1333 |
+
'type' => 'select',
|
1334 |
+
'instructions' => 'ACF Extended: Designates the ascending or descending order of the \'orderby\' parameter in the admin list screen. Defaults to \'DESC\'.',
|
1335 |
+
'required' => 0,
|
1336 |
+
'conditional_logic' => 0,
|
1337 |
+
'wrapper' => array(
|
1338 |
+
'width' => '',
|
1339 |
+
'class' => '',
|
1340 |
+
'id' => '',
|
1341 |
+
),
|
1342 |
+
'acfe_validate' => '',
|
1343 |
+
'acfe_update' => '',
|
1344 |
+
'acfe_permissions' => '',
|
1345 |
+
'choices' => array(
|
1346 |
+
'ASC' => 'ASC',
|
1347 |
+
'DESC' => 'DESC',
|
1348 |
+
),
|
1349 |
+
'default_value' => array(
|
1350 |
+
0 => 'DESC',
|
1351 |
+
),
|
1352 |
+
'allow_null' => 0,
|
1353 |
+
'multiple' => 0,
|
1354 |
+
'ui' => 0,
|
1355 |
+
'return_format' => 'value',
|
1356 |
+
'ajax' => 0,
|
1357 |
+
'placeholder' => '',
|
1358 |
+
),
|
1359 |
+
array(
|
1360 |
+
'key' => 'field_acfe_dt_rewrite',
|
1361 |
+
'label' => 'Rewrite',
|
1362 |
+
'name' => 'rewrite',
|
1363 |
+
'type' => 'true_false',
|
1364 |
+
'instructions' => 'Set to false to prevent automatic URL rewriting a.k.a. "pretty permalinks". Pass an argument array to override default URL settings for permalinks',
|
1365 |
+
'required' => 0,
|
1366 |
+
'conditional_logic' => 0,
|
1367 |
+
'wrapper' => array(
|
1368 |
+
'width' => '',
|
1369 |
+
'class' => '',
|
1370 |
+
'id' => '',
|
1371 |
+
),
|
1372 |
+
'acfe_validate' => '',
|
1373 |
+
'acfe_update' => '',
|
1374 |
+
'acfe_permissions' => '',
|
1375 |
+
'message' => '',
|
1376 |
+
'default_value' => 1,
|
1377 |
+
'ui' => 1,
|
1378 |
+
'ui_on_text' => '',
|
1379 |
+
'ui_off_text' => '',
|
1380 |
+
),
|
1381 |
+
array(
|
1382 |
+
'key' => 'field_acfe_dt_rewrite_args_select',
|
1383 |
+
'label' => 'Rewrite Arguments',
|
1384 |
+
'name' => 'rewrite_args_select',
|
1385 |
+
'type' => 'true_false',
|
1386 |
+
'instructions' => 'Use additional rewrite arguments',
|
1387 |
+
'required' => 0,
|
1388 |
+
'conditional_logic' => array(
|
1389 |
+
array(
|
1390 |
+
array(
|
1391 |
+
'field' => 'field_acfe_dt_rewrite',
|
1392 |
+
'operator' => '==',
|
1393 |
+
'value' => '1',
|
1394 |
+
),
|
1395 |
+
),
|
1396 |
+
),
|
1397 |
+
'wrapper' => array(
|
1398 |
+
'width' => '',
|
1399 |
+
'class' => '',
|
1400 |
+
'id' => '',
|
1401 |
+
),
|
1402 |
+
'acfe_validate' => '',
|
1403 |
+
'acfe_update' => '',
|
1404 |
+
'acfe_permissions' => '',
|
1405 |
+
'message' => '',
|
1406 |
+
'default_value' => 0,
|
1407 |
+
'ui' => 1,
|
1408 |
+
'ui_on_text' => '',
|
1409 |
+
'ui_off_text' => '',
|
1410 |
+
),
|
1411 |
+
array(
|
1412 |
+
'key' => 'field_acfe_dt_rewrite_args',
|
1413 |
+
'label' => 'Rewrite Arguments',
|
1414 |
+
'name' => 'rewrite_args',
|
1415 |
+
'type' => 'group',
|
1416 |
+
'instructions' => 'Additional arguments',
|
1417 |
+
'required' => 0,
|
1418 |
+
'conditional_logic' => array(
|
1419 |
+
array(
|
1420 |
+
array(
|
1421 |
+
'field' => 'field_acfe_dt_rewrite',
|
1422 |
+
'operator' => '==',
|
1423 |
+
'value' => '1',
|
1424 |
+
),
|
1425 |
+
array(
|
1426 |
+
'field' => 'field_acfe_dt_rewrite_args_select',
|
1427 |
+
'operator' => '==',
|
1428 |
+
'value' => '1',
|
1429 |
+
),
|
1430 |
+
),
|
1431 |
+
),
|
1432 |
+
'wrapper' => array(
|
1433 |
+
'width' => '',
|
1434 |
+
'class' => '',
|
1435 |
+
'id' => '',
|
1436 |
+
),
|
1437 |
+
'acfe_permissions' => '',
|
1438 |
+
'layout' => 'row',
|
1439 |
+
'sub_fields' => array(
|
1440 |
+
array(
|
1441 |
+
'key' => 'field_acfe_dt_rewrite_slug',
|
1442 |
+
'label' => 'Slug',
|
1443 |
+
'name' => 'acfe_dt_rewrite_slug',
|
1444 |
+
'type' => 'text',
|
1445 |
+
'instructions' => 'Used as pretty permalink text (i.e. /tag/) - defaults to $taxonomy (taxonomy\'s name slug)',
|
1446 |
+
'required' => 0,
|
1447 |
+
'conditional_logic' => array(
|
1448 |
+
array(
|
1449 |
+
array(
|
1450 |
+
'field' => 'field_acfe_dt_rewrite_args_select',
|
1451 |
+
'operator' => '==',
|
1452 |
+
'value' => '1',
|
1453 |
+
),
|
1454 |
+
),
|
1455 |
+
),
|
1456 |
+
'wrapper' => array(
|
1457 |
+
'width' => '',
|
1458 |
+
'class' => '',
|
1459 |
+
'id' => '',
|
1460 |
+
),
|
1461 |
+
'acfe_validate' => '',
|
1462 |
+
'acfe_update' => array(
|
1463 |
+
'5c94746ae2fb0' => array(
|
1464 |
+
'acfe_update_function' => 'sanitize_title',
|
1465 |
+
),
|
1466 |
+
),
|
1467 |
+
'acfe_permissions' => '',
|
1468 |
+
'default_value' => '',
|
1469 |
+
'placeholder' => 'Default',
|
1470 |
+
'prepend' => '',
|
1471 |
+
'append' => '',
|
1472 |
+
'maxlength' => '',
|
1473 |
+
),
|
1474 |
+
array(
|
1475 |
+
'key' => 'field_acfe_dt_rewrite_with_front',
|
1476 |
+
'label' => 'With front',
|
1477 |
+
'name' => 'acfe_dt_rewrite_with_front',
|
1478 |
+
'type' => 'true_false',
|
1479 |
+
'instructions' => 'Allowing permalinks to be prepended with front base',
|
1480 |
+
'required' => 0,
|
1481 |
+
'conditional_logic' => array(
|
1482 |
+
array(
|
1483 |
+
array(
|
1484 |
+
'field' => 'field_acfe_dt_rewrite_args_select',
|
1485 |
+
'operator' => '==',
|
1486 |
+
'value' => '1',
|
1487 |
+
),
|
1488 |
+
),
|
1489 |
+
),
|
1490 |
+
'wrapper' => array(
|
1491 |
+
'width' => '',
|
1492 |
+
'class' => '',
|
1493 |
+
'id' => '',
|
1494 |
+
),
|
1495 |
+
'acfe_validate' => '',
|
1496 |
+
'acfe_update' => '',
|
1497 |
+
'acfe_permissions' => '',
|
1498 |
+
'message' => '',
|
1499 |
+
'default_value' => 1,
|
1500 |
+
'ui' => 1,
|
1501 |
+
'ui_on_text' => '',
|
1502 |
+
'ui_off_text' => '',
|
1503 |
+
),
|
1504 |
+
array(
|
1505 |
+
'key' => 'field_acfe_dt_rewrite_hierarchical',
|
1506 |
+
'label' => 'Hierarchical',
|
1507 |
+
'name' => 'hierarchical',
|
1508 |
+
'type' => 'true_false',
|
1509 |
+
'instructions' => 'True or false allow hierarchical urls',
|
1510 |
+
'required' => 0,
|
1511 |
+
'conditional_logic' => array(
|
1512 |
+
array(
|
1513 |
+
array(
|
1514 |
+
'field' => 'field_acfe_dt_rewrite_args_select',
|
1515 |
+
'operator' => '==',
|
1516 |
+
'value' => '1',
|
1517 |
+
),
|
1518 |
+
),
|
1519 |
+
),
|
1520 |
+
'wrapper' => array(
|
1521 |
+
'width' => '',
|
1522 |
+
'class' => '',
|
1523 |
+
'id' => '',
|
1524 |
+
),
|
1525 |
+
'acfe_validate' => '',
|
1526 |
+
'acfe_update' => '',
|
1527 |
+
'acfe_permissions' => '',
|
1528 |
+
'message' => '',
|
1529 |
+
'default_value' => 0,
|
1530 |
+
'ui' => 1,
|
1531 |
+
'ui_on_text' => '',
|
1532 |
+
'ui_off_text' => '',
|
1533 |
+
),
|
1534 |
+
),
|
1535 |
+
),
|
1536 |
+
array(
|
1537 |
+
'key' => 'field_acfe_dt_tab_admin',
|
1538 |
+
'label' => 'Admin',
|
1539 |
+
'name' => '',
|
1540 |
+
'type' => 'tab',
|
1541 |
+
'instructions' => '',
|
1542 |
+
'required' => 0,
|
1543 |
+
'conditional_logic' => 0,
|
1544 |
+
'wrapper' => array(
|
1545 |
+
'width' => '',
|
1546 |
+
'class' => '',
|
1547 |
+
'id' => '',
|
1548 |
+
),
|
1549 |
+
'acfe_permissions' => '',
|
1550 |
+
'placement' => 'top',
|
1551 |
+
'endpoint' => 0,
|
1552 |
+
),
|
1553 |
+
array(
|
1554 |
+
'key' => 'field_acfe_dt_admin_terms_per_page',
|
1555 |
+
'label' => 'Terms per page',
|
1556 |
+
'name' => 'acfe_dt_admin_terms_per_page',
|
1557 |
+
'type' => 'number',
|
1558 |
+
'instructions' => 'ACF Extended: Number of terms to display on the admin list screen',
|
1559 |
+
'required' => 0,
|
1560 |
+
'conditional_logic' => 0,
|
1561 |
+
'wrapper' => array(
|
1562 |
+
'width' => '',
|
1563 |
+
'class' => '',
|
1564 |
+
'id' => '',
|
1565 |
+
),
|
1566 |
+
'acfe_validate' => '',
|
1567 |
+
'acfe_update' => '',
|
1568 |
+
'acfe_permissions' => '',
|
1569 |
+
'default_value' => 10,
|
1570 |
+
'placeholder' => '',
|
1571 |
+
'prepend' => '',
|
1572 |
+
'append' => '',
|
1573 |
+
'min' => -1,
|
1574 |
+
'max' => '',
|
1575 |
+
'step' => '',
|
1576 |
+
),
|
1577 |
+
array(
|
1578 |
+
'key' => 'field_acfe_dt_admin_orderby',
|
1579 |
+
'label' => 'Order by',
|
1580 |
+
'name' => 'acfe_dt_admin_orderby',
|
1581 |
+
'type' => 'text',
|
1582 |
+
'instructions' => 'ACF Extended: Sort retrieved terms by parameter in the admin list screen. Accepts term fields \'name\', \'slug\', \'term_group\', \'term_id\', \'id\', \'description\', \'parent\', \'count\' (for term taxonomy count), or \'none\' to omit the ORDER BY clause',
|
1583 |
+
'required' => 0,
|
1584 |
+
'conditional_logic' => 0,
|
1585 |
+
'wrapper' => array(
|
1586 |
+
'width' => '',
|
1587 |
+
'class' => '',
|
1588 |
+
'id' => '',
|
1589 |
+
),
|
1590 |
+
'acfe_validate' => '',
|
1591 |
+
'acfe_update' => array(
|
1592 |
+
'5c9479dec93c4' => array(
|
1593 |
+
'acfe_update_function' => 'sanitize_title',
|
1594 |
+
),
|
1595 |
+
),
|
1596 |
+
'acfe_permissions' => '',
|
1597 |
+
'default_value' => 'name',
|
1598 |
+
'placeholder' => '',
|
1599 |
+
'prepend' => '',
|
1600 |
+
'append' => '',
|
1601 |
+
'maxlength' => '',
|
1602 |
+
),
|
1603 |
+
array(
|
1604 |
+
'key' => 'field_acfe_dt_admin_order',
|
1605 |
+
'label' => 'Order',
|
1606 |
+
'name' => 'acfe_dt_admin_order',
|
1607 |
+
'type' => 'select',
|
1608 |
+
'instructions' => 'ACF Extended: Designates the ascending or descending order of the \'orderby\' parameter in the admin list screen. Defaults to \'ASC\'.',
|
1609 |
+
'required' => 0,
|
1610 |
+
'conditional_logic' => 0,
|
1611 |
+
'wrapper' => array(
|
1612 |
+
'width' => '',
|
1613 |
+
'class' => '',
|
1614 |
+
'id' => '',
|
1615 |
+
),
|
1616 |
+
'acfe_validate' => '',
|
1617 |
+
'acfe_update' => '',
|
1618 |
+
'acfe_permissions' => '',
|
1619 |
+
'choices' => array(
|
1620 |
+
'ASC' => 'ASC',
|
1621 |
+
'DESC' => 'DESC',
|
1622 |
+
),
|
1623 |
+
'default_value' => array(
|
1624 |
+
0 => 'ASC',
|
1625 |
+
),
|
1626 |
+
'allow_null' => 0,
|
1627 |
+
'multiple' => 0,
|
1628 |
+
'ui' => 0,
|
1629 |
+
'return_format' => 'value',
|
1630 |
+
'ajax' => 0,
|
1631 |
+
'placeholder' => '',
|
1632 |
+
),
|
1633 |
+
array(
|
1634 |
+
'key' => 'field_acfe_dt_tab_rest',
|
1635 |
+
'label' => 'REST',
|
1636 |
+
'name' => '',
|
1637 |
+
'type' => 'tab',
|
1638 |
+
'instructions' => '',
|
1639 |
+
'required' => 0,
|
1640 |
+
'conditional_logic' => 0,
|
1641 |
+
'wrapper' => array(
|
1642 |
+
'width' => '',
|
1643 |
+
'class' => '',
|
1644 |
+
'id' => '',
|
1645 |
+
),
|
1646 |
+
'acfe_permissions' => '',
|
1647 |
+
'placement' => 'top',
|
1648 |
+
'endpoint' => 0,
|
1649 |
+
),
|
1650 |
+
array(
|
1651 |
+
'key' => 'field_acfe_dt_show_in_rest',
|
1652 |
+
'label' => 'Show in rest',
|
1653 |
+
'name' => 'show_in_rest',
|
1654 |
+
'type' => 'true_false',
|
1655 |
+
'instructions' => 'Whether to include the taxonomy in the REST API',
|
1656 |
+
'required' => 0,
|
1657 |
+
'conditional_logic' => 0,
|
1658 |
+
'wrapper' => array(
|
1659 |
+
'width' => '',
|
1660 |
+
'class' => '',
|
1661 |
+
'id' => '',
|
1662 |
+
),
|
1663 |
+
'acfe_validate' => '',
|
1664 |
+
'acfe_update' => '',
|
1665 |
+
'acfe_permissions' => '',
|
1666 |
+
'message' => '',
|
1667 |
+
'default_value' => 0,
|
1668 |
+
'ui' => 1,
|
1669 |
+
'ui_on_text' => '',
|
1670 |
+
'ui_off_text' => '',
|
1671 |
+
),
|
1672 |
+
array(
|
1673 |
+
'key' => 'field_acfe_dt_rest_base',
|
1674 |
+
'label' => 'Rest base',
|
1675 |
+
'name' => 'rest_base',
|
1676 |
+
'type' => 'text',
|
1677 |
+
'instructions' => 'To change the base url of REST API route',
|
1678 |
+
'required' => 0,
|
1679 |
+
'conditional_logic' => 0,
|
1680 |
+
'wrapper' => array(
|
1681 |
+
'width' => '',
|
1682 |
+
'class' => '',
|
1683 |
+
'id' => '',
|
1684 |
+
),
|
1685 |
+
'acfe_validate' => '',
|
1686 |
+
'acfe_update' => '',
|
1687 |
+
'acfe_permissions' => '',
|
1688 |
+
'default_value' => '',
|
1689 |
+
'placeholder' => '',
|
1690 |
+
'prepend' => '',
|
1691 |
+
'append' => '',
|
1692 |
+
'maxlength' => '',
|
1693 |
+
),
|
1694 |
+
array(
|
1695 |
+
'key' => 'field_acfe_dt_rest_controller_class',
|
1696 |
+
'label' => 'Rest controller class',
|
1697 |
+
'name' => 'rest_controller_class',
|
1698 |
+
'type' => 'text',
|
1699 |
+
'instructions' => 'REST API Controller class name',
|
1700 |
+
'required' => 0,
|
1701 |
+
'conditional_logic' => 0,
|
1702 |
+
'wrapper' => array(
|
1703 |
+
'width' => '',
|
1704 |
+
'class' => '',
|
1705 |
+
'id' => '',
|
1706 |
+
),
|
1707 |
+
'acfe_validate' => '',
|
1708 |
+
'acfe_update' => '',
|
1709 |
+
'acfe_permissions' => '',
|
1710 |
+
'default_value' => 'WP_REST_Terms_Controller',
|
1711 |
+
'placeholder' => '',
|
1712 |
+
'prepend' => '',
|
1713 |
+
'append' => '',
|
1714 |
+
'maxlength' => '',
|
1715 |
+
),
|
1716 |
+
),
|
1717 |
+
));
|
1718 |
+
|
1719 |
+
}
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: acf, custom fields, meta, admin, fields, form, repeater, content
|
|
5 |
Requires at least: 4.9
|
6 |
Tested up to: 5.1.1
|
7 |
Requires PHP: 5.6
|
8 |
-
Stable tag: 0.5.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -94,6 +94,30 @@ Display a submit button
|
|
94 |
* **Settings page**
|
95 |
Display all ACF settings in one page
|
96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
== Installation ==
|
98 |
|
99 |
= Wordpress Install =
|
@@ -122,6 +146,16 @@ Create a folder `/acfe-php/` in your theme. Go to your field group administratio
|
|
122 |
|
123 |
== Changelog ==
|
124 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
= 0.5.2.3 =
|
126 |
* Field Groups: Fixed unused category column on Field Groups Sync page
|
127 |
* Fields: Fixed subfields 'ghost' acfcloneindex saved when duplicating flexible content (thanks to @AsmussenBrandon)
|
5 |
Requires at least: 4.9
|
6 |
Tested up to: 5.1.1
|
7 |
Requires PHP: 5.6
|
8 |
+
Stable tag: 0.5.5
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
94 |
* **Settings page**
|
95 |
Display all ACF settings in one page
|
96 |
|
97 |
+
== Dynamic Post Types ==
|
98 |
+
|
99 |
+
Create and manage post types from your WordPress administration (Tools > Post Types). All WordPress post types arguments can be set and managed. But also:
|
100 |
+
|
101 |
+
* Manage Posts per page, order by and order for the post type archive
|
102 |
+
* Manage Posts per page, order by and order for the post type administration screen
|
103 |
+
* Set custom single template (ie: `my-single.php`) instead of the native `single-{post_type}.php`
|
104 |
+
* Set custom archive template (ie: `my-archive.php`) instead of the native `archive-{post_type}.php`
|
105 |
+
|
106 |
+
== Dynamic Taxonomies ==
|
107 |
+
|
108 |
+
Create and manage taxonomies from your WordPress administration (Tools > Taxonomies). All WordPress taxonomies arguments can be set and managed. But also:
|
109 |
+
|
110 |
+
* Manage Posts per page, order by and order for the taxonomy term archive
|
111 |
+
* Manage Posts per page, order by and order for the taxonomy administration screen
|
112 |
+
* Set custom taxonomy template (ie: `my-taxonomy.php`) instead of the native `taxonomy-{taxonomy}.php`
|
113 |
+
|
114 |
+
== Options ==
|
115 |
+
|
116 |
+
BETA: Manage all WordPress options from Settings > Options.
|
117 |
+
|
118 |
+
* View, add, edit and remove simple options (string/boolean)
|
119 |
+
* View and remove serialized options (displayed as array for readability)
|
120 |
+
|
121 |
== Installation ==
|
122 |
|
123 |
= Wordpress Install =
|
146 |
|
147 |
== Changelog ==
|
148 |
|
149 |
+
= 0.5.5 =
|
150 |
+
* Module: Added Dynamic Post Type module
|
151 |
+
* Module: Added Dynamic Taxonomy module
|
152 |
+
* Admin: Added WP Options page
|
153 |
+
* Field: Added Post Type Selection field
|
154 |
+
* Field: Added Taxonomy Selection field
|
155 |
+
* Field: Added Slug field
|
156 |
+
* Field Groups: Fixed 'no field groups found' wrong colspan
|
157 |
+
* General: Reworked plugin folders and files hierarchy
|
158 |
+
|
159 |
= 0.5.2.3 =
|
160 |
* Field Groups: Fixed unused category column on Field Groups Sync page
|
161 |
* Fields: Fixed subfields 'ghost' acfcloneindex saved when duplicating flexible content (thanks to @AsmussenBrandon)
|