Skip to content

Commit 5b0e0ad

Browse files
committed
Use a const to define interactive tasks
1 parent b27a3c1 commit 5b0e0ad

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

classes/suggested-tasks/providers/class-email-sending.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Email_Sending extends Tasks {
3838
*
3939
* @var bool
4040
*/
41-
protected $is_interactive = true;
41+
const IS_INTERACTIVE = true;
4242

4343
/**
4444
* Whether the task is dismissable.

classes/suggested-tasks/providers/class-tasks.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ abstract class Tasks implements Tasks_Interface {
4949
*/
5050
protected const DATA_COLLECTOR_CLASS = \Progress_Planner\Suggested_Tasks\Data_Collector\Base_Data_Collector::class;
5151

52+
/**
53+
* Whether the task is interactive.
54+
*
55+
* @var bool
56+
*/
57+
const IS_INTERACTIVE = false;
58+
5259
/**
5360
* Whether the task is repetitive.
5461
*
@@ -126,20 +133,13 @@ abstract class Tasks implements Tasks_Interface {
126133
*/
127134
protected $popover_id = '';
128135

129-
/**
130-
* Whether the task is interactive.
131-
*
132-
* @var bool
133-
*/
134-
protected $is_interactive = false;
135-
136136
/**
137137
* Constructor.
138138
*
139139
* @return void
140140
*/
141141
public function __construct() {
142-
if ( $this->is_interactive ) {
142+
if ( static::IS_INTERACTIVE ) {
143143
\add_action( 'progress_planner_admin_page_after_widgets', [ $this, 'add_popover' ] );
144144
}
145145
}

0 commit comments

Comments
 (0)