PluginProbe ʕ •ᴥ•ʔ
Advanced Custom Fields: Extended / trunk
Advanced Custom Fields: Extended vtrunk
0.9.2.6 0.9.2.5 0.8.6 0.8.6.1 0.8.6.3 0.8.6.5 0.8.6.6 0.8.6.7 0.8.6.8 0.8.6.9 0.8.7 0.8.7.1 0.8.7.2 0.8.7.3 0.8.7.4 0.8.7.5 0.8.7.6 0.8.8 0.8.8.1 0.8.8.10 0.8.8.11 0.8.8.2 0.8.8.3 0.8.8.4 0.8.8.5 0.8.8.6 0.8.8.7 0.8.8.8 0.8.8.9 0.8.9 0.8.9.1 0.8.9.2 0.8.9.3 0.8.9.4 0.8.9.5 0.9 0.9.0.1 0.9.0.2 0.9.0.3 0.9.0.4 0.9.0.5 0.9.0.6 0.9.0.7 0.9.0.8 0.9.0.9 0.9.1 0.9.1.1 0.9.2 0.9.2.1 0.9.2.2 0.9.2.3 0.9.2.4 trunk 0.5 0.5.1 0.5.2 0.5.2.1 0.5.2.3 0.5.5 0.5.5.1 0.5.8 0.5.8.1 0.6 0.6.0.1 0.6.0.2 0.6.1 0.6.3 0.6.5 0.6.7 0.6.7.2 0.7 0.7.0.3 0.7.5 0.7.5.5 0.7.8 0.7.9 0.7.9.3 0.7.9.4 0.7.9.9.8 0.7.9.9.9 0.8 0.8.1 0.8.2 0.8.3 0.8.3.1 0.8.4 0.8.4.1 0.8.4.5 0.8.4.6 0.8.5 0.8.5.5
acf-extended / includes / modules / performance / module-performance-ultra-fields.php
acf-extended / includes / modules / performance Last commit date
module-performance-connector.php 1 month ago module-performance-functions.php 1 month ago module-performance-ui.php 3 years ago module-performance-ultra-fields.php 2 years ago module-performance-ultra-revisions.php 1 month ago module-performance-ultra.php 1 month ago module-performance-upgrades.php 2 years ago module-performance.php 1 month ago
module-performance-ultra-fields.php
89 lines
1 <?php
2
3 if(!defined('ABSPATH')){
4 exit;
5 }
6
7 if(!class_exists('acfe_performance_ultra_fields')):
8
9 class acfe_performance_ultra_fields{
10
11 /**
12 * construct
13 */
14 function __construct(){
15
16 add_action('acf/render_field_settings', array($this, 'render_field_settings'));
17 add_filter('acf/validate_field', array($this, 'validate_field'), 20);
18
19 }
20
21
22 /**
23 * render_field_settings
24 *
25 * @param $field
26 */
27 function render_field_settings($field){
28
29 // validate
30 if(!acfe_is_performance_enabled() || acfe_get_performance_config('engine') !== 'ultra'){
31 return;
32 }
33
34 // vars
35 $exclude = array('acfe_button', 'acfe_column', 'acfe_recaptcha', 'acfe_dynamic_render', 'accordion', 'message', 'tab');
36
37 // check if excluded
38 if(in_array($field['type'], $exclude)){
39 return;
40 }
41
42 // settings
43 acf_render_field_setting($field, array(
44 'label' => __('Save as individual meta'),
45 'key' => 'acfe_save_meta',
46 'name' => 'acfe_save_meta',
47 'instructions' => __('Save the field as an individual meta.'),
48 'type' => 'true_false',
49 'required' => false,
50 'conditional_logic' => false,
51 'wrapper' => array(
52 'width' => '',
53 'class' => '',
54 'id' => '',
55 ),
56 'message' => '',
57 'default_value' => false,
58 'ui' => true,
59 'ui_on_text' => '',
60 'ui_off_text' => '',
61 ));
62
63 }
64
65
66 /**
67 * validate_field
68 *
69 * @param $field
70 *
71 * @return mixed
72 */
73 function validate_field($field){
74
75 // cleanup setting if set and empty
76 if(isset($field['acfe_save_meta']) && empty($field['acfe_save_meta'])){
77 unset($field['acfe_save_meta']);
78 }
79
80 return $field;
81
82 }
83
84
85 }
86
87 acf_new_instance('acfe_performance_ultra_fields');
88
89 endif;