forked from basvandenwijngaard/advanced-custom-fields-pro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeprecated.php
154 lines (134 loc) · 3.98 KB
/
deprecated.php
1
2
3
4
5
6
7
8
9
10
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?php
// Register deprecated filters ( $deprecated, $version, $replacement ).
acf_add_deprecated_filter( 'acf/settings/export_textdomain', '5.3.3', 'acf/settings/l10n_textdomain' );
acf_add_deprecated_filter( 'acf/settings/export_translate', '5.3.3', 'acf/settings/l10n_field' );
acf_add_deprecated_filter( 'acf/settings/export_translate', '5.3.3', 'acf/settings/l10n_field_group' );
acf_add_deprecated_filter( 'acf/settings/dir', '5.6.8', 'acf/settings/url' );
acf_add_deprecated_filter( 'acf/get_valid_field', '5.5.6', 'acf/validate_field' );
acf_add_deprecated_filter( 'acf/get_valid_field_group', '5.5.6', 'acf/validate_field_group' );
acf_add_deprecated_filter( 'acf/get_valid_post_id', '5.5.6', 'acf/validate_post_id' );
acf_add_deprecated_filter( 'acf/get_field_reference', '5.6.5', 'acf/load_reference' );
acf_add_deprecated_filter( 'acf/get_field_group', '5.7.11', 'acf/load_field_group' );
acf_add_deprecated_filter( 'acf/get_field_groups', '5.7.11', 'acf/load_field_groups' );
acf_add_deprecated_filter( 'acf/get_fields', '5.7.11', 'acf/load_fields' );
// Register variations for deprecated filters.
acf_add_filter_variations( 'acf/get_valid_field', array( 'type' ), 0 );
/**
* acf_render_field_wrap_label
*
* Renders the field's label.
*
* @date 19/9/17
* @since 5.6.3
* @deprecated 5.6.5
*
* @param array $field The field array.
* @return void
*/
function acf_render_field_wrap_label( $field ) {
// Warning.
_deprecated_function( __FUNCTION__, '5.7.11', 'acf_render_field_label()' );
// Render.
acf_render_field_label( $field );
}
/**
* acf_render_field_wrap_description
*
* Renders the field's instructions.
*
* @date 19/9/17
* @since 5.6.3
* @deprecated 5.6.5
*
* @param array $field The field array.
* @return void
*/
function acf_render_field_wrap_description( $field ) {
// Warning.
_deprecated_function( __FUNCTION__, '5.7.11', 'acf_render_field_instructions()' );
// Render.
acf_render_field_instructions( $field );
}
/*
* acf_get_fields_by_id
*
* Returns and array of fields for the given $parent_id.
*
* @date 27/02/2014
* @since 5.0.0.
* @deprecated 5.7.11
*
* @param int $parent_id The parent ID.
* @return array
*/
function acf_get_fields_by_id( $parent_id = 0 ) {
// Warning.
_deprecated_function( __FUNCTION__, '5.7.11', 'acf_get_fields()' );
// Return fields.
return acf_get_fields(
array(
'ID' => $parent_id,
'key' => "group_$parent_id",
)
);
}
/**
* acf_update_option
*
* A wrapper for the WP update_option but provides logic for a 'no' autoload
*
* @date 4/01/2014
* @since 5.0.0
* @deprecated 5.7.11
*
* @param string $option The option name.
* @param string $value The option value.
* @param string $autoload An optional autoload value.
* @return bool
*/
function acf_update_option( $option = '', $value = '', $autoload = null ) {
// Warning.
_deprecated_function( __FUNCTION__, '5.7.11', 'update_option()' );
// Update.
if ( $autoload === null ) {
$autoload = (bool) acf_get_setting( 'autoload' );
}
return update_option( $option, $value, $autoload );
}
/**
* acf_get_field_reference
*
* Finds the field key for a given field name and post_id.
*
* @date 26/1/18
* @since 5.6.5
* @deprecated 5.6.8
*
* @param string $field_name The name of the field. eg 'sub_heading'
* @param mixed $post_id The post_id of which the value is saved against
* @return string $reference The field key
*/
function acf_get_field_reference( $field_name, $post_id ) {
// Warning.
_deprecated_function( __FUNCTION__, '5.6.8', 'acf_get_reference()' );
// Return reference.
return acf_get_reference( $field_name, $post_id );
}
/**
* acf_get_dir
*
* Returns the plugin url to a specified file.
*
* @date 28/09/13
* @since 5.0.0
* @deprecated 5.6.8
*
* @param string $filename The specified file.
* @return string
*/
function acf_get_dir( $filename = '' ) {
// Warning.
_deprecated_function( __FUNCTION__, '5.6.8', 'acf_get_url()' );
// Return.
return acf_get_url( $filename );
}