Skip to content

Commit b5baab4

Browse files
authored
Merge branch 'develop' into filip/interactive-tasks
2 parents a8b9d42 + ef6170f commit b5baab4

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

classes/utils/class-playground.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public function __construct() {
2020
\add_action( 'plugins_loaded', [ $this, 'enable_debug_tools' ], 1 );
2121
\add_filter( 'progress_planner_tasks_show_ui', '__return_true' );
2222
\add_action( 'admin_footer', [ $this, 'inject_playground_js_patch' ] );
23+
\add_action( 'init', [ $this, 'disable_upgrade_tasks_popover' ], 101 );
2324
}
2425

2526
/**
@@ -54,6 +55,22 @@ public function register_hooks() {
5455
\progress_planner()->get_settings()->set( 'activation_date', ( new \DateTime() )->modify( '-2 months' )->format( 'Y-m-d' ) );
5556
}
5657

58+
/**
59+
* Disable the upgrade tasks popover.
60+
*
61+
* @return void
62+
*/
63+
public function disable_upgrade_tasks_popover() {
64+
// This will make the plugin think it was activated, so the upgrade tasks popover will not be shown.
65+
$onboard_task_provider_ids = \apply_filters( 'prpl_onboarding_task_providers', [] );
66+
67+
// Update 'progress_planner_previous_version_task_providers' option.
68+
\update_option( 'progress_planner_previous_version_task_providers', \array_unique( $onboard_task_provider_ids ), SORT_REGULAR );
69+
70+
// Clear the upgrade popover task provider IDs, this are the 'newly' added task providers, so the upgrade tasks popover will not be shown.
71+
\update_option( 'progress_planner_upgrade_popover_task_provider_ids', [] );
72+
}
73+
5774
/**
5875
* Enable debug tools.
5976
*

0 commit comments

Comments
 (0)