-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConversion_Events_Provider.php
More file actions
83 lines (74 loc) · 1.6 KB
/
Copy pathConversion_Events_Provider.php
File metadata and controls
83 lines (74 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
/**
* Class Google\Site_Kit\Core\Conversion_Tracking\Conversion_Events_Provider
*
* @package Google\Site_Kit\Core\Conversion_Tracking
* @copyright 2024 Google LLC
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
* @link https://sitekit.withgoogle.com
*/
namespace Google\Site_Kit\Core\Conversion_Tracking;
use Google\Site_Kit\Context;
use Google\Site_Kit\Core\Assets\Script;
/**
* Base class for conversion events provider.
*
* @since 1.125.0
* @since 1.126.0 Changed from interface to abstract class.
* @access private
* @ignore
*/
abstract class Conversion_Events_Provider {
/**
* Plugin context.
*
* @since 1.126.0
* @var Context
*/
protected $context;
/**
* Constructor.
*
* @since 1.126.0
*
* @param Context $context Plugin context.
*/
public function __construct( Context $context ) {
$this->context = $context;
}
/**
* Checks if the provider is active.
*
* @since 1.125.0
*
* @return bool True if the provider is active, false otherwise.
*/
public function is_active() {
return false;
}
/**
* Gets the event names.
*
* @since 1.125.0
*
* @return array List of event names.
*/
abstract public function get_event_names();
/**
* Registers any actions/hooks for this provider.
*
* @since 1.129.0
*/
public function register_hooks() {
// No-op by default, but left here so subclasses can implement
// their own `add_action`/hook calls.
}
/**
* Registers the script for the provider.
*
* @since 1.125.0
*
* @return Script Script instance.
*/
abstract public function register_script();
}