Skip to content

Commit 1737b47

Browse files
committed
Conditionally retain allowed_batch_data_classes property in subclass if set
1 parent 7ba50e9 commit 1737b47

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

classes/wp-background-process.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ public function __construct( $allowed_batch_data_classes = true ) {
8686
$allowed_batch_data_classes = true;
8787
}
8888

89-
$this->allowed_batch_data_classes = $allowed_batch_data_classes;
89+
// If allowed_batch_data_classes property set in subclass,
90+
// only apply override if not allowing any class.
91+
if ( true === $this->allowed_batch_data_classes || true !== $allowed_batch_data_classes ) {
92+
$this->allowed_batch_data_classes = $allowed_batch_data_classes;
93+
}
9094

9195
$this->cron_hook_identifier = $this->identifier . '_cron';
9296
$this->cron_interval_identifier = $this->identifier . '_cron_interval';

0 commit comments

Comments
 (0)