/var/www/html_uk/wp-content/plugins/automatewoo/includes/AdminNotices/AbstractAdminNotice.php


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
<?php

namespace AutomateWoo\AdminNotices;

use 
AutomateWoo\AdminNotices;

defined'ABSPATH' ) || exit;

/**
 * Class AbstractAdminNotice
 *
 * @since 5.1.3
 */
abstract class AbstractAdminNotice implements AdminNoticeInterface {

    
/**
     * Get the unique notice ID.
     *
     * @return string
     */
    
abstract protected function get_id(): string;

    
/**
     * Init the notice, add hooks.
     */
    
public function init() {
        
/**
         * Add notice output hook.
         *
         * @see \AutomateWoo\AdminNotices::output_notices
         */
        
add_action'automatewoo/admin_notice/' $this->get_id(), [ $this'output' ] );
    }

    
/**
     * Adds the notice to the current admin notices.
     */
    
protected function add_notice() {
        
AdminNotices::add_notice$this->get_id() );
    }
}