PluginProbe
Stream – Activity Log & Audit Trail / 4.2.2
Stream – Activity Log & Audit Trail v4.2.2
4.4.0 4.3.0 4.2.2 4.2.1 trunk 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.1 3.1.1 3.10.0 3.2.0 3.2.1 3.2.2 3.2.3 All 50 releases
stream / classes / class-alert-type.php

class-alert-type.php in Stream – Activity Log & Audit Trail 4.2.2, at classes/class-alert-type.php

79 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Alert Type abstract class.
4 *
5 * Used to register new Alert types.
6 *
7 * @package WP_Stream
8 */
9
10 namespace WP_Stream;
11
12 /**
13 * Class Alert_Type
14 *
15 * @package WP_Stream
16 */
17 abstract class Alert_Type {
18
19 /**
20 * Holds instance of plugin object
21 *
22 * @var Plugin
23 */
24 public $plugin;
25
26 /**
27 * Unique identifier.
28 *
29 * @var string
30 */
31 public $slug;
32
33 /**
34 * Class constructor.
35 *
36 * @param Plugin $plugin Plugin object.
37 */
38 public function __construct( $plugin ) {
39 $this->plugin = $plugin;
40 }
41
42 /**
43 * Alert recipients about the new record
44 *
45 * @param int $record_id Record ID.
46 * @param array $recordarr Record details.
47 * @param array $options Alert options.
48 */
49 abstract public function alert( $record_id, $recordarr, $options );
50
51 /**
52 * Display settings form for configuration of individual alerts
53 *
54 * @param Alert $alert Alert currently being worked on.
55 */
56 public function display_fields( $alert ) {
57 // Implementation optional, but recommended.
58 }
59
60 /**
61 * Process settings form for configuration of individual alerts
62 *
63 * @param Alert $alert Alert currently being worked on.
64 */
65 public function save_fields( $alert ) {
66 // Implementation optional, but recommended.
67 }
68
69 /**
70 * Allow connectors to determine if their dependencies are satisfied or not
71 *
72 * @return bool
73 */
74 public function is_dependency_satisfied() {
75 // Implementation optional, but recommended.
76 return true;
77 }
78 }
79