Skip to content

Commit ff65539

Browse files
authored
Merge pull request #616 from ProgressPlanner/filip/v18/enqueu-test-email
Enqueue "Test email" script only when Recommendations widget is displayed
2 parents 0cc8fd3 + 096d518 commit ff65539

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,11 @@ protected function get_description( $task_data = [] ) {
188188
* @return void
189189
*/
190190
public function enqueue_scripts( $hook ) {
191+
// Enqueue the script only on Progress Planner and WP dashboard pages.
192+
if ( 'toplevel_page_progress-planner' !== $hook && 'index.php' !== $hook ) {
193+
return;
194+
}
195+
191196
// Don't enqueue the script if the task is already completed.
192197
if ( true === \progress_planner()->get_suggested_tasks()->was_task_completed( $this->get_task_id() ) ) {
193198
return;

0 commit comments

Comments
 (0)