-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclass-my-reading-time.php
60 lines (42 loc) · 1.18 KB
/
class-my-reading-time.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
namespace MyReadingTime;
defined( 'ABSPATH' ) || exit;
class JLTMA_My_Reading_Time {
private static $_instance = null;
public $mrt;
// Allowed HTML Tags
public static $mrt_attr = [
'strong' => [],
'br' => [],
'b' => [],
'em' => []
];
public function __construct(){
$this->jltma_mrt_include_files();
}
public function jltma_mrt_include_files(){
include( MRT_DIR . '/inc/fa-icons.php');
include( MRT_DIR . '/inc/functions.php');
include( MRT_DIR . '/inc/hooks.php');
include( MRT_DIR . '/inc/shortcodes.php');
// Admin Settings
include( MRT_DIR . '/admin/class.settings-api.php');
include( MRT_DIR . '/admin/my-reading-time-settings.php');
}
// My Reading Times Filter
public static function jltma_mrt_times($time, $single, $plugral ) {
if ( $time > 1 ) {
$mrt_in_times = $plugral;
} else {
$mrt_in_times = $single;
}
$mrt_in_times = apply_filters( 'mrt_edit_times', $mrt_in_times, $time, $single, $plugral );
return $mrt_in_times;
}
public static function get_instance() {
if ( is_null( self::$_instance ) ) {
self::$_instance = new self();
}
return self::$_instance;
}
}