_acf_kses_post_deep_with_keys()
Recursively runs wp_kses_post() over string keys and string values that contain HTML.
Browsers only start a tag at "<" followed by a letter, "/", "!" or "?", so other text can't contain HTML and is left exactly as typed. Otherwise kses can rewrite plain text, such as "&" or entities, breaking choice keys and conditional logic operators like "<".
Внутренняя функция — эта функция рассчитана на использование самим ядром. Не рекомендуется использовать эту функцию в своем коде.
Хуков нет.
Возвращает
mixed.
Использование
_acf_kses_post_deep_with_keys( $data );
- $data(разное) (обязательный)
- The data to sanitize.
Список изменений
| С версии 6.8.11 | Введена. |
Код _acf_kses_post_deep_with_keys() acf kses post deep with keys ACF 6.8.11
function _acf_kses_post_deep_with_keys( $data ) {
if ( is_string( $data ) ) {
return preg_match( '~<[a-zA-Z/!?]~', $data ) ? wp_kses_post( $data ) : $data;
}
if ( ! is_array( $data ) ) {
return $data;
}
$sanitized = array();
foreach ( $data as $key => $value ) {
$sanitized[ _acf_kses_post_deep_with_keys( $key ) ] = _acf_kses_post_deep_with_keys( $value );
}
return $sanitized;
}