Skip to content
Snippets Groups Projects
Verified Commit ef0e1d01 authored by Bartek Jaskulski's avatar Bartek Jaskulski
Browse files

feat: add action links and tracking page by default


Signed-off-by: default avatarBart Jaskulski <bjaskulski@protonmail.com>
parent 35162802
No related branches found
No related tags found
1 merge request!6feat: initialize usage tracker
Pipeline #340935 passed with stages
in 44 seconds
......@@ -3,6 +3,8 @@
namespace WPDesk\Plugin\Flow\Initialization\Simple;
use WPDesk\Tracker\OptInOptOut;
/**
* Trait helps with tracker initialization
*
......@@ -56,6 +58,17 @@ trait TrackerInstanceAsFilterTrait {
$tracker_factory = new \WPDesk_Tracker_Factory_Prefixed();
self::$tracker_instance = $tracker_factory->create_tracker( basename( $this->plugin_info->get_plugin_file_name() ) );
$shops = $this->plugin_info->get_plugin_shops();
$shop_url = $shops[ get_locale() ] ?? ( $shops['default'] ?? 'https://wpdesk.net' );
$tracker_ui = new OptInOptOut(
$this->plugin_info->get_plugin_file_name(),
$this->plugin_info->get_plugin_slug(),
$shop_url,
$this->plugin_info->get_plugin_name()
);
$tracker_ui->create_objects();
$tracker_ui->hooks();
do_action( 'wpdesk_tracker_started', self::$tracker_instance, $this->plugin_info );
return self::$tracker_instance;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment