ActionScheduler_ScheduleDeserializer::is_enforced │ public static │ WC 1.0

Whether an unexpected class causes the blob to be rejected (true) or merely reported while the legacy, unrestricted deserialization proceeds (false, "shadow mode").

Enforcement is on by default. Site owners can opt into shadow mode for a release to gather data before enforcing, without changing any stored data.

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

Возвращает

bool.

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

$result = ActionScheduler_ScheduleDeserializer::is_enforced(): bool;

Код ActionScheduler_ScheduleDeserializer::is_enforced() WC 11.2.2

public static function is_enforced(): bool {
	/**
	 * Filters whether Action Scheduler rejects schedule blobs referencing unexpected classes.
	 *
	 * Return false to run in "shadow mode": unexpected classes are reported via the
	 * `action_scheduler_unexpected_schedule_class` action but the blob is still deserialized
	 * exactly as it was before this hardening. Useful to confirm the allow-list is complete for
	 * your site before switching enforcement on.
	 *
	 * @since 4.1.0
	 *
	 * @param bool $enforced Whether to reject blobs with unexpected classes. Default true.
	 */
	return (bool) apply_filters( 'action_scheduler_enforce_schedule_allowed_classes', true );
}