action_scheduler_enforce_schedule_allowed_classes │ хук-фильтр │ WC 4.1.0

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 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.

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

add_filter( 'action_scheduler_enforce_schedule_allowed_classes', 'wp_kama_action_scheduler_enforce_schedule_allowed_classes_filter' );

/**
 * Function for `action_scheduler_enforce_schedule_allowed_classes` filter-hook.
 * 
 * @param bool $enforced Whether to reject blobs with unexpected classes.
 *
 * @return bool
 */
function wp_kama_action_scheduler_enforce_schedule_allowed_classes_filter( $enforced ){
	// filter...
	return $enforced;
}
$enforced(true|false)
Whether to reject blobs with unexpected classes.
По умолчанию: true

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

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

Где вызывается хук

ActionScheduler_ScheduleDeserializer::is_enforced()
action_scheduler_enforce_schedule_allowed_classes
woocommerce/packages/action-scheduler/classes/ActionScheduler_ScheduleDeserializer.php 410
return (bool) apply_filters( 'action_scheduler_enforce_schedule_allowed_classes', true );

Где используется хук в WooCommerce

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