ALNP_Privacy::add_privacy_policy_guide_content()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Auto Load Next Post - Privacy Policy.
4
 *
5
 * Adds a message in the WP Privacy Policy Guide page.
6
 * 
7
 * @since    1.6.0
8
 * @author   Sébastien Dumont
9
 * @category Admin
10
 * @package  Auto Load Next Post/Admin
11
 * @license  GPL-2.0+
12
 */
13
14
// Exit if accessed directly.
15
if ( ! defined( 'ABSPATH' ) ) {
16
	exit;
17
}
18
19
if ( ! class_exists( 'ALNP_Privacy' ) ) {
20
21
	class ALNP_Privacy {
22
23
		/**
24
		 * Constructor
25
		 *
26
		 * @access  public
27
		 */
28
		public function __construct() {
29
			add_action( 'admin_init', array( $this, 'add_privacy_policy_guide_content' ) );
30
		} // END __construct()
31
32
		/**
33
		 * Add a message in the WP Privacy Policy Guide page.
34
		 *
35
		 * @access public
36
		 * @static
37
		 */
38
		public static function add_privacy_policy_guide_content() {
39
			if ( function_exists( 'wp_add_privacy_policy_content' ) ) {
40
				wp_add_privacy_policy_content( esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ), self::get_privacy_policy_guide_message() );
41
			}
42
		} // END add_privacy_policy_guide_content()
43
44
		/**
45
		 * Message to add in the WP Privacy Policy Guide page.
46
		 *
47
		 * @access protected
48
		 * @static
49
		 * @return string
50
		 */
51
		protected static function get_privacy_policy_guide_message() {
52
			$content = '
53
				<div class="wp-suggested-text">' .
54
					'<p class="privacy-policy-tutorial">' .
55
						sprintf( __( '%s does not collect, store or share any personal data.', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ) .
56
					'</p>' .
57
				'</div>';
58
59
			return $content;
60
		} // END get_privacy_policy_guide_message()
61
62
	} // END class
63
64
} // END if class exists
65
66
return new ALNP_Privacy();
67