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