PluginProbe
OttoKit: All-in-One Automation Platform / 1.1.38
OttoKit: All-in-One Automation Platform v1.1.38
1.1.38 1.1.37 1.1.36 1.1.35 1.1.34 1.1.33 1.1.32 1.1.31 1.1.30 1.1.29 1.1.28 1.1.27 1.1.9 trunk 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.20 All 124 releases
suretriggers / src / Integrations / fluentcommunity / triggers / comment-deleted.php
comment-deleted.php
85 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * CommentDeleted.
4 * php version 5.6
5 *
6 * @category CommentDeleted
7 * @package SureTriggers
8 * @author BSF
9 * @license https://www.gnu.org/licenses/gpl-3.0.html GPLv3
10 * @link https://www.brainstormforce.com/
11 * @since 1.0.0
12 */
13
14 namespace SureTriggers\Integrations\FluentCommunity\Triggers;
15
16 use SureTriggers\Controllers\AutomationController;
17 use SureTriggers\Traits\SingletonLoader;
18
19 if ( ! class_exists( 'CommentDeleted' ) ) :
20
21 /**
22 * CommentDeleted
23 *
24 * @category CommentDeleted
25 * @package SureTriggers
26 * @since 1.0.0
27 */
28 class CommentDeleted {
29
30 /**
31 * Integration type.
32 *
33 * @var string
34 */
35 public $integration = 'FluentCommunity';
36
37 /**
38 * Trigger name.
39 *
40 * @var string
41 */
42 public $trigger = 'fc_comment_deleted';
43
44 use SingletonLoader;
45
46 /**
47 * Constructor
48 *
49 * @since 1.0.0
50 */
51 public function __construct() {
52 add_action( 'fluent_community/comment_deleted', [ $this, 'trigger_listener' ], 10, 2 );
53 }
54
55 /**
56 * Trigger listener.
57 *
58 * @param object $comment_id The newly created comment id.
59 * @param object $feed The newly created feed object.
60 * @return void
61 */
62 public function trigger_listener( $comment_id, $feed ) {
63
64 if ( empty( $comment_id ) ) {
65 return;
66 }
67
68 // Prepare context with the course object.
69 $context = [
70 'comment_id' => $comment_id,
71 ];
72
73 AutomationController::sure_trigger_handle_trigger(
74 [
75 'trigger' => $this->trigger,
76 'context' => $context,
77 ]
78 );
79 }
80 }
81
82 CommentDeleted::get_instance();
83
84 endif;
85