From 6542b7eb621ea43f569c475c2ebfc644de2671ca Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Sat, 21 Mar 2020 07:41:40 +0100 Subject: [PATCH] Check against a capability, not a role --- src/BackgroundTask/CronBasedBackgroundTask.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BackgroundTask/CronBasedBackgroundTask.php b/src/BackgroundTask/CronBasedBackgroundTask.php index 6549eba8d87..4e32a97a57c 100644 --- a/src/BackgroundTask/CronBasedBackgroundTask.php +++ b/src/BackgroundTask/CronBasedBackgroundTask.php @@ -51,7 +51,7 @@ public function register() { * @return void */ public function schedule_event() { - if ( ! current_user_can( 'administrator' ) ) { + if ( ! current_user_can( 'manage_options' ) ) { return; }