Skip to content

Commit 138d241

Browse files
committed
fix: ensure ActionScheduler is only used if function exists
1 parent b17a668 commit 138d241

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

includes/data-events/class-data-events.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ public static function init() {
139139
* @return bool
140140
*/
141141
private static function use_action_scheduler() {
142-
$use = defined( 'NEWSPACK_DATA_EVENTS_ACTIONSCHEDULER' ) && NEWSPACK_DATA_EVENTS_ACTIONSCHEDULER;
142+
$use = defined( 'NEWSPACK_DATA_EVENTS_ACTIONSCHEDULER' ) && NEWSPACK_DATA_EVENTS_ACTIONSCHEDULER
143+
&& function_exists( 'as_enqueue_async_action' );
143144
return apply_filters( 'newspack_data_events_use_action_scheduler_dispatch', $use );
144145
}
145146

0 commit comments

Comments
 (0)