Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 497ae01

Browse files
committedMar 10, 2025
PHPCS
1 parent 22e3c6e commit 497ae01

File tree

3 files changed

+12
-29
lines changed

3 files changed

+12
-29
lines changed
 

‎includes/api/api-helpers.php

+4-21
Original file line numberDiff line numberDiff line change
@@ -3043,8 +3043,8 @@ function _acf_settings_uploader( $uploader ) {
30433043
*
30443044
* @since ACF 5.3.2
30453045
*
3046-
* @param $string mixed string or array containing strings to be translated.
3047-
* @return $string
3046+
* @param mixed $string String or array containing strings to be translated.
3047+
* @return mixed
30483048
*/
30493049
function acf_translate( $string ) {
30503050

@@ -3067,29 +3067,12 @@ function acf_translate( $string ) {
30673067
return array_map( 'acf_translate', $string );
30683068
}
30693069

3070-
// bail early if not string
3071-
if ( ! is_string( $string ) ) {
3072-
return $string;
3073-
}
3074-
30753070
// bail early if empty
3076-
if ( $string === '' ) {
3071+
if ( '' === $string ) {
30773072
return $string;
30783073
}
30793074

3080-
// allow for var_export export
3081-
if ( acf_get_setting( 'l10n_var_export' ) ) {
3082-
3083-
// bail early if already translated
3084-
if ( substr( $string, 0, 7 ) === '!!__(!!' ) {
3085-
return $string;
3086-
}
3087-
3088-
// return
3089-
return "!!__(!!'" . $string . "!!', !!'" . $textdomain . "!!')!!";
3090-
}
3091-
3092-
// vars
3075+
// translate
30933076
return __( $string, $textdomain );
30943077
}
30953078

‎includes/fields/class-acf-field-text.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,10 @@ function render_field_presentation_settings( $field ) {
170170
* @date 29/1/19
171171
* @since ACF 5.7.117.11
172172
*
173-
* @param mixed $valid Whether the value is valid or not.
174-
* @param mixed $value The field value.
175-
* @param array $field The field array.
176-
* @param string $input The HTML input name.
173+
* @param mixed $valid Whether the value is valid or not.
174+
* @param mixed $value The field value.
175+
* @param array $field The field array.
176+
* @param string $input The HTML input name.
177177
* @return (bool|string)
178178
*/
179179
function validate_value( $valid, $value, $field, $input ) {

‎includes/fields/class-acf-field-textarea.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,10 @@ function format_value( $value, $post_id, $field ) {
206206
* @date 29/1/19
207207
* @since ACF 5.7.11
208208
*
209-
* @param mixed $valid Whether the value is valid or not.
210-
* @param mixed $value The field value.
211-
* @param array $field The field array.
212-
* @param string $input The HTML input name.
209+
* @param mixed $valid Whether the value is valid or not.
210+
* @param mixed $value The field value.
211+
* @param array $field The field array.
212+
* @param string $input The HTML input name.
213213
* @return (bool|string)
214214
*/
215215
function validate_value( $valid, $value, $field, $input ) {

0 commit comments

Comments
 (0)
Please sign in to comment.