acf_is_trusted_save_context() │ ACF 6.8.11

Returns whether ACF is saving from a trusted context, WP-CLI or cron, where saved values come from code rather than from a request.

Хуки из функции

Возвращает

boolean.

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

acf_is_trusted_save_context();

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

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

Код acf_is_trusted_save_context() ACF 6.8.11

function acf_is_trusted_save_context() {
	$trusted = ( defined( 'WP_CLI' ) && WP_CLI ) || wp_doing_cron();

	/**
	 * Filters whether ACF is saving from a trusted context. Values saved from a trusted context
	 * aren't permission checked, for example when bidirectional fields update the other side.
	 *
	 * @since 6.8.11
	 *
	 * @param boolean $trusted True for WP-CLI and cron.
	 */
	return (bool) apply_filters( 'acf/is_trusted_save_context', $trusted );
}