-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add task using
TaskLists::add_task
API,
`woocommerce_admin_onboarding_task_list` is deprecated. Fixes #2024 Remove `remove_woocommerce_extended_task_list_item` hook.
- Loading branch information
Showing
7 changed files
with
105 additions
and
176 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<?php | ||
declare( strict_types=1 ); | ||
|
||
namespace Automattic\WooCommerce\GoogleListingsAndAds\TaskList; | ||
|
||
use Automattic\WooCommerce\Admin\Features\OnboardingTasks\Task; | ||
use Automattic\WooCommerce\GoogleListingsAndAds\MerchantCenter\MerchantCenterAwareInterface; | ||
use Automattic\WooCommerce\GoogleListingsAndAds\MerchantCenter\MerchantCenterAwareTrait; | ||
|
||
/** | ||
* Complete Setup Task to be added to the extended task list. | ||
* | ||
* @package Automattic\WooCommerce\GoogleListingsAndAds\TaskList | ||
*/ | ||
class CompleteSetupTask extends Task implements MerchantCenterAwareInterface { | ||
|
||
use MerchantCenterAwareTrait; | ||
|
||
/** | ||
* Get the task id. | ||
* | ||
* @return string | ||
*/ | ||
public function get_id() { | ||
return 'gla_complete_setup'; | ||
} | ||
|
||
/** | ||
* Get the task name. | ||
* | ||
* @return string | ||
*/ | ||
public function get_title() { | ||
return __( | ||
'Set up Google Listings & Ads', | ||
'google-listings-and-ads' | ||
); | ||
} | ||
|
||
/** | ||
* Get the task description. | ||
* | ||
* @return string empty string | ||
*/ | ||
public function get_content() { | ||
return ''; | ||
} | ||
|
||
/** | ||
* Get the task completion time. | ||
* | ||
* @return string | ||
*/ | ||
public function get_time() { | ||
return __( '20 minutes', 'woocommerce' ); | ||
Check failure on line 55 in src/TaskList/CompleteSetupTask.php GitHub Actions / PHP coding standards
|
||
} | ||
|
||
/** | ||
* Always dismissable. | ||
* | ||
* @return bool | ||
*/ | ||
public function is_dismissable() { | ||
return true; | ||
} | ||
|
||
/** | ||
* Get completion status. | ||
* Forwards from the merchant center setup status. | ||
* | ||
* @return bool | ||
*/ | ||
public function is_complete() { | ||
return $this->merchant_center && $this->merchant_center->is_setup_complete() || false; | ||
} | ||
|
||
/** | ||
* Get the action URL. | ||
* | ||
* @return string Start page or dashboard is the setup is completed. | ||
*/ | ||
public function get_action_url() { | ||
if ( ! $this->is_complete() ) { | ||
return admin_url( 'admin.php?page=wc-admin&path=/google/start' ); | ||
} | ||
|
||
return admin_url( 'admin.php?page=wc-admin&path=/google/dashboard' ); | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters