-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdxuc-unanswered-comments-admin-page.php
53 lines (46 loc) · 1.81 KB
/
dxuc-unanswered-comments-admin-page.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
<?php
/**
* A settings page content for the administration menu
*
* @since 1.0
*/
?>
<div class="wrap">
<?php
$authors_list = get_option( 'dxuc_authors_list', 'admin' );
$comment_count = get_option( 'dxuc_comment_count', false );
if ( ! empty( $_POST ) ) {
if ( ! empty( $_POST['dxuc_authors'] ) ) {
$authors_list = esc_html( $_POST['dxuc_authors'] );
if ( empty( $authors_list ) ) {
$authors_list = 'admin';
}
update_option( 'dxuc_authors_list', $authors_list );
}
if ( ! empty( $_POST['dxuc_comment_count'] ) ) {
$comment_count = true;
update_option( 'dxuc_comment_count', 1 );
} else {
$comment_count = false;
update_option( 'dxuc_comment_count', 0 );
}
}
?>
<h2><?php _e( 'DX Unanswered Comments', 'dx-unanswered-comments' ); ?></h2>
<p><?php _e( 'Enter the username of the WordPress user who is supposed to reply to commenters.', 'dx-unanswered-comments' ); ?></p>
<p><?php _e( 'You can several usernames separated by commas.', 'dx-unanswered-comments' ); ?></p>
<p><?php _e( 'Enable comment count in the top links comment filters if you need it.', 'dx-unanswered-comments' ); ?></p>
<form method="POST">
<p>
<label id="dxuc-authors-label" for="dxuc-authors"><?php _e( 'Authors List', 'dx-unanswered-comments' ); ?></label>
<input type="text" id="dxuc-authors" name="dxuc_authors" value="<?php echo esc_attr( $authors_list ); ?>" />
</p>
<p>
<label id="dxuc-comment-count-label" for="dxuc-comment-count"><?php _e( 'Comment Count (if enabled adds some extra database load)', 'dx-unanswered-comments' ); ?></label>
<input type="checkbox" id="dxuc-comment-count" name="dxuc_comment_count" <?php checked( $comment_count, true, true ); ?> />
</p>
<p>
<input type="submit" value="<?php _e( 'Save Users', 'dx-unanswered-comments' ); ?>" />
</p>
</form>
</div>