Skip to content

Commit a53afa5

Browse files
committed
Make CronBasedBackgroundTask non-Conditional
1 parent 07cb9f7 commit a53afa5

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/BackgroundTask/CronBasedBackgroundTask.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
namespace AmpProject\AmpWP\BackgroundTask;
99

10-
use AmpProject\AmpWP\Infrastructure\Conditional;
1110
use AmpProject\AmpWP\Infrastructure\Registerable;
1211
use AmpProject\AmpWP\Infrastructure\Service;
1312

@@ -18,7 +17,7 @@
1817
* @since 2.0
1918
* @internal
2019
*/
21-
abstract class CronBasedBackgroundTask implements Service, Registerable, Conditional {
20+
abstract class CronBasedBackgroundTask implements Service, Registerable {
2221

2322
const DEFAULT_INTERVAL_HOURLY = 'hourly';
2423
const DEFAULT_INTERVAL_TWICE_DAILY = 'twicedaily';
@@ -40,15 +39,6 @@ public function __construct( BackgroundTaskDeactivator $background_task_deactiva
4039
$this->background_task_deactivator = $background_task_deactivator;
4140
}
4241

43-
/**
44-
* Check whether the conditional object is currently needed.
45-
*
46-
* @return bool Whether the conditional object is needed.
47-
*/
48-
public static function is_needed() {
49-
return is_admin() || wp_doing_cron();
50-
}
51-
5242
/**
5343
* Register the service with the system.
5444
*

0 commit comments

Comments
 (0)