WPSEO_Utils::sanitize_encoded_text_field()public staticYoast 13.3

Decode, sanitize and encode the array of strings or the string.

Метод класса: WPSEO_Utils{}

Хуков нет.

Возвращает

Массив|Строку. The sanitized value.

Использование

$result = WPSEO_Utils::sanitize_encoded_text_field( $value );
$value(массив|строка) (обязательный)
The value to sanitize and encode.

Список изменений

С версии 13.3 Введена.

Код WPSEO_Utils::sanitize_encoded_text_field() Yoast 22.4

public static function sanitize_encoded_text_field( $value ) {
	if ( is_array( $value ) ) {
		return array_map( [ self::class, 'sanitize_encoded_text_field' ], $value );
	}

	return rawurlencode( sanitize_text_field( rawurldecode( $value ) ) );
}