acf_skip_internal_post_sanitization()
Runs a callback that saves ACF internal posts from a trusted source, without sanitizing their settings for the current user.
Settings saved by users without the unfiltered_html capability are otherwise filtered with wp_kses_post(). Use this only for settings that are already stored or sanitized, or that come from the server, such as local JSON files. Never for user input.
Хуков нет.
Возвращает
mixed. The callback's return value.
Использование
acf_skip_internal_post_sanitization( $callback, ...$args );
- $callback(callable) (обязательный)
- The callback that saves the posts.
- ...$args(разное) (обязательный)
- Arguments to pass to the callback.
Список изменений
| С версии 6.8.11 | Введена. |
Код acf_skip_internal_post_sanitization() acf skip internal post sanitization ACF 6.8.11
function acf_skip_internal_post_sanitization( callable $callback, ...$args ) {
$skipping = acf_get_data( 'skip_internal_post_sanitization' );
acf_set_data( 'skip_internal_post_sanitization', true );
try {
return $callback( ...$args );
} finally {
acf_set_data( 'skip_internal_post_sanitization', $skipping );
}
}