1010
1111/**
1212 * Task for the comment moderation.
13+ *
14+ * @property string $url
1315 */
1416class Comment_Moderation extends Repetitive {
1517
@@ -34,6 +36,35 @@ class Comment_Moderation extends Repetitive {
3436 */
3537 protected const CAPABILITY = 'moderate_comments ' ;
3638
39+ /**
40+ * Constructor.
41+ *
42+ * @property string $url
43+ *
44+ * @return void
45+ */
46+ public function __construct () {
47+ $ this ->url = \admin_url ( 'edit-comments.php?comment_status=moderated ' );
48+ }
49+
50+ /**
51+ * Get the title.
52+ *
53+ * @return string
54+ */
55+ public function get_title () {
56+ return \esc_html__ ( 'Moderate comments ' , 'comment-hacks ' );
57+ }
58+
59+ /**
60+ * Get the description.
61+ *
62+ * @return string
63+ */
64+ public function get_description () {
65+ return \esc_html__ ( 'Moderate comments to make sure they are not spam. ' , 'comment-hacks ' );
66+ }
67+
3768 /**
3869 * Check if the task should be added.
3970 *
@@ -74,13 +105,13 @@ public function get_task_details( $task_id = '' ) {
74105
75106 return [
76107 'task_id ' => $ task_id ,
77- 'title ' => \esc_html__ ( ' Moderate comments ' , ' comment-hacks ' ),
108+ 'title ' => $ this -> get_title ( ),
78109 'parent ' => 0 ,
79110 'priority ' => 'high ' ,
80111 'category ' => $ this ->get_provider_category (),
81112 'points ' => 1 ,
82- 'url ' => $ this ->capability_required () ? \esc_url ( \admin_url ( ' edit-comments.php?comment_status=moderated ' ) ) : '' ,
83- 'description ' => ' <p> ' . \esc_html__ ( ' Moderate comments to make sure they are not spam. ' , ' comment-hacks ' ) . ' </p> ' ,
113+ 'url ' => $ this ->get_url () ,
114+ 'description ' => $ this -> get_description () ,
84115 ];
85116 }
86117}
0 commit comments