form
6 years ago
author.php
6 years ago
autosync.php
6 years ago
dev.php
6 years ago
dynamic-block-type.php
6 years ago
dynamic-form.php
6 years ago
dynamic-options-page.php
6 years ago
dynamic-post-type.php
6 years ago
dynamic-taxonomy.php
6 years ago
taxonomy.php
6 years ago
dynamic-taxonomy.php
2105 lines
| 1 | <?php |
| 2 | |
| 3 | if(!defined('ABSPATH')) |
| 4 | exit; |
| 5 | |
| 6 | // Check setting |
| 7 | if(!acf_get_setting('acfe/modules/dynamic_taxonomies')) |
| 8 | return; |
| 9 | |
| 10 | /** |
| 11 | * Register Dynamic Taxonomy |
| 12 | */ |
| 13 | add_action('init', 'acfe_dt_register'); |
| 14 | function acfe_dt_register(){ |
| 15 | |
| 16 | register_post_type('acfe-dt', array( |
| 17 | 'label' => 'Taxonomies', |
| 18 | 'description' => 'Taxonomies', |
| 19 | 'labels' => array( |
| 20 | 'name' => 'Taxonomies', |
| 21 | 'singular_name' => 'Taxonomy', |
| 22 | 'menu_name' => 'Taxonomies', |
| 23 | 'edit_item' => 'Edit Taxonomy', |
| 24 | 'add_new_item' => 'New Taxonomy', |
| 25 | ), |
| 26 | 'supports' => false, |
| 27 | 'hierarchical' => false, |
| 28 | 'public' => false, |
| 29 | 'show_ui' => true, |
| 30 | 'show_in_menu' => 'tools.php', |
| 31 | 'menu_icon' => 'dashicons-layout', |
| 32 | 'show_in_admin_bar' => false, |
| 33 | 'show_in_nav_menus' => false, |
| 34 | 'can_export' => false, |
| 35 | 'has_archive' => false, |
| 36 | 'rewrite' => false, |
| 37 | 'exclude_from_search' => true, |
| 38 | 'publicly_queryable' => false, |
| 39 | 'capabilities' => array( |
| 40 | 'publish_posts' => acf_get_setting('capability'), |
| 41 | 'edit_posts' => acf_get_setting('capability'), |
| 42 | 'edit_others_posts' => acf_get_setting('capability'), |
| 43 | 'delete_posts' => acf_get_setting('capability'), |
| 44 | 'delete_others_posts' => acf_get_setting('capability'), |
| 45 | 'read_private_posts' => acf_get_setting('capability'), |
| 46 | 'edit_post' => acf_get_setting('capability'), |
| 47 | 'delete_post' => acf_get_setting('capability'), |
| 48 | 'read_post' => acf_get_setting('capability'), |
| 49 | ) |
| 50 | )); |
| 51 | |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * WP Register Taxonomies |
| 56 | */ |
| 57 | add_action('init', 'acfe_dt_registers'); |
| 58 | function acfe_dt_registers(){ |
| 59 | |
| 60 | $dynamic_taxonomies = get_option('acfe_dynamic_taxonomies', array()); |
| 61 | if(empty($dynamic_taxonomies)) |
| 62 | return; |
| 63 | |
| 64 | foreach($dynamic_taxonomies as $name => $register_args){ |
| 65 | |
| 66 | // Extract 'post_types' from 'register_args' |
| 67 | $post_types = acf_extract_var($register_args, 'post_types', array()); |
| 68 | |
| 69 | // Register: Execute |
| 70 | register_taxonomy($name, $post_types, $register_args); |
| 71 | |
| 72 | // Filter Admin: Posts Per Page |
| 73 | add_filter('edit_' . $name . '_per_page', 'acfe_dt_filter_admin_ppp'); |
| 74 | |
| 75 | } |
| 76 | |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * ACF Exclude Dynamic Taxonomy from available post types |
| 81 | */ |
| 82 | add_filter('acf/get_post_types', 'acfe_dt_exclude', 10, 2); |
| 83 | function acfe_dt_exclude($post_types, $args){ |
| 84 | |
| 85 | if(empty($post_types)) |
| 86 | return $post_types; |
| 87 | |
| 88 | foreach($post_types as $k => $post_type){ |
| 89 | |
| 90 | if($post_type != 'acfe-dt') |
| 91 | continue; |
| 92 | |
| 93 | unset($post_types[$k]); |
| 94 | |
| 95 | } |
| 96 | |
| 97 | return $post_types; |
| 98 | |
| 99 | } |
| 100 | |
| 101 | /** |
| 102 | * Dynamic Taxonomy Save |
| 103 | */ |
| 104 | add_action('acf/save_post', 'acfe_dt_filter_save', 20); |
| 105 | function acfe_dt_filter_save($post_id){ |
| 106 | |
| 107 | if(get_post_type($post_id) != 'acfe-dt') |
| 108 | return; |
| 109 | |
| 110 | $title = get_field('label', $post_id); |
| 111 | $name = get_field('acfe_dt_name', $post_id); |
| 112 | |
| 113 | // Update post |
| 114 | wp_update_post(array( |
| 115 | 'ID' => $post_id, |
| 116 | 'post_title' => $title, |
| 117 | 'post_name' => $name, |
| 118 | )); |
| 119 | |
| 120 | // Register Args |
| 121 | $label = get_field('label', $post_id); |
| 122 | $description = get_field('description', $post_id); |
| 123 | $hierarchical = get_field('hierarchical', $post_id); |
| 124 | $post_types = get_field('post_types', $post_id); |
| 125 | $public = get_field('public', $post_id); |
| 126 | $publicly_queryable = get_field('publicly_queryable', $post_id); |
| 127 | $update_count_callback = get_field('update_count_callback', $post_id); |
| 128 | $sort = get_field('sort', $post_id); |
| 129 | |
| 130 | // Labels |
| 131 | $labels = get_field('labels', $post_id); |
| 132 | $labels_args = array(); |
| 133 | foreach($labels as $k => $l){ |
| 134 | if(empty($l)) |
| 135 | continue; |
| 136 | |
| 137 | $labels_args[$k] = $l; |
| 138 | } |
| 139 | |
| 140 | // Menu |
| 141 | $show_ui = get_field('show_ui', $post_id); |
| 142 | $show_in_menu = get_field('show_in_menu', $post_id); |
| 143 | $show_in_nav_menus = get_field('show_in_nav_menus', $post_id); |
| 144 | $show_tagcloud = get_field('show_tagcloud', $post_id); |
| 145 | $meta_box_cb = get_field('meta_box_cb', $post_id); |
| 146 | $meta_box_cb_custom = get_field('meta_box_cb_custom', $post_id); |
| 147 | $show_in_quick_edit = get_field('show_in_quick_edit', $post_id); |
| 148 | $show_admin_column = get_field('show_admin_column', $post_id); |
| 149 | |
| 150 | // Capability |
| 151 | $capabilities = acf_decode_choices(get_field('capabilities', $post_id), true); |
| 152 | |
| 153 | // Single |
| 154 | $single_template = get_field('acfe_dt_single_template', $post_id); |
| 155 | $single_posts_per_page = (int) get_field('acfe_dt_single_posts_per_page', $post_id); |
| 156 | $single_orderby = get_field('acfe_dt_single_orderby', $post_id); |
| 157 | $single_order = get_field('acfe_dt_single_order', $post_id); |
| 158 | $rewrite = get_field('rewrite', $post_id); |
| 159 | $rewrite_args_select = get_field('rewrite_args_select', $post_id); |
| 160 | $rewrite_args = get_field('rewrite_args', $post_id); |
| 161 | |
| 162 | // Admin |
| 163 | $admin_posts_per_page = (int) get_field('acfe_dt_admin_terms_per_page', $post_id); |
| 164 | $admin_orderby = get_field('acfe_dt_admin_orderby', $post_id); |
| 165 | $admin_order = get_field('acfe_dt_admin_order', $post_id); |
| 166 | |
| 167 | // REST |
| 168 | $show_in_rest = get_field('show_in_rest', $post_id); |
| 169 | $rest_base = get_field('rest_base', $post_id); |
| 170 | $rest_controller_class = get_field('rest_controller_class', $post_id); |
| 171 | |
| 172 | // Register: Args |
| 173 | $register_args = array( |
| 174 | 'label' => $label, |
| 175 | 'description' => $description, |
| 176 | 'hierarchical' => $hierarchical, |
| 177 | 'post_types' => $post_types, |
| 178 | 'public' => $public, |
| 179 | 'publicly_queryable' => $publicly_queryable, |
| 180 | 'update_count_callback' => $update_count_callback, |
| 181 | 'sort' => $sort, |
| 182 | |
| 183 | // Labels |
| 184 | 'labels' => $labels_args, |
| 185 | |
| 186 | // Menu |
| 187 | 'show_ui' => $show_ui, |
| 188 | 'show_in_menu' => $show_in_menu, |
| 189 | 'show_in_nav_menus' => $show_in_nav_menus, |
| 190 | 'show_tagcloud' => $show_tagcloud, |
| 191 | 'show_in_quick_edit' => $show_in_quick_edit, |
| 192 | 'show_admin_column' => $show_admin_column, |
| 193 | |
| 194 | // Single |
| 195 | 'rewrite' => $rewrite, |
| 196 | |
| 197 | // REST |
| 198 | 'show_in_rest' => $show_in_rest, |
| 199 | 'rest_base' => $rest_base, |
| 200 | 'rest_controller_class' => $rest_controller_class, |
| 201 | |
| 202 | // ACFE: Single |
| 203 | 'acfe_single_template' => $single_template, |
| 204 | 'acfe_single_ppp' => $single_posts_per_page, |
| 205 | 'acfe_single_orderby' => $single_orderby, |
| 206 | 'acfe_single_order' => $single_order, |
| 207 | |
| 208 | // ACFE: Admin |
| 209 | 'acfe_admin_ppp' => $admin_posts_per_page, |
| 210 | 'acfe_admin_orderby' => $admin_orderby, |
| 211 | 'acfe_admin_order' => $admin_order, |
| 212 | ); |
| 213 | |
| 214 | // Rewrite: override |
| 215 | if($rewrite && $rewrite_args_select){ |
| 216 | |
| 217 | $register_args['rewrite'] = array( |
| 218 | 'slug' => $rewrite_args['acfe_dt_rewrite_slug'], |
| 219 | 'with_front' => $rewrite_args['acfe_dt_rewrite_with_front'], |
| 220 | 'hierarchical' => $rewrite_args['hierarchical'] |
| 221 | ); |
| 222 | |
| 223 | } |
| 224 | |
| 225 | // Capabilities |
| 226 | $register_args['capabilities'] = $capabilities; |
| 227 | |
| 228 | // Metabox CB |
| 229 | $register_args['meta_box_cb'] = null; |
| 230 | |
| 231 | if($meta_box_cb === 'false') |
| 232 | $register_args['meta_box_cb'] = false; |
| 233 | |
| 234 | elseif($meta_box_cb === 'custom') |
| 235 | $register_args['meta_box_cb'] = $meta_box_cb_custom; |
| 236 | |
| 237 | // Get ACFE option |
| 238 | $option = get_option('acfe_dynamic_taxonomies', array()); |
| 239 | |
| 240 | // Create ACFE option |
| 241 | $option[$name] = $register_args; |
| 242 | |
| 243 | // Sort keys ASC |
| 244 | ksort($option); |
| 245 | |
| 246 | // Update ACFE option |
| 247 | update_option('acfe_dynamic_taxonomies', $option); |
| 248 | |
| 249 | // Flush permalinks |
| 250 | flush_rewrite_rules(); |
| 251 | |
| 252 | } |
| 253 | |
| 254 | /** |
| 255 | * Dynamic Taxonomy Status Publish > Trash |
| 256 | */ |
| 257 | add_action('publish_to_trash', 'acfe_dt_filter_status_trash'); |
| 258 | function acfe_dt_filter_status_trash($post){ |
| 259 | |
| 260 | if(get_post_type($post->ID) != 'acfe-dt') |
| 261 | return; |
| 262 | |
| 263 | $post_id = $post->ID; |
| 264 | $name = get_field('acfe_dt_name', $post_id); |
| 265 | |
| 266 | // Get ACFE option |
| 267 | $option = get_option('acfe_dynamic_taxonomies', array()); |
| 268 | |
| 269 | // Check ACFE option |
| 270 | if(isset($option[$name])) |
| 271 | unset($option[$name]); |
| 272 | |
| 273 | // Update ACFE option |
| 274 | update_option('acfe_dynamic_taxonomies', $option); |
| 275 | |
| 276 | // Flush permalinks |
| 277 | flush_rewrite_rules(); |
| 278 | |
| 279 | } |
| 280 | |
| 281 | /** |
| 282 | * Dynamic Taxonomy Status Trash > Publish |
| 283 | */ |
| 284 | add_action('trash_to_publish', 'acfe_dt_filter_status_publish'); |
| 285 | function acfe_dt_filter_status_publish($post){ |
| 286 | |
| 287 | if(get_post_type($post->ID) != 'acfe-dt') |
| 288 | return; |
| 289 | |
| 290 | acfe_dt_filter_save($post->ID); |
| 291 | |
| 292 | } |
| 293 | |
| 294 | /** |
| 295 | * Dynamic Taxonomy Admin: List |
| 296 | */ |
| 297 | add_action('pre_get_posts', 'acfe_dt_admin_pre_get_posts'); |
| 298 | function acfe_dt_admin_pre_get_posts($query){ |
| 299 | |
| 300 | if(!is_admin() || !$query->is_main_query()) |
| 301 | return; |
| 302 | |
| 303 | global $pagenow; |
| 304 | if($pagenow != 'edit.php') |
| 305 | return; |
| 306 | |
| 307 | $post_type = $query->get('post_type'); |
| 308 | if($post_type != 'acfe-dt') |
| 309 | return; |
| 310 | |
| 311 | $query->set('orderby', 'name'); |
| 312 | $query->set('order', 'ASC'); |
| 313 | |
| 314 | } |
| 315 | |
| 316 | /** |
| 317 | * Dynamic Taxonomy Admin: Posts Per Page |
| 318 | */ |
| 319 | add_filter('edit_posts_per_page', 'acfe_dt_admin_ppp', 10, 2); |
| 320 | function acfe_dt_admin_ppp($ppp, $post_type){ |
| 321 | |
| 322 | if($post_type != 'acfe-dt') |
| 323 | return $ppp; |
| 324 | |
| 325 | global $pagenow; |
| 326 | if($pagenow != 'edit.php') |
| 327 | return $ppp; |
| 328 | |
| 329 | return 999; |
| 330 | |
| 331 | } |
| 332 | |
| 333 | /** |
| 334 | * Filter Admin: List |
| 335 | */ |
| 336 | add_filter('get_terms_args', 'acfe_dt_filter_admin_list', 10, 2); |
| 337 | function acfe_dt_filter_admin_list($args, $taxonomies){ |
| 338 | |
| 339 | if(!is_admin()) |
| 340 | return $args; |
| 341 | |
| 342 | global $pagenow; |
| 343 | if($pagenow != 'edit-tags.php') |
| 344 | return $args; |
| 345 | |
| 346 | if(empty($taxonomies)) |
| 347 | return $args; |
| 348 | |
| 349 | $taxonomy = array_shift($taxonomies); |
| 350 | $taxonomy_obj = get_taxonomy($taxonomy); |
| 351 | |
| 352 | $acfe_admin_orderby = (isset($taxonomy_obj->acfe_admin_orderby) && !empty($taxonomy_obj->acfe_admin_orderby)); |
| 353 | $acfe_admin_order = (isset($taxonomy_obj->acfe_admin_order) && !empty($taxonomy_obj->acfe_admin_order)); |
| 354 | |
| 355 | if($acfe_admin_orderby && (!isset($_REQUEST['orderby']) || empty($_REQUEST['orderby']))) |
| 356 | $args['orderby'] = $taxonomy_obj->acfe_admin_orderby; |
| 357 | |
| 358 | if($acfe_admin_order && (!isset($_REQUEST['order']) || empty($_REQUEST['order']))) |
| 359 | $args['order'] = $taxonomy_obj->acfe_admin_order; |
| 360 | |
| 361 | return $args; |
| 362 | |
| 363 | } |
| 364 | |
| 365 | /** |
| 366 | * Filter Admin: Posts Per Page |
| 367 | */ |
| 368 | function acfe_dt_filter_admin_ppp($ppp){ |
| 369 | |
| 370 | global $pagenow; |
| 371 | if($pagenow != 'edit-tags.php') |
| 372 | return $ppp; |
| 373 | |
| 374 | $taxonomy = $_GET['taxonomy']; |
| 375 | if(empty($taxonomy)) |
| 376 | return $ppp; |
| 377 | |
| 378 | $taxonomy_obj = get_taxonomy($taxonomy); |
| 379 | if(!isset($taxonomy_obj->acfe_admin_ppp) || empty($taxonomy_obj->acfe_admin_ppp)) |
| 380 | return $ppp; |
| 381 | |
| 382 | // Check if user has a screen option |
| 383 | if(!empty(get_user_option('edit_' . $taxonomy . '_per_page'))) |
| 384 | return $ppp; |
| 385 | |
| 386 | return $taxonomy_obj->acfe_admin_ppp; |
| 387 | |
| 388 | } |
| 389 | |
| 390 | /** |
| 391 | * Filter Front: List + Posts Per Page |
| 392 | */ |
| 393 | add_action('pre_get_posts', 'acfe_dt_filter_front_list'); |
| 394 | function acfe_dt_filter_front_list($query){ |
| 395 | |
| 396 | if(is_admin() || !$query->is_main_query() || !is_tax()) |
| 397 | return; |
| 398 | |
| 399 | $taxonomy = $query->get('taxonomy'); |
| 400 | $taxonomy_obj = get_taxonomy($taxonomy); |
| 401 | |
| 402 | $acfe_single_ppp = (isset($taxonomy_obj->acfe_single_ppp) && !empty($taxonomy_obj->acfe_single_ppp)); |
| 403 | $acfe_single_orderby = (isset($taxonomy_obj->acfe_single_orderby) && !empty($taxonomy_obj->acfe_single_orderby)); |
| 404 | $acfe_single_order = (isset($taxonomy_obj->acfe_single_order) && !empty($taxonomy_obj->acfe_single_order)); |
| 405 | |
| 406 | if($acfe_single_ppp) |
| 407 | $query->set('posts_per_page', $taxonomy_obj->acfe_single_ppp); |
| 408 | |
| 409 | if($acfe_single_orderby) |
| 410 | $query->set('orderby', $taxonomy_obj->acfe_single_orderby); |
| 411 | |
| 412 | if($acfe_single_order) |
| 413 | $query->set('order', $taxonomy_obj->acfe_single_order); |
| 414 | |
| 415 | } |
| 416 | |
| 417 | /** |
| 418 | * Filter Front: Template |
| 419 | */ |
| 420 | add_filter('template_include', 'acfe_dt_filter_template', 999); |
| 421 | function acfe_dt_filter_template($template){ |
| 422 | |
| 423 | if(!is_tax() && !is_category() && !is_tag()) |
| 424 | return $template; |
| 425 | |
| 426 | if(!isset(get_queried_object()->taxonomy)) |
| 427 | return $template; |
| 428 | |
| 429 | $taxonomy_obj = get_queried_object()->taxonomy; |
| 430 | |
| 431 | foreach(get_taxonomies(array('public' => true), 'objects') as $taxonomy){ |
| 432 | if($taxonomy_obj != $taxonomy->name || !isset($taxonomy->acfe_single_template)) |
| 433 | continue; |
| 434 | |
| 435 | if($locate = locate_template(array($taxonomy->acfe_single_template))) |
| 436 | return $locate; |
| 437 | } |
| 438 | |
| 439 | return $template; |
| 440 | |
| 441 | } |
| 442 | |
| 443 | /** |
| 444 | * Admin List Columns |
| 445 | */ |
| 446 | add_filter('manage_edit-acfe-dt_columns', 'acfe_dt_admin_columns'); |
| 447 | function acfe_dt_admin_columns($columns){ |
| 448 | |
| 449 | if(isset($columns['date'])) |
| 450 | unset($columns['date']); |
| 451 | |
| 452 | $columns['acfe-name'] = __('Name'); |
| 453 | $columns['acfe-post-types'] = __('Post Types'); |
| 454 | $columns['acfe-terms'] = __('Terms'); |
| 455 | |
| 456 | return $columns; |
| 457 | |
| 458 | } |
| 459 | |
| 460 | /** |
| 461 | * Admin List Columns HTML |
| 462 | */ |
| 463 | add_action('manage_acfe-dt_posts_custom_column', 'acfe_dt_admin_columns_html', 10, 2); |
| 464 | function acfe_dt_admin_columns_html($column, $post_id){ |
| 465 | |
| 466 | // Name |
| 467 | if($column === 'acfe-name'){ |
| 468 | |
| 469 | echo '<code style="-webkit-user-select: all;-moz-user-select: all;-ms-user-select: all;user-select: all;font-size: 12px;">' . get_field('acfe_dt_name', $post_id) . '</code>'; |
| 470 | |
| 471 | } |
| 472 | |
| 473 | // Post Types |
| 474 | elseif($column === 'acfe-post-types'){ |
| 475 | |
| 476 | $post_types = get_field('post_types', $post_id); |
| 477 | |
| 478 | if(empty($post_types)){ |
| 479 | |
| 480 | echo '—'; |
| 481 | return; |
| 482 | |
| 483 | } |
| 484 | |
| 485 | $post_types_names = array(); |
| 486 | foreach($post_types as $post_type_slug){ |
| 487 | |
| 488 | $post_type_obj = get_post_type_object($post_type_slug); |
| 489 | if(empty($post_type_obj)) |
| 490 | continue; |
| 491 | |
| 492 | $post_types_names[] = $post_type_obj->label; |
| 493 | |
| 494 | } |
| 495 | |
| 496 | if(empty($post_types_names)){ |
| 497 | |
| 498 | echo '—'; |
| 499 | return; |
| 500 | |
| 501 | } |
| 502 | |
| 503 | echo implode(', ', $post_types_names); |
| 504 | |
| 505 | } |
| 506 | |
| 507 | // Terms |
| 508 | elseif($column === 'acfe-terms'){ |
| 509 | |
| 510 | // Name |
| 511 | $name = get_field('acfe_dt_name', $post_id); |
| 512 | |
| 513 | // Count |
| 514 | $count = wp_count_terms($name, array( |
| 515 | 'hide_empty' => false |
| 516 | )); |
| 517 | |
| 518 | echo '<a href="' . admin_url('edit-tags.php?taxonomy=' . $name) . '">' . $count . '</a>'; |
| 519 | |
| 520 | } |
| 521 | |
| 522 | } |
| 523 | |
| 524 | /** |
| 525 | * Admin List Row Actions |
| 526 | */ |
| 527 | add_filter('post_row_actions','acfe_dt_admin_row', 10, 2); |
| 528 | function acfe_dt_admin_row($actions, $post){ |
| 529 | |
| 530 | if($post->post_type != 'acfe-dt' || $post->post_status != 'publish') |
| 531 | return $actions; |
| 532 | |
| 533 | $post_id = $post->ID; |
| 534 | $name = get_field('acfe_dt_name', $post_id); |
| 535 | |
| 536 | $actions['acfe_dpt_export_json'] = '<a href="' . admin_url('edit.php?post_type=acf-field-group&page=acf-tools&tool=acfe_tool_dt_export&keys=' . $name) . '">' . __('Json') . '</a>'; |
| 537 | |
| 538 | return $actions; |
| 539 | |
| 540 | } |
| 541 | |
| 542 | /** |
| 543 | * Admin Disable Name |
| 544 | */ |
| 545 | add_filter('acf/prepare_field/name=acfe_dt_name', 'acfe_dt_admin_disable_name'); |
| 546 | function acfe_dt_admin_disable_name($field){ |
| 547 | |
| 548 | global $pagenow; |
| 549 | if($pagenow != 'post.php') |
| 550 | return $field; |
| 551 | |
| 552 | $field['disabled'] = true; |
| 553 | |
| 554 | return $field; |
| 555 | |
| 556 | } |
| 557 | |
| 558 | /** |
| 559 | * Admin Validate Name |
| 560 | */ |
| 561 | add_filter('acf/validate_value/name=acfe_dt_name', 'acfe_dt_admin_validate_name', 10, 4); |
| 562 | function acfe_dt_admin_validate_name($valid, $value, $field, $input){ |
| 563 | |
| 564 | if(!$valid) |
| 565 | return $valid; |
| 566 | |
| 567 | // Reserved taxonomies |
| 568 | $excludes = array( |
| 569 | |
| 570 | // Reserved WP Taxonomies: https://codex.wordpress.org/Function_Reference/register_taxonomy#Reserved_Terms |
| 571 | 'attachment', |
| 572 | 'attachment_id', |
| 573 | 'author', |
| 574 | 'author_name', |
| 575 | 'calendar', |
| 576 | 'cat', |
| 577 | 'category', |
| 578 | 'category__and', |
| 579 | 'category__in', |
| 580 | 'category__not_in', |
| 581 | 'category_name', |
| 582 | 'comments_per_page', |
| 583 | 'comments_popup', |
| 584 | 'customize_messenger_channel', |
| 585 | 'customized', |
| 586 | 'cpage', |
| 587 | 'day', |
| 588 | 'debug', |
| 589 | 'error', |
| 590 | 'exact', |
| 591 | 'feed', |
| 592 | 'fields', |
| 593 | 'hour', |
| 594 | 'link_category', |
| 595 | 'm', |
| 596 | 'minute', |
| 597 | 'monthnum', |
| 598 | 'more', |
| 599 | 'name', |
| 600 | 'nav_menu', |
| 601 | 'nonce', |
| 602 | 'nopaging', |
| 603 | 'offset', |
| 604 | 'order', |
| 605 | 'orderby', |
| 606 | 'p', |
| 607 | 'page', |
| 608 | 'page_id', |
| 609 | 'paged', |
| 610 | 'pagename', |
| 611 | 'pb', |
| 612 | 'perm', |
| 613 | 'post', |
| 614 | 'post__in', |
| 615 | 'post__not_in', |
| 616 | 'post_format', |
| 617 | 'post_mime_type', |
| 618 | 'post_status', |
| 619 | 'post_tag', |
| 620 | 'post_type', |
| 621 | 'posts', |
| 622 | 'posts_per_archive_page', |
| 623 | 'posts_per_page', |
| 624 | 'preview', |
| 625 | 'robots', |
| 626 | 's', |
| 627 | 'search', |
| 628 | 'second', |
| 629 | 'sentence', |
| 630 | 'showposts', |
| 631 | 'static', |
| 632 | 'subpost', |
| 633 | 'subpost_id', |
| 634 | 'tag', |
| 635 | 'tag__and', |
| 636 | 'tag__in', |
| 637 | 'tag__not_in', |
| 638 | 'tag_id', |
| 639 | 'tag_slug__and', |
| 640 | 'tag_slug__in', |
| 641 | 'taxonomy', |
| 642 | 'tb', |
| 643 | 'term', |
| 644 | 'theme', |
| 645 | 'type', |
| 646 | 'w', |
| 647 | 'withcomments', |
| 648 | 'withoutcomments', |
| 649 | 'year', |
| 650 | |
| 651 | // ACF Extended |
| 652 | 'acf-field-group-category', |
| 653 | |
| 654 | ); |
| 655 | |
| 656 | if(in_array($value, $excludes)) |
| 657 | return __('This taxonomy name is reserved'); |
| 658 | |
| 659 | // Editing Current Dynamic Taxonomy |
| 660 | $current_post_id = $_POST['_acf_post_id']; |
| 661 | $current_post_type = false; |
| 662 | |
| 663 | if(!empty($current_post_id)) |
| 664 | $current_post_type = get_field('acfe_dt_name', $current_post_id); |
| 665 | |
| 666 | if($value === $current_post_type) |
| 667 | return $valid; |
| 668 | |
| 669 | // Listing WP Taxonomies |
| 670 | global $wp_taxonomies; |
| 671 | if(!empty($wp_taxonomies)){ |
| 672 | foreach($wp_taxonomies as $taxonomy){ |
| 673 | if($value != $taxonomy->name) |
| 674 | continue; |
| 675 | |
| 676 | $valid = __('This taxonomy name already exists'); |
| 677 | } |
| 678 | } |
| 679 | |
| 680 | return $valid; |
| 681 | |
| 682 | } |
| 683 | |
| 684 | /** |
| 685 | * Admin Add Config Button |
| 686 | */ |
| 687 | add_action('admin_footer-edit-tags.php', 'acfe_dt_admin_footer', 99); |
| 688 | function acfe_dt_admin_footer(){ |
| 689 | |
| 690 | if(!current_user_can(acf_get_setting('capability'))) |
| 691 | return; |
| 692 | |
| 693 | // Get taxonomy |
| 694 | global $taxnow; |
| 695 | |
| 696 | // Check taxonomy |
| 697 | $taxonomy = $taxnow; |
| 698 | if(empty($taxonomy)) |
| 699 | return; |
| 700 | |
| 701 | // Taxonomy object |
| 702 | $taxonomy_obj = get_taxonomy($taxonomy); |
| 703 | if(!isset($taxonomy_obj->acfe_admin_ppp)) |
| 704 | return; |
| 705 | |
| 706 | // Get Dynamic Post Type Post |
| 707 | $acfe_dt_post_type = get_page_by_path($taxonomy, 'OBJECT', 'acfe-dt'); |
| 708 | |
| 709 | if(empty($acfe_dt_post_type)) |
| 710 | return; |
| 711 | |
| 712 | ?> |
| 713 | <script type="text/html" id="tmpl-acfe-dt-title-config"> |
| 714 | <a href="<?php echo admin_url('post.php?post=' . $acfe_dt_post_type->ID . '&action=edit'); ?>" class="page-title-action acfe-dt-admin-config"><span class="dashicons dashicons-admin-generic"></span></a> |
| 715 | </script> |
| 716 | |
| 717 | <script type="text/javascript"> |
| 718 | (function($){ |
| 719 | |
| 720 | // Add button |
| 721 | $('.wrap .wp-heading-inline').after($('#tmpl-acfe-dt-title-config').html()); |
| 722 | |
| 723 | })(jQuery); |
| 724 | </script> |
| 725 | <?php |
| 726 | |
| 727 | } |
| 728 | |
| 729 | /** |
| 730 | * Add Local Field Group |
| 731 | */ |
| 732 | acf_add_local_field_group(array( |
| 733 | 'key' => 'group_acfe_dynamic_taxonomy', |
| 734 | 'title' => __('Dynamic Taxonomy', 'acfe'), |
| 735 | |
| 736 | 'location' => array( |
| 737 | array( |
| 738 | array( |
| 739 | 'param' => 'post_type', |
| 740 | 'operator' => '==', |
| 741 | 'value' => 'acfe-dt', |
| 742 | ), |
| 743 | ), |
| 744 | ), |
| 745 | |
| 746 | 'menu_order' => 0, |
| 747 | 'position' => 'normal', |
| 748 | 'style' => 'default', |
| 749 | 'label_placement' => 'left', |
| 750 | 'instruction_placement' => 'label', |
| 751 | 'hide_on_screen' => '', |
| 752 | 'active' => 1, |
| 753 | 'description' => '', |
| 754 | |
| 755 | 'fields' => array( |
| 756 | array( |
| 757 | 'key' => 'field_acfe_dt_tab_general', |
| 758 | 'label' => 'General', |
| 759 | 'name' => '', |
| 760 | 'type' => 'tab', |
| 761 | 'instructions' => '', |
| 762 | 'required' => 0, |
| 763 | 'conditional_logic' => 0, |
| 764 | 'wrapper' => array( |
| 765 | 'width' => '', |
| 766 | 'class' => '', |
| 767 | 'id' => '', |
| 768 | ), |
| 769 | 'acfe_permissions' => '', |
| 770 | 'placement' => 'top', |
| 771 | 'endpoint' => 0, |
| 772 | ), |
| 773 | array( |
| 774 | 'key' => 'field_acfe_dt_label', |
| 775 | 'label' => 'Label', |
| 776 | 'name' => 'label', |
| 777 | 'type' => 'text', |
| 778 | 'instructions' => 'A plural descriptive name for the taxonomy marked for translation', |
| 779 | 'required' => 1, |
| 780 | 'conditional_logic' => 0, |
| 781 | 'wrapper' => array( |
| 782 | 'width' => '', |
| 783 | 'class' => '', |
| 784 | 'id' => '', |
| 785 | ), |
| 786 | 'acfe_validate' => '', |
| 787 | 'acfe_update' => '', |
| 788 | 'acfe_permissions' => '', |
| 789 | 'default_value' => '', |
| 790 | 'placeholder' => '', |
| 791 | 'prepend' => '', |
| 792 | 'append' => '', |
| 793 | 'maxlength' => '', |
| 794 | ), |
| 795 | array( |
| 796 | 'key' => 'field_acfe_dt_name', |
| 797 | 'label' => 'Name', |
| 798 | 'name' => 'acfe_dt_name', |
| 799 | 'type' => 'acfe_slug', |
| 800 | '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)', |
| 801 | 'required' => 1, |
| 802 | 'conditional_logic' => 0, |
| 803 | 'wrapper' => array( |
| 804 | 'width' => '', |
| 805 | 'class' => '', |
| 806 | 'id' => '', |
| 807 | ), |
| 808 | 'acfe_validate' => '', |
| 809 | 'acfe_update' => '', |
| 810 | 'acfe_permissions' => '', |
| 811 | 'default_value' => '', |
| 812 | 'placeholder' => '', |
| 813 | 'prepend' => '', |
| 814 | 'append' => '', |
| 815 | 'maxlength' => 32, |
| 816 | ), |
| 817 | array( |
| 818 | 'key' => 'field_acfe_dt_description', |
| 819 | 'label' => 'Description', |
| 820 | 'name' => 'description', |
| 821 | 'type' => 'text', |
| 822 | 'instructions' => 'Include a description of the taxonomy', |
| 823 | 'required' => 0, |
| 824 | 'conditional_logic' => 0, |
| 825 | 'wrapper' => array( |
| 826 | 'width' => '', |
| 827 | 'class' => '', |
| 828 | 'id' => '', |
| 829 | ), |
| 830 | 'acfe_validate' => '', |
| 831 | 'acfe_update' => '', |
| 832 | 'acfe_permissions' => '', |
| 833 | 'default_value' => '', |
| 834 | 'placeholder' => '', |
| 835 | 'prepend' => '', |
| 836 | 'append' => '', |
| 837 | 'maxlength' => '', |
| 838 | ), |
| 839 | array( |
| 840 | 'key' => 'field_acfe_dt_hierarchical', |
| 841 | 'label' => 'Hierarchical', |
| 842 | 'name' => 'hierarchical', |
| 843 | 'type' => 'true_false', |
| 844 | 'instructions' => 'Is this taxonomy hierarchical (have descendants) like categories or not hierarchical like tags', |
| 845 | 'required' => 0, |
| 846 | 'conditional_logic' => 0, |
| 847 | 'wrapper' => array( |
| 848 | 'width' => '', |
| 849 | 'class' => '', |
| 850 | 'id' => '', |
| 851 | ), |
| 852 | 'acfe_validate' => '', |
| 853 | 'acfe_update' => '', |
| 854 | 'acfe_permissions' => '', |
| 855 | 'message' => '', |
| 856 | 'default_value' => 0, |
| 857 | 'ui' => 1, |
| 858 | 'ui_on_text' => '', |
| 859 | 'ui_off_text' => '', |
| 860 | ), |
| 861 | array( |
| 862 | 'key' => 'field_acfe_dt_post_types', |
| 863 | 'label' => 'Post types', |
| 864 | 'name' => 'post_types', |
| 865 | 'type' => 'acfe_post_types', |
| 866 | 'instructions' => '', |
| 867 | 'required' => 0, |
| 868 | 'conditional_logic' => 0, |
| 869 | 'wrapper' => array( |
| 870 | 'width' => '', |
| 871 | 'class' => '', |
| 872 | 'id' => '', |
| 873 | ), |
| 874 | 'acfe_validate' => '', |
| 875 | 'acfe_update' => '', |
| 876 | 'acfe_permissions' => '', |
| 877 | 'field_type' => 'checkbox', |
| 878 | 'return_format' => 'name', |
| 879 | ), |
| 880 | array( |
| 881 | 'key' => 'field_acfe_dt_public', |
| 882 | 'label' => 'Public', |
| 883 | 'name' => 'public', |
| 884 | 'type' => 'true_false', |
| 885 | 'instructions' => 'Whether a taxonomy is intended for use publicly either via the admin interface or by front-end users', |
| 886 | 'required' => 0, |
| 887 | 'conditional_logic' => 0, |
| 888 | 'wrapper' => array( |
| 889 | 'width' => '', |
| 890 | 'class' => '', |
| 891 | 'id' => '', |
| 892 | ), |
| 893 | 'acfe_validate' => '', |
| 894 | 'acfe_update' => '', |
| 895 | 'acfe_permissions' => '', |
| 896 | 'message' => '', |
| 897 | 'default_value' => 1, |
| 898 | 'ui' => 1, |
| 899 | 'ui_on_text' => '', |
| 900 | 'ui_off_text' => '', |
| 901 | ), |
| 902 | array( |
| 903 | 'key' => 'field_acfe_dt_publicly_queryable', |
| 904 | 'label' => 'Publicly queryable', |
| 905 | 'name' => 'publicly_queryable', |
| 906 | 'type' => 'true_false', |
| 907 | 'instructions' => 'Whether the taxonomy is publicly queryable', |
| 908 | 'required' => 0, |
| 909 | 'conditional_logic' => 0, |
| 910 | 'wrapper' => array( |
| 911 | 'width' => '', |
| 912 | 'class' => '', |
| 913 | 'id' => '', |
| 914 | ), |
| 915 | 'acfe_validate' => '', |
| 916 | 'acfe_update' => '', |
| 917 | 'acfe_permissions' => '', |
| 918 | 'message' => '', |
| 919 | 'default_value' => 1, |
| 920 | 'ui' => 1, |
| 921 | 'ui_on_text' => '', |
| 922 | 'ui_off_text' => '', |
| 923 | ), |
| 924 | array( |
| 925 | 'key' => 'field_acfe_dt_update_count_callback', |
| 926 | 'label' => 'Update count callback', |
| 927 | 'name' => 'update_count_callback', |
| 928 | 'type' => 'text', |
| 929 | 'instructions' => 'A function name that will be called when the count of an associated $object_type, such as post, is updated', |
| 930 | 'required' => 0, |
| 931 | 'conditional_logic' => 0, |
| 932 | 'wrapper' => array( |
| 933 | 'width' => '', |
| 934 | 'class' => '', |
| 935 | 'id' => '', |
| 936 | ), |
| 937 | 'acfe_validate' => '', |
| 938 | 'acfe_update' => '', |
| 939 | 'acfe_permissions' => '', |
| 940 | 'default_value' => '', |
| 941 | 'placeholder' => '', |
| 942 | 'prepend' => '', |
| 943 | 'append' => '', |
| 944 | 'maxlength' => '', |
| 945 | ), |
| 946 | array( |
| 947 | 'key' => 'field_acfe_dt_meta_box_cb', |
| 948 | 'label' => 'Meta box callback', |
| 949 | 'name' => 'meta_box_cb', |
| 950 | 'type' => 'select', |
| 951 | 'instructions' => 'Provide a callback function name for the meta box display.<br /><br/>Defaults to the categories meta box for hierarchical taxonomies and the tags meta box for non-hierarchical taxonomies. No meta box is shown if set to false.', |
| 952 | 'required' => 0, |
| 953 | 'conditional_logic' => 0, |
| 954 | 'wrapper' => array( |
| 955 | 'width' => '', |
| 956 | 'class' => '', |
| 957 | 'id' => '', |
| 958 | ), |
| 959 | 'acfe_validate' => '', |
| 960 | 'acfe_update' => '', |
| 961 | 'acfe_permissions' => '', |
| 962 | 'choices' => array( |
| 963 | 'null' => 'Null (default)', |
| 964 | 'false' => 'False', |
| 965 | 'custom' => 'Custom', |
| 966 | ), |
| 967 | 'default_value' => array( |
| 968 | 0 => 'null', |
| 969 | ), |
| 970 | 'allow_null' => 0, |
| 971 | 'multiple' => 0, |
| 972 | 'ui' => 0, |
| 973 | 'return_format' => 'value', |
| 974 | 'ajax' => 0, |
| 975 | 'placeholder' => '', |
| 976 | ), |
| 977 | array( |
| 978 | 'key' => 'field_acfe_dt_meta_box_cb_custom', |
| 979 | 'label' => 'Meta box callback', |
| 980 | 'name' => 'meta_box_cb_custom', |
| 981 | 'type' => 'text', |
| 982 | 'instructions' => '', |
| 983 | 'required' => 0, |
| 984 | 'conditional_logic' => 0, |
| 985 | 'wrapper' => array( |
| 986 | 'width' => '', |
| 987 | 'class' => '', |
| 988 | 'id' => '', |
| 989 | ), |
| 990 | 'acfe_validate' => '', |
| 991 | 'acfe_update' => '', |
| 992 | 'acfe_permissions' => '', |
| 993 | 'default_value' => '', |
| 994 | 'placeholder' => '', |
| 995 | 'prepend' => '', |
| 996 | 'append' => '', |
| 997 | 'maxlength' => '', |
| 998 | 'conditional_logic' => array( |
| 999 | array( |
| 1000 | array( |
| 1001 | 'field' => 'field_acfe_dt_meta_box_cb', |
| 1002 | 'operator' => '==', |
| 1003 | 'value' => 'custom', |
| 1004 | ) |
| 1005 | ) |
| 1006 | ) |
| 1007 | ), |
| 1008 | array( |
| 1009 | 'key' => 'field_acfe_dt_sort', |
| 1010 | 'label' => 'Sort', |
| 1011 | 'name' => 'sort', |
| 1012 | 'type' => 'true_false', |
| 1013 | 'instructions' => 'Whether this taxonomy should remember the order in which terms are added to objects', |
| 1014 | 'required' => 0, |
| 1015 | 'conditional_logic' => 0, |
| 1016 | 'wrapper' => array( |
| 1017 | 'width' => '', |
| 1018 | 'class' => '', |
| 1019 | 'id' => '', |
| 1020 | ), |
| 1021 | 'acfe_validate' => '', |
| 1022 | 'acfe_update' => '', |
| 1023 | 'acfe_permissions' => '', |
| 1024 | 'message' => '', |
| 1025 | 'default_value' => 0, |
| 1026 | 'ui' => 1, |
| 1027 | 'ui_on_text' => '', |
| 1028 | 'ui_off_text' => '', |
| 1029 | ), |
| 1030 | array( |
| 1031 | 'key' => 'field_acfe_dt_tab_labels', |
| 1032 | 'label' => 'Labels', |
| 1033 | 'name' => '', |
| 1034 | 'type' => 'tab', |
| 1035 | 'instructions' => '', |
| 1036 | 'required' => 0, |
| 1037 | 'conditional_logic' => 0, |
| 1038 | 'wrapper' => array( |
| 1039 | 'width' => '', |
| 1040 | 'class' => '', |
| 1041 | 'id' => '', |
| 1042 | ), |
| 1043 | 'acfe_permissions' => '', |
| 1044 | 'placement' => 'top', |
| 1045 | 'endpoint' => 0, |
| 1046 | ), |
| 1047 | array( |
| 1048 | 'key' => 'field_acfe_dt_labels', |
| 1049 | 'label' => 'Labels', |
| 1050 | 'name' => 'labels', |
| 1051 | 'type' => 'group', |
| 1052 | '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 /> |
| 1053 | Default: if empty, name is set to label value, and singular_name is set to name value.', |
| 1054 | 'required' => 0, |
| 1055 | 'conditional_logic' => 0, |
| 1056 | 'wrapper' => array( |
| 1057 | 'width' => '', |
| 1058 | 'class' => '', |
| 1059 | 'id' => '', |
| 1060 | ), |
| 1061 | 'acfe_permissions' => '', |
| 1062 | 'layout' => 'row', |
| 1063 | 'sub_fields' => array( |
| 1064 | array( |
| 1065 | 'key' => 'field_acfe_dt_singular_name', |
| 1066 | 'label' => 'Singular name', |
| 1067 | 'name' => 'singular_name', |
| 1068 | 'type' => 'text', |
| 1069 | 'instructions' => '', |
| 1070 | 'required' => 0, |
| 1071 | 'conditional_logic' => 0, |
| 1072 | 'wrapper' => array( |
| 1073 | 'width' => '', |
| 1074 | 'class' => '', |
| 1075 | 'id' => '', |
| 1076 | ), |
| 1077 | 'acfe_validate' => '', |
| 1078 | 'acfe_update' => '', |
| 1079 | 'acfe_permissions' => '', |
| 1080 | 'default_value' => '', |
| 1081 | 'placeholder' => '', |
| 1082 | 'prepend' => '', |
| 1083 | 'append' => '', |
| 1084 | 'maxlength' => '', |
| 1085 | ), |
| 1086 | array( |
| 1087 | 'key' => 'field_acfe_dt_menu_name', |
| 1088 | 'label' => 'Menu name', |
| 1089 | 'name' => 'menu_name', |
| 1090 | 'type' => 'text', |
| 1091 | 'instructions' => '', |
| 1092 | 'required' => 0, |
| 1093 | 'conditional_logic' => 0, |
| 1094 | 'wrapper' => array( |
| 1095 | 'width' => '', |
| 1096 | 'class' => '', |
| 1097 | 'id' => '', |
| 1098 | ), |
| 1099 | 'acfe_validate' => '', |
| 1100 | 'acfe_update' => '', |
| 1101 | 'acfe_permissions' => '', |
| 1102 | 'default_value' => '', |
| 1103 | 'placeholder' => '', |
| 1104 | 'prepend' => '', |
| 1105 | 'append' => '', |
| 1106 | 'maxlength' => '', |
| 1107 | ), |
| 1108 | array( |
| 1109 | 'key' => 'field_acfe_dt_all_items', |
| 1110 | 'label' => 'All items', |
| 1111 | 'name' => 'all_items', |
| 1112 | 'type' => 'text', |
| 1113 | 'instructions' => '', |
| 1114 | 'required' => 0, |
| 1115 | 'conditional_logic' => 0, |
| 1116 | 'wrapper' => array( |
| 1117 | 'width' => '', |
| 1118 | 'class' => '', |
| 1119 | 'id' => '', |
| 1120 | ), |
| 1121 | 'acfe_validate' => '', |
| 1122 | 'acfe_update' => '', |
| 1123 | 'acfe_permissions' => '', |
| 1124 | 'default_value' => '', |
| 1125 | 'placeholder' => '', |
| 1126 | 'prepend' => '', |
| 1127 | 'append' => '', |
| 1128 | 'maxlength' => '', |
| 1129 | ), |
| 1130 | array( |
| 1131 | 'key' => 'field_acfe_dt_edit_item', |
| 1132 | 'label' => 'Edit item', |
| 1133 | 'name' => 'edit_item', |
| 1134 | 'type' => 'text', |
| 1135 | 'instructions' => '', |
| 1136 | 'required' => 0, |
| 1137 | 'conditional_logic' => 0, |
| 1138 | 'wrapper' => array( |
| 1139 | 'width' => '', |
| 1140 | 'class' => '', |
| 1141 | 'id' => '', |
| 1142 | ), |
| 1143 | 'acfe_validate' => '', |
| 1144 | 'acfe_update' => '', |
| 1145 | 'acfe_permissions' => '', |
| 1146 | 'default_value' => '', |
| 1147 | 'placeholder' => '', |
| 1148 | 'prepend' => '', |
| 1149 | 'append' => '', |
| 1150 | 'maxlength' => '', |
| 1151 | ), |
| 1152 | array( |
| 1153 | 'key' => 'field_acfe_dt_view_item', |
| 1154 | 'label' => 'View item', |
| 1155 | 'name' => 'view_item', |
| 1156 | 'type' => 'text', |
| 1157 | 'instructions' => '', |
| 1158 | 'required' => 0, |
| 1159 | 'conditional_logic' => 0, |
| 1160 | 'wrapper' => array( |
| 1161 | 'width' => '', |
| 1162 | 'class' => '', |
| 1163 | 'id' => '', |
| 1164 | ), |
| 1165 | 'acfe_validate' => '', |
| 1166 | 'acfe_update' => '', |
| 1167 | 'acfe_permissions' => '', |
| 1168 | 'default_value' => '', |
| 1169 | 'placeholder' => '', |
| 1170 | 'prepend' => '', |
| 1171 | 'append' => '', |
| 1172 | 'maxlength' => '', |
| 1173 | ), |
| 1174 | array( |
| 1175 | 'key' => 'field_acfe_dt_update_item', |
| 1176 | 'label' => 'Update item', |
| 1177 | 'name' => 'update_item', |
| 1178 | 'type' => 'text', |
| 1179 | 'instructions' => '', |
| 1180 | 'required' => 0, |
| 1181 | 'conditional_logic' => 0, |
| 1182 | 'wrapper' => array( |
| 1183 | 'width' => '', |
| 1184 | 'class' => '', |
| 1185 | 'id' => '', |
| 1186 | ), |
| 1187 | 'acfe_validate' => '', |
| 1188 | 'acfe_update' => '', |
| 1189 | 'acfe_permissions' => '', |
| 1190 | 'default_value' => '', |
| 1191 | 'placeholder' => '', |
| 1192 | 'prepend' => '', |
| 1193 | 'append' => '', |
| 1194 | 'maxlength' => '', |
| 1195 | ), |
| 1196 | array( |
| 1197 | 'key' => 'field_acfe_dt_add_new_item', |
| 1198 | 'label' => 'Add new item', |
| 1199 | 'name' => 'add_new_item', |
| 1200 | 'type' => 'text', |
| 1201 | 'instructions' => '', |
| 1202 | 'required' => 0, |
| 1203 | 'conditional_logic' => 0, |
| 1204 | 'wrapper' => array( |
| 1205 | 'width' => '', |
| 1206 | 'class' => '', |
| 1207 | 'id' => '', |
| 1208 | ), |
| 1209 | 'acfe_validate' => '', |
| 1210 | 'acfe_update' => '', |
| 1211 | 'acfe_permissions' => '', |
| 1212 | 'default_value' => '', |
| 1213 | 'placeholder' => '', |
| 1214 | 'prepend' => '', |
| 1215 | 'append' => '', |
| 1216 | 'maxlength' => '', |
| 1217 | ), |
| 1218 | array( |
| 1219 | 'key' => 'field_acfe_dt_new_item_name', |
| 1220 | 'label' => 'New item name', |
| 1221 | 'name' => 'new_item_name', |
| 1222 | 'type' => 'text', |
| 1223 | 'instructions' => '', |
| 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 | 'prepend' => '', |
| 1237 | 'append' => '', |
| 1238 | 'maxlength' => '', |
| 1239 | ), |
| 1240 | array( |
| 1241 | 'key' => 'field_acfe_dt_parent_item', |
| 1242 | 'label' => 'Parent item', |
| 1243 | 'name' => 'parent_item', |
| 1244 | 'type' => 'text', |
| 1245 | 'instructions' => '', |
| 1246 | 'required' => 0, |
| 1247 | 'conditional_logic' => 0, |
| 1248 | 'wrapper' => array( |
| 1249 | 'width' => '', |
| 1250 | 'class' => '', |
| 1251 | 'id' => '', |
| 1252 | ), |
| 1253 | 'acfe_validate' => '', |
| 1254 | 'acfe_update' => '', |
| 1255 | 'acfe_permissions' => '', |
| 1256 | 'default_value' => '', |
| 1257 | 'placeholder' => '', |
| 1258 | 'prepend' => '', |
| 1259 | 'append' => '', |
| 1260 | 'maxlength' => '', |
| 1261 | ), |
| 1262 | array( |
| 1263 | 'key' => 'field_acfe_dt_parent_item_colon', |
| 1264 | 'label' => 'Parent item colon', |
| 1265 | 'name' => 'parent_item_colon', |
| 1266 | 'type' => 'text', |
| 1267 | 'instructions' => '', |
| 1268 | 'required' => 0, |
| 1269 | 'conditional_logic' => 0, |
| 1270 | 'wrapper' => array( |
| 1271 | 'width' => '', |
| 1272 | 'class' => '', |
| 1273 | 'id' => '', |
| 1274 | ), |
| 1275 | 'acfe_validate' => '', |
| 1276 | 'acfe_update' => '', |
| 1277 | 'acfe_permissions' => '', |
| 1278 | 'default_value' => '', |
| 1279 | 'placeholder' => '', |
| 1280 | 'prepend' => '', |
| 1281 | 'append' => '', |
| 1282 | 'maxlength' => '', |
| 1283 | ), |
| 1284 | array( |
| 1285 | 'key' => 'field_acfe_dt_search_items', |
| 1286 | 'label' => 'Search items', |
| 1287 | 'name' => 'search_items', |
| 1288 | 'type' => 'text', |
| 1289 | 'instructions' => '', |
| 1290 | 'required' => 0, |
| 1291 | 'conditional_logic' => 0, |
| 1292 | 'wrapper' => array( |
| 1293 | 'width' => '', |
| 1294 | 'class' => '', |
| 1295 | 'id' => '', |
| 1296 | ), |
| 1297 | 'acfe_validate' => '', |
| 1298 | 'acfe_update' => '', |
| 1299 | 'acfe_permissions' => '', |
| 1300 | 'default_value' => '', |
| 1301 | 'placeholder' => '', |
| 1302 | 'prepend' => '', |
| 1303 | 'append' => '', |
| 1304 | 'maxlength' => '', |
| 1305 | ), |
| 1306 | array( |
| 1307 | 'key' => 'field_acfe_dt_popular_items', |
| 1308 | 'label' => 'Popular items', |
| 1309 | 'name' => 'popular_items', |
| 1310 | 'type' => 'text', |
| 1311 | 'instructions' => '', |
| 1312 | 'required' => 0, |
| 1313 | 'conditional_logic' => 0, |
| 1314 | 'wrapper' => array( |
| 1315 | 'width' => '', |
| 1316 | 'class' => '', |
| 1317 | 'id' => '', |
| 1318 | ), |
| 1319 | 'acfe_validate' => '', |
| 1320 | 'acfe_update' => '', |
| 1321 | 'acfe_permissions' => '', |
| 1322 | 'default_value' => '', |
| 1323 | 'placeholder' => '', |
| 1324 | 'prepend' => '', |
| 1325 | 'append' => '', |
| 1326 | 'maxlength' => '', |
| 1327 | ), |
| 1328 | array( |
| 1329 | 'key' => 'field_acfe_dt_separate_items_with_commas', |
| 1330 | 'label' => 'Separate items with commas', |
| 1331 | 'name' => 'separate_items_with_commas', |
| 1332 | 'type' => 'text', |
| 1333 | 'instructions' => '', |
| 1334 | 'required' => 0, |
| 1335 | 'conditional_logic' => 0, |
| 1336 | 'wrapper' => array( |
| 1337 | 'width' => '', |
| 1338 | 'class' => '', |
| 1339 | 'id' => '', |
| 1340 | ), |
| 1341 | 'acfe_validate' => '', |
| 1342 | 'acfe_update' => '', |
| 1343 | 'acfe_permissions' => '', |
| 1344 | 'default_value' => '', |
| 1345 | 'placeholder' => '', |
| 1346 | 'prepend' => '', |
| 1347 | 'append' => '', |
| 1348 | 'maxlength' => '', |
| 1349 | ), |
| 1350 | array( |
| 1351 | 'key' => 'field_acfe_dt_add_or_remove_items', |
| 1352 | 'label' => 'Add or remove items', |
| 1353 | 'name' => 'add_or_remove_items', |
| 1354 | 'type' => 'text', |
| 1355 | 'instructions' => '', |
| 1356 | 'required' => 0, |
| 1357 | 'conditional_logic' => 0, |
| 1358 | 'wrapper' => array( |
| 1359 | 'width' => '', |
| 1360 | 'class' => '', |
| 1361 | 'id' => '', |
| 1362 | ), |
| 1363 | 'acfe_validate' => '', |
| 1364 | 'acfe_update' => '', |
| 1365 | 'acfe_permissions' => '', |
| 1366 | 'default_value' => '', |
| 1367 | 'placeholder' => '', |
| 1368 | 'prepend' => '', |
| 1369 | 'append' => '', |
| 1370 | 'maxlength' => '', |
| 1371 | ), |
| 1372 | array( |
| 1373 | 'key' => 'field_acfe_dt_choose_from_most_used', |
| 1374 | 'label' => 'Choose from most used', |
| 1375 | 'name' => 'choose_from_most_used', |
| 1376 | 'type' => 'text', |
| 1377 | 'instructions' => '', |
| 1378 | 'required' => 0, |
| 1379 | 'conditional_logic' => 0, |
| 1380 | 'wrapper' => array( |
| 1381 | 'width' => '', |
| 1382 | 'class' => '', |
| 1383 | 'id' => '', |
| 1384 | ), |
| 1385 | 'acfe_validate' => '', |
| 1386 | 'acfe_update' => '', |
| 1387 | 'acfe_permissions' => '', |
| 1388 | 'default_value' => '', |
| 1389 | 'placeholder' => '', |
| 1390 | 'prepend' => '', |
| 1391 | 'append' => '', |
| 1392 | 'maxlength' => '', |
| 1393 | ), |
| 1394 | array( |
| 1395 | 'key' => 'field_acfe_dt_not_found', |
| 1396 | 'label' => 'Not found', |
| 1397 | 'name' => 'not_found', |
| 1398 | 'type' => 'text', |
| 1399 | 'instructions' => '', |
| 1400 | 'required' => 0, |
| 1401 | 'conditional_logic' => 0, |
| 1402 | 'wrapper' => array( |
| 1403 | 'width' => '', |
| 1404 | 'class' => '', |
| 1405 | 'id' => '', |
| 1406 | ), |
| 1407 | 'acfe_validate' => '', |
| 1408 | 'acfe_update' => '', |
| 1409 | 'acfe_permissions' => '', |
| 1410 | 'default_value' => '', |
| 1411 | 'placeholder' => '', |
| 1412 | 'prepend' => '', |
| 1413 | 'append' => '', |
| 1414 | 'maxlength' => '', |
| 1415 | ), |
| 1416 | array( |
| 1417 | 'key' => 'field_acfe_dt_back_to_items', |
| 1418 | 'label' => 'Back to items', |
| 1419 | 'name' => 'back_to_items', |
| 1420 | 'type' => 'text', |
| 1421 | 'instructions' => '', |
| 1422 | 'required' => 0, |
| 1423 | 'conditional_logic' => 0, |
| 1424 | 'wrapper' => array( |
| 1425 | 'width' => '', |
| 1426 | 'class' => '', |
| 1427 | 'id' => '', |
| 1428 | ), |
| 1429 | 'acfe_validate' => '', |
| 1430 | 'acfe_update' => '', |
| 1431 | 'acfe_permissions' => '', |
| 1432 | 'default_value' => '', |
| 1433 | 'placeholder' => '', |
| 1434 | 'prepend' => '', |
| 1435 | 'append' => '', |
| 1436 | 'maxlength' => '', |
| 1437 | ), |
| 1438 | ), |
| 1439 | ), |
| 1440 | array( |
| 1441 | 'key' => 'field_acfe_dt_tab_menu', |
| 1442 | 'label' => 'Menu', |
| 1443 | 'name' => '', |
| 1444 | 'type' => 'tab', |
| 1445 | 'instructions' => '', |
| 1446 | 'required' => 0, |
| 1447 | 'conditional_logic' => 0, |
| 1448 | 'wrapper' => array( |
| 1449 | 'width' => '', |
| 1450 | 'class' => '', |
| 1451 | 'id' => '', |
| 1452 | ), |
| 1453 | 'acfe_permissions' => '', |
| 1454 | 'placement' => 'top', |
| 1455 | 'endpoint' => 0, |
| 1456 | ), |
| 1457 | array( |
| 1458 | 'key' => 'field_acfe_dt_show_ui', |
| 1459 | 'label' => 'Show UI', |
| 1460 | 'name' => 'show_ui', |
| 1461 | 'type' => 'true_false', |
| 1462 | 'instructions' => 'Whether to generate a default UI for managing this post type in the admin', |
| 1463 | 'required' => 0, |
| 1464 | 'conditional_logic' => 0, |
| 1465 | 'wrapper' => array( |
| 1466 | 'width' => '', |
| 1467 | 'class' => '', |
| 1468 | 'id' => '', |
| 1469 | ), |
| 1470 | 'acfe_validate' => '', |
| 1471 | 'acfe_update' => '', |
| 1472 | 'acfe_permissions' => '', |
| 1473 | 'message' => '', |
| 1474 | 'default_value' => 1, |
| 1475 | 'ui' => 1, |
| 1476 | 'ui_on_text' => '', |
| 1477 | 'ui_off_text' => '', |
| 1478 | ), |
| 1479 | array( |
| 1480 | 'key' => 'field_acfe_dt_show_in_menu', |
| 1481 | 'label' => 'Show in menu', |
| 1482 | 'name' => 'show_in_menu', |
| 1483 | 'type' => 'true_false', |
| 1484 | 'instructions' => 'Where to show the taxonomy in the admin menu. show_ui must be true', |
| 1485 | 'required' => 0, |
| 1486 | 'conditional_logic' => 0, |
| 1487 | 'wrapper' => array( |
| 1488 | 'width' => '', |
| 1489 | 'class' => '', |
| 1490 | 'id' => '', |
| 1491 | ), |
| 1492 | 'acfe_validate' => '', |
| 1493 | 'acfe_update' => '', |
| 1494 | 'acfe_permissions' => '', |
| 1495 | 'message' => '', |
| 1496 | 'default_value' => 1, |
| 1497 | 'ui' => 1, |
| 1498 | 'ui_on_text' => '', |
| 1499 | 'ui_off_text' => '', |
| 1500 | ), |
| 1501 | array( |
| 1502 | 'key' => 'field_acfe_dt_show_in_nav_menus', |
| 1503 | 'label' => 'Show in nav menus', |
| 1504 | 'name' => 'show_in_nav_menus', |
| 1505 | 'type' => 'true_false', |
| 1506 | 'instructions' => 'true makes this taxonomy available for selection in navigation menus', |
| 1507 | 'required' => 0, |
| 1508 | 'conditional_logic' => 0, |
| 1509 | 'wrapper' => array( |
| 1510 | 'width' => '', |
| 1511 | 'class' => '', |
| 1512 | 'id' => '', |
| 1513 | ), |
| 1514 | 'acfe_validate' => '', |
| 1515 | 'acfe_update' => '', |
| 1516 | 'acfe_permissions' => '', |
| 1517 | 'message' => '', |
| 1518 | 'default_value' => 1, |
| 1519 | 'ui' => 1, |
| 1520 | 'ui_on_text' => '', |
| 1521 | 'ui_off_text' => '', |
| 1522 | ), |
| 1523 | array( |
| 1524 | 'key' => 'field_acfe_dt_show_tagcloud', |
| 1525 | 'label' => 'Show tagcloud', |
| 1526 | 'name' => 'show_tagcloud', |
| 1527 | 'type' => 'true_false', |
| 1528 | 'instructions' => 'Whether to allow the Tag Cloud widget to use this taxonomy', |
| 1529 | 'required' => 0, |
| 1530 | 'conditional_logic' => 0, |
| 1531 | 'wrapper' => array( |
| 1532 | 'width' => '', |
| 1533 | 'class' => '', |
| 1534 | 'id' => '', |
| 1535 | ), |
| 1536 | 'acfe_validate' => '', |
| 1537 | 'acfe_update' => '', |
| 1538 | 'acfe_permissions' => '', |
| 1539 | 'message' => '', |
| 1540 | 'default_value' => 1, |
| 1541 | 'ui' => 1, |
| 1542 | 'ui_on_text' => '', |
| 1543 | 'ui_off_text' => '', |
| 1544 | ), |
| 1545 | array( |
| 1546 | 'key' => 'field_acfe_dt_show_in_quick_edit', |
| 1547 | 'label' => 'Show in quick edit', |
| 1548 | 'name' => 'show_in_quick_edit', |
| 1549 | 'type' => 'true_false', |
| 1550 | 'instructions' => 'Whether to show the taxonomy in the quick/bulk edit panel', |
| 1551 | 'required' => 0, |
| 1552 | 'conditional_logic' => 0, |
| 1553 | 'wrapper' => array( |
| 1554 | 'width' => '', |
| 1555 | 'class' => '', |
| 1556 | 'id' => '', |
| 1557 | ), |
| 1558 | 'acfe_validate' => '', |
| 1559 | 'acfe_update' => '', |
| 1560 | 'acfe_permissions' => '', |
| 1561 | 'message' => '', |
| 1562 | 'default_value' => 1, |
| 1563 | 'ui' => 1, |
| 1564 | 'ui_on_text' => '', |
| 1565 | 'ui_off_text' => '', |
| 1566 | ), |
| 1567 | array( |
| 1568 | 'key' => 'field_acfe_dt_show_admin_column', |
| 1569 | 'label' => 'Show admin column', |
| 1570 | 'name' => 'show_admin_column', |
| 1571 | 'type' => 'true_false', |
| 1572 | 'instructions' => 'Whether to allow automatic creation of taxonomy columns on associated post-types table', |
| 1573 | 'required' => 0, |
| 1574 | 'conditional_logic' => 0, |
| 1575 | 'wrapper' => array( |
| 1576 | 'width' => '', |
| 1577 | 'class' => '', |
| 1578 | 'id' => '', |
| 1579 | ), |
| 1580 | 'acfe_validate' => '', |
| 1581 | 'acfe_update' => '', |
| 1582 | 'acfe_permissions' => '', |
| 1583 | 'message' => '', |
| 1584 | 'default_value' => 1, |
| 1585 | 'ui' => 1, |
| 1586 | 'ui_on_text' => '', |
| 1587 | 'ui_off_text' => '', |
| 1588 | ), |
| 1589 | array( |
| 1590 | 'key' => 'field_acfe_dt_tab_capability', |
| 1591 | 'label' => 'Capability', |
| 1592 | 'name' => '', |
| 1593 | 'type' => 'tab', |
| 1594 | 'instructions' => '', |
| 1595 | 'required' => 0, |
| 1596 | 'conditional_logic' => 0, |
| 1597 | 'wrapper' => array( |
| 1598 | 'width' => '', |
| 1599 | 'class' => '', |
| 1600 | 'id' => '', |
| 1601 | ), |
| 1602 | 'acfe_permissions' => '', |
| 1603 | 'placement' => 'top', |
| 1604 | 'endpoint' => 0, |
| 1605 | ), |
| 1606 | array( |
| 1607 | 'key' => 'field_acfe_dt_capabilities', |
| 1608 | 'label' => 'Capabilities', |
| 1609 | 'name' => 'capabilities', |
| 1610 | 'type' => 'textarea', |
| 1611 | 'instructions' => 'An array of the capabilities for this taxonomy:<br /><br /> |
| 1612 | manage_terms<br /> |
| 1613 | edit_terms<br /> |
| 1614 | delete_terms<br /> |
| 1615 | assign_terms', |
| 1616 | 'required' => 0, |
| 1617 | 'conditional_logic' => 0, |
| 1618 | 'wrapper' => array( |
| 1619 | 'width' => '', |
| 1620 | 'class' => '', |
| 1621 | 'id' => '', |
| 1622 | ), |
| 1623 | 'acfe_validate' => '', |
| 1624 | 'acfe_update' => '', |
| 1625 | 'acfe_permissions' => '', |
| 1626 | 'default_value' => '', |
| 1627 | 'placeholder' => '', |
| 1628 | 'maxlength' => '', |
| 1629 | 'rows' => '', |
| 1630 | 'new_lines' => '', |
| 1631 | ), |
| 1632 | array( |
| 1633 | 'key' => 'field_acfe_dt_tab_single', |
| 1634 | 'label' => 'Single', |
| 1635 | 'name' => '', |
| 1636 | 'type' => 'tab', |
| 1637 | 'instructions' => '', |
| 1638 | 'required' => 0, |
| 1639 | 'conditional_logic' => 0, |
| 1640 | 'wrapper' => array( |
| 1641 | 'width' => '', |
| 1642 | 'class' => '', |
| 1643 | 'id' => '', |
| 1644 | ), |
| 1645 | 'acfe_permissions' => '', |
| 1646 | 'placement' => 'top', |
| 1647 | 'endpoint' => 0, |
| 1648 | ), |
| 1649 | array( |
| 1650 | 'key' => 'field_acfe_dt_single_template', |
| 1651 | 'label' => 'Template', |
| 1652 | 'name' => 'acfe_dt_single_template', |
| 1653 | 'type' => 'text', |
| 1654 | '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>', |
| 1655 | 'required' => 0, |
| 1656 | 'conditional_logic' => 0, |
| 1657 | 'wrapper' => array( |
| 1658 | 'width' => '', |
| 1659 | 'class' => '', |
| 1660 | 'id' => '', |
| 1661 | ), |
| 1662 | 'acfe_validate' => '', |
| 1663 | 'acfe_update' => '', |
| 1664 | 'acfe_permissions' => '', |
| 1665 | 'default_value' => '', |
| 1666 | 'placeholder' => 'my-template.php', |
| 1667 | 'prepend' => str_replace(home_url(), '', ACFE_THEME_URL) . '/', |
| 1668 | 'append' => '', |
| 1669 | 'maxlength' => '', |
| 1670 | ), |
| 1671 | array( |
| 1672 | 'key' => 'field_acfe_dt_single_posts_per_page', |
| 1673 | 'label' => 'Posts per page', |
| 1674 | 'name' => 'acfe_dt_single_posts_per_page', |
| 1675 | 'type' => 'number', |
| 1676 | 'instructions' => 'ACF Extended: Number of posts to display on the admin list screen', |
| 1677 | 'required' => 0, |
| 1678 | 'conditional_logic' => 0, |
| 1679 | 'wrapper' => array( |
| 1680 | 'width' => '', |
| 1681 | 'class' => '', |
| 1682 | 'id' => '', |
| 1683 | ), |
| 1684 | 'acfe_validate' => '', |
| 1685 | 'acfe_update' => '', |
| 1686 | 'acfe_permissions' => '', |
| 1687 | 'default_value' => 10, |
| 1688 | 'placeholder' => '', |
| 1689 | 'prepend' => '', |
| 1690 | 'append' => '', |
| 1691 | 'min' => -1, |
| 1692 | 'max' => '', |
| 1693 | 'step' => '', |
| 1694 | ), |
| 1695 | array( |
| 1696 | 'key' => 'field_acfe_dt_single_orderby', |
| 1697 | 'label' => 'Order by', |
| 1698 | 'name' => 'acfe_dt_single_orderby', |
| 1699 | 'type' => 'text', |
| 1700 | 'instructions' => 'ACF Extended: Sort retrieved posts by parameter in the admin list screen. Defaults to \'date (post_date)\'.', |
| 1701 | 'required' => 0, |
| 1702 | 'conditional_logic' => 0, |
| 1703 | 'wrapper' => array( |
| 1704 | 'width' => '', |
| 1705 | 'class' => '', |
| 1706 | 'id' => '', |
| 1707 | ), |
| 1708 | 'acfe_validate' => '', |
| 1709 | 'acfe_update' => array( |
| 1710 | '5c9479dec93c4' => array( |
| 1711 | 'acfe_update_function' => 'sanitize_title', |
| 1712 | ), |
| 1713 | ), |
| 1714 | 'acfe_permissions' => '', |
| 1715 | 'default_value' => 'date', |
| 1716 | 'placeholder' => '', |
| 1717 | 'prepend' => '', |
| 1718 | 'append' => '', |
| 1719 | 'maxlength' => '', |
| 1720 | ), |
| 1721 | array( |
| 1722 | 'key' => 'field_acfe_dt_single_order', |
| 1723 | 'label' => 'Order', |
| 1724 | 'name' => 'acfe_dt_single_order', |
| 1725 | 'type' => 'select', |
| 1726 | 'instructions' => 'ACF Extended: Designates the ascending or descending order of the \'orderby\' parameter in the admin list screen. Defaults to \'DESC\'.', |
| 1727 | 'required' => 0, |
| 1728 | 'conditional_logic' => 0, |
| 1729 | 'wrapper' => array( |
| 1730 | 'width' => '', |
| 1731 | 'class' => '', |
| 1732 | 'id' => '', |
| 1733 | ), |
| 1734 | 'acfe_validate' => '', |
| 1735 | 'acfe_update' => '', |
| 1736 | 'acfe_permissions' => '', |
| 1737 | 'choices' => array( |
| 1738 | 'ASC' => 'ASC', |
| 1739 | 'DESC' => 'DESC', |
| 1740 | ), |
| 1741 | 'default_value' => array( |
| 1742 | 0 => 'DESC', |
| 1743 | ), |
| 1744 | 'allow_null' => 0, |
| 1745 | 'multiple' => 0, |
| 1746 | 'ui' => 0, |
| 1747 | 'return_format' => 'value', |
| 1748 | 'ajax' => 0, |
| 1749 | 'placeholder' => '', |
| 1750 | ), |
| 1751 | array( |
| 1752 | 'key' => 'field_acfe_dt_rewrite', |
| 1753 | 'label' => 'Rewrite', |
| 1754 | 'name' => 'rewrite', |
| 1755 | 'type' => 'true_false', |
| 1756 | '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', |
| 1757 | 'required' => 0, |
| 1758 | 'conditional_logic' => 0, |
| 1759 | 'wrapper' => array( |
| 1760 | 'width' => '', |
| 1761 | 'class' => '', |
| 1762 | 'id' => '', |
| 1763 | ), |
| 1764 | 'acfe_validate' => '', |
| 1765 | 'acfe_update' => '', |
| 1766 | 'acfe_permissions' => '', |
| 1767 | 'message' => '', |
| 1768 | 'default_value' => 1, |
| 1769 | 'ui' => 1, |
| 1770 | 'ui_on_text' => '', |
| 1771 | 'ui_off_text' => '', |
| 1772 | ), |
| 1773 | array( |
| 1774 | 'key' => 'field_acfe_dt_rewrite_args_select', |
| 1775 | 'label' => 'Rewrite Arguments', |
| 1776 | 'name' => 'rewrite_args_select', |
| 1777 | 'type' => 'true_false', |
| 1778 | 'instructions' => 'Use additional rewrite arguments', |
| 1779 | 'required' => 0, |
| 1780 | 'conditional_logic' => array( |
| 1781 | array( |
| 1782 | array( |
| 1783 | 'field' => 'field_acfe_dt_rewrite', |
| 1784 | 'operator' => '==', |
| 1785 | 'value' => '1', |
| 1786 | ), |
| 1787 | ), |
| 1788 | ), |
| 1789 | 'wrapper' => array( |
| 1790 | 'width' => '', |
| 1791 | 'class' => '', |
| 1792 | 'id' => '', |
| 1793 | ), |
| 1794 | 'acfe_validate' => '', |
| 1795 | 'acfe_update' => '', |
| 1796 | 'acfe_permissions' => '', |
| 1797 | 'message' => '', |
| 1798 | 'default_value' => 0, |
| 1799 | 'ui' => 1, |
| 1800 | 'ui_on_text' => '', |
| 1801 | 'ui_off_text' => '', |
| 1802 | ), |
| 1803 | array( |
| 1804 | 'key' => 'field_acfe_dt_rewrite_args', |
| 1805 | 'label' => 'Rewrite Arguments', |
| 1806 | 'name' => 'rewrite_args', |
| 1807 | 'type' => 'group', |
| 1808 | 'instructions' => 'Additional arguments', |
| 1809 | 'required' => 0, |
| 1810 | 'conditional_logic' => array( |
| 1811 | array( |
| 1812 | array( |
| 1813 | 'field' => 'field_acfe_dt_rewrite', |
| 1814 | 'operator' => '==', |
| 1815 | 'value' => '1', |
| 1816 | ), |
| 1817 | array( |
| 1818 | 'field' => 'field_acfe_dt_rewrite_args_select', |
| 1819 | 'operator' => '==', |
| 1820 | 'value' => '1', |
| 1821 | ), |
| 1822 | ), |
| 1823 | ), |
| 1824 | 'wrapper' => array( |
| 1825 | 'width' => '', |
| 1826 | 'class' => '', |
| 1827 | 'id' => '', |
| 1828 | ), |
| 1829 | 'acfe_permissions' => '', |
| 1830 | 'layout' => 'row', |
| 1831 | 'sub_fields' => array( |
| 1832 | array( |
| 1833 | 'key' => 'field_acfe_dt_rewrite_slug', |
| 1834 | 'label' => 'Slug', |
| 1835 | 'name' => 'acfe_dt_rewrite_slug', |
| 1836 | 'type' => 'text', |
| 1837 | 'instructions' => 'Used as pretty permalink text (i.e. /tag/) - defaults to $taxonomy (taxonomy\'s name slug)', |
| 1838 | 'required' => 0, |
| 1839 | 'conditional_logic' => array( |
| 1840 | array( |
| 1841 | array( |
| 1842 | 'field' => 'field_acfe_dt_rewrite_args_select', |
| 1843 | 'operator' => '==', |
| 1844 | 'value' => '1', |
| 1845 | ), |
| 1846 | ), |
| 1847 | ), |
| 1848 | 'wrapper' => array( |
| 1849 | 'width' => '', |
| 1850 | 'class' => '', |
| 1851 | 'id' => '', |
| 1852 | ), |
| 1853 | 'acfe_validate' => '', |
| 1854 | 'acfe_update' => '', |
| 1855 | 'acfe_permissions' => '', |
| 1856 | 'default_value' => '', |
| 1857 | 'placeholder' => 'Default', |
| 1858 | 'prepend' => '', |
| 1859 | 'append' => '', |
| 1860 | 'maxlength' => '', |
| 1861 | ), |
| 1862 | array( |
| 1863 | 'key' => 'field_acfe_dt_rewrite_with_front', |
| 1864 | 'label' => 'With front', |
| 1865 | 'name' => 'acfe_dt_rewrite_with_front', |
| 1866 | 'type' => 'true_false', |
| 1867 | 'instructions' => 'Allowing permalinks to be prepended with front base', |
| 1868 | 'required' => 0, |
| 1869 | 'conditional_logic' => array( |
| 1870 | array( |
| 1871 | array( |
| 1872 | 'field' => 'field_acfe_dt_rewrite_args_select', |
| 1873 | 'operator' => '==', |
| 1874 | 'value' => '1', |
| 1875 | ), |
| 1876 | ), |
| 1877 | ), |
| 1878 | 'wrapper' => array( |
| 1879 | 'width' => '', |
| 1880 | 'class' => '', |
| 1881 | 'id' => '', |
| 1882 | ), |
| 1883 | 'acfe_validate' => '', |
| 1884 | 'acfe_update' => '', |
| 1885 | 'acfe_permissions' => '', |
| 1886 | 'message' => '', |
| 1887 | 'default_value' => 1, |
| 1888 | 'ui' => 1, |
| 1889 | 'ui_on_text' => '', |
| 1890 | 'ui_off_text' => '', |
| 1891 | ), |
| 1892 | array( |
| 1893 | 'key' => 'field_acfe_dt_rewrite_hierarchical', |
| 1894 | 'label' => 'Hierarchical', |
| 1895 | 'name' => 'hierarchical', |
| 1896 | 'type' => 'true_false', |
| 1897 | 'instructions' => 'True or false allow hierarchical urls', |
| 1898 | 'required' => 0, |
| 1899 | 'conditional_logic' => array( |
| 1900 | array( |
| 1901 | array( |
| 1902 | 'field' => 'field_acfe_dt_rewrite_args_select', |
| 1903 | 'operator' => '==', |
| 1904 | 'value' => '1', |
| 1905 | ), |
| 1906 | ), |
| 1907 | ), |
| 1908 | 'wrapper' => array( |
| 1909 | 'width' => '', |
| 1910 | 'class' => '', |
| 1911 | 'id' => '', |
| 1912 | ), |
| 1913 | 'acfe_validate' => '', |
| 1914 | 'acfe_update' => '', |
| 1915 | 'acfe_permissions' => '', |
| 1916 | 'message' => '', |
| 1917 | 'default_value' => 0, |
| 1918 | 'ui' => 1, |
| 1919 | 'ui_on_text' => '', |
| 1920 | 'ui_off_text' => '', |
| 1921 | ), |
| 1922 | ), |
| 1923 | ), |
| 1924 | array( |
| 1925 | 'key' => 'field_acfe_dt_tab_admin', |
| 1926 | 'label' => 'Admin', |
| 1927 | 'name' => '', |
| 1928 | 'type' => 'tab', |
| 1929 | 'instructions' => '', |
| 1930 | 'required' => 0, |
| 1931 | 'conditional_logic' => 0, |
| 1932 | 'wrapper' => array( |
| 1933 | 'width' => '', |
| 1934 | 'class' => '', |
| 1935 | 'id' => '', |
| 1936 | ), |
| 1937 | 'acfe_permissions' => '', |
| 1938 | 'placement' => 'top', |
| 1939 | 'endpoint' => 0, |
| 1940 | ), |
| 1941 | array( |
| 1942 | 'key' => 'field_acfe_dt_admin_terms_per_page', |
| 1943 | 'label' => 'Terms per page', |
| 1944 | 'name' => 'acfe_dt_admin_terms_per_page', |
| 1945 | 'type' => 'number', |
| 1946 | 'instructions' => 'ACF Extended: Number of terms to display on the admin list screen', |
| 1947 | 'required' => 0, |
| 1948 | 'conditional_logic' => 0, |
| 1949 | 'wrapper' => array( |
| 1950 | 'width' => '', |
| 1951 | 'class' => '', |
| 1952 | 'id' => '', |
| 1953 | ), |
| 1954 | 'acfe_validate' => '', |
| 1955 | 'acfe_update' => '', |
| 1956 | 'acfe_permissions' => '', |
| 1957 | 'default_value' => 10, |
| 1958 | 'placeholder' => '', |
| 1959 | 'prepend' => '', |
| 1960 | 'append' => '', |
| 1961 | 'min' => -1, |
| 1962 | 'max' => '', |
| 1963 | 'step' => '', |
| 1964 | ), |
| 1965 | array( |
| 1966 | 'key' => 'field_acfe_dt_admin_orderby', |
| 1967 | 'label' => 'Order by', |
| 1968 | 'name' => 'acfe_dt_admin_orderby', |
| 1969 | 'type' => 'text', |
| 1970 | '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', |
| 1971 | 'required' => 0, |
| 1972 | 'conditional_logic' => 0, |
| 1973 | 'wrapper' => array( |
| 1974 | 'width' => '', |
| 1975 | 'class' => '', |
| 1976 | 'id' => '', |
| 1977 | ), |
| 1978 | 'acfe_validate' => '', |
| 1979 | 'acfe_update' => array( |
| 1980 | '5c9479dec93c4' => array( |
| 1981 | 'acfe_update_function' => 'sanitize_title', |
| 1982 | ), |
| 1983 | ), |
| 1984 | 'acfe_permissions' => '', |
| 1985 | 'default_value' => 'name', |
| 1986 | 'placeholder' => '', |
| 1987 | 'prepend' => '', |
| 1988 | 'append' => '', |
| 1989 | 'maxlength' => '', |
| 1990 | ), |
| 1991 | array( |
| 1992 | 'key' => 'field_acfe_dt_admin_order', |
| 1993 | 'label' => 'Order', |
| 1994 | 'name' => 'acfe_dt_admin_order', |
| 1995 | 'type' => 'select', |
| 1996 | 'instructions' => 'ACF Extended: Designates the ascending or descending order of the \'orderby\' parameter in the admin list screen. Defaults to \'ASC\'.', |
| 1997 | 'required' => 0, |
| 1998 | 'conditional_logic' => 0, |
| 1999 | 'wrapper' => array( |
| 2000 | 'width' => '', |
| 2001 | 'class' => '', |
| 2002 | 'id' => '', |
| 2003 | ), |
| 2004 | 'acfe_validate' => '', |
| 2005 | 'acfe_update' => '', |
| 2006 | 'acfe_permissions' => '', |
| 2007 | 'choices' => array( |
| 2008 | 'ASC' => 'ASC', |
| 2009 | 'DESC' => 'DESC', |
| 2010 | ), |
| 2011 | 'default_value' => array( |
| 2012 | 0 => 'ASC', |
| 2013 | ), |
| 2014 | 'allow_null' => 0, |
| 2015 | 'multiple' => 0, |
| 2016 | 'ui' => 0, |
| 2017 | 'return_format' => 'value', |
| 2018 | 'ajax' => 0, |
| 2019 | 'placeholder' => '', |
| 2020 | ), |
| 2021 | array( |
| 2022 | 'key' => 'field_acfe_dt_tab_rest', |
| 2023 | 'label' => 'REST', |
| 2024 | 'name' => '', |
| 2025 | 'type' => 'tab', |
| 2026 | 'instructions' => '', |
| 2027 | 'required' => 0, |
| 2028 | 'conditional_logic' => 0, |
| 2029 | 'wrapper' => array( |
| 2030 | 'width' => '', |
| 2031 | 'class' => '', |
| 2032 | 'id' => '', |
| 2033 | ), |
| 2034 | 'acfe_permissions' => '', |
| 2035 | 'placement' => 'top', |
| 2036 | 'endpoint' => 0, |
| 2037 | ), |
| 2038 | array( |
| 2039 | 'key' => 'field_acfe_dt_show_in_rest', |
| 2040 | 'label' => 'Show in rest', |
| 2041 | 'name' => 'show_in_rest', |
| 2042 | 'type' => 'true_false', |
| 2043 | 'instructions' => 'Whether to include the taxonomy in the REST API', |
| 2044 | 'required' => 0, |
| 2045 | 'conditional_logic' => 0, |
| 2046 | 'wrapper' => array( |
| 2047 | 'width' => '', |
| 2048 | 'class' => '', |
| 2049 | 'id' => '', |
| 2050 | ), |
| 2051 | 'acfe_validate' => '', |
| 2052 | 'acfe_update' => '', |
| 2053 | 'acfe_permissions' => '', |
| 2054 | 'message' => '', |
| 2055 | 'default_value' => 0, |
| 2056 | 'ui' => 1, |
| 2057 | 'ui_on_text' => '', |
| 2058 | 'ui_off_text' => '', |
| 2059 | ), |
| 2060 | array( |
| 2061 | 'key' => 'field_acfe_dt_rest_base', |
| 2062 | 'label' => 'Rest base', |
| 2063 | 'name' => 'rest_base', |
| 2064 | 'type' => 'text', |
| 2065 | 'instructions' => 'To change the base url of REST API route', |
| 2066 | 'required' => 0, |
| 2067 | 'conditional_logic' => 0, |
| 2068 | 'wrapper' => array( |
| 2069 | 'width' => '', |
| 2070 | 'class' => '', |
| 2071 | 'id' => '', |
| 2072 | ), |
| 2073 | 'acfe_validate' => '', |
| 2074 | 'acfe_update' => '', |
| 2075 | 'acfe_permissions' => '', |
| 2076 | 'default_value' => '', |
| 2077 | 'placeholder' => '', |
| 2078 | 'prepend' => '', |
| 2079 | 'append' => '', |
| 2080 | 'maxlength' => '', |
| 2081 | ), |
| 2082 | array( |
| 2083 | 'key' => 'field_acfe_dt_rest_controller_class', |
| 2084 | 'label' => 'Rest controller class', |
| 2085 | 'name' => 'rest_controller_class', |
| 2086 | 'type' => 'text', |
| 2087 | 'instructions' => 'REST API Controller class name', |
| 2088 | 'required' => 0, |
| 2089 | 'conditional_logic' => 0, |
| 2090 | 'wrapper' => array( |
| 2091 | 'width' => '', |
| 2092 | 'class' => '', |
| 2093 | 'id' => '', |
| 2094 | ), |
| 2095 | 'acfe_validate' => '', |
| 2096 | 'acfe_update' => '', |
| 2097 | 'acfe_permissions' => '', |
| 2098 | 'default_value' => 'WP_REST_Terms_Controller', |
| 2099 | 'placeholder' => '', |
| 2100 | 'prepend' => '', |
| 2101 | 'append' => '', |
| 2102 | 'maxlength' => '', |
| 2103 | ), |
| 2104 | ), |
| 2105 | )); |