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
|
<?php
namespace AutomateWoo\Async_Events;
use AutomateWoo\Review;
defined( 'ABSPATH' ) || exit;
/** * Class Review_Approved * * @since 4.8.0 * @package AutomateWoo */ class Review_Approved extends Abstract_Async_Event {
/** * Init the event. */ public function init() { add_action( 'automatewoo/review/posted', [ $this, 'schedule_event' ] ); }
/** * Get the async event hook name. * * @since 5.2.0 * * @return string */ public function get_hook_name(): string { return 'automatewoo/review/posted_async'; }
/** * Schedule async event. * * @param Review $review */ public function schedule_event( $review ) { $this->create_async_event( [ $review->get_id() ] ); } }
|