views
1 week ago
Assets.php
1 week ago
OptInOptOut.php
1 week ago
OptInPage.php
1 week ago
OptOut.php
1 week ago
PluginActionLinks.php
1 week ago
Shop.php
1 week ago
Tracker.php
1 week ago
OptInOptOut.php
54 lines
| 1 | <?php |
| 2 | |
| 3 | namespace FSVendor\WPDesk\Tracker; |
| 4 | |
| 5 | use FSVendor\WPDesk\PluginBuilder\Plugin\HookableCollection; |
| 6 | use FSVendor\WPDesk\PluginBuilder\Plugin\HookableParent; |
| 7 | class OptInOptOut implements HookableCollection |
| 8 | { |
| 9 | use HookableParent; |
| 10 | /** |
| 11 | * @var string |
| 12 | */ |
| 13 | private $plugin_file; |
| 14 | /** |
| 15 | * @var string |
| 16 | */ |
| 17 | private $plugin_slug; |
| 18 | /** |
| 19 | * @var string |
| 20 | */ |
| 21 | private $shop_url; |
| 22 | /** |
| 23 | * @var string |
| 24 | */ |
| 25 | private $plugin_name; |
| 26 | /** |
| 27 | * @param string $plugin_file |
| 28 | * @param string $plugin_slug |
| 29 | * @param string $shop_url |
| 30 | * @param string $plugin_name |
| 31 | */ |
| 32 | public function __construct($plugin_file, $plugin_slug, $shop_url, $plugin_name) |
| 33 | { |
| 34 | $this->plugin_file = $plugin_file; |
| 35 | $this->plugin_slug = $plugin_slug; |
| 36 | $this->shop_url = $shop_url; |
| 37 | $this->plugin_name = $plugin_name; |
| 38 | } |
| 39 | /** |
| 40 | * Creates hookable objects. |
| 41 | */ |
| 42 | public function create_objects() |
| 43 | { |
| 44 | $this->add_hookable(new PluginActionLinks($this->plugin_file, $this->plugin_slug, $this->shop_url)); |
| 45 | $this->add_hookable(new OptInPage($this->plugin_slug)); |
| 46 | $this->add_hookable(new OptOut($this->plugin_slug, $this->plugin_name)); |
| 47 | $this->add_hookable(new Assets($this->plugin_slug)); |
| 48 | } |
| 49 | public function hooks() |
| 50 | { |
| 51 | $this->hooks_on_hookable_objects(); |
| 52 | } |
| 53 | } |
| 54 |