PluginProbe ʕ •ᴥ•ʔ
Disable Comments / 1.0.8
Disable Comments v1.0.8
1.0.26 1.0.27 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 1.0.23 1.0.24 1.0.25
disable-comments-rb / options.php
disable-comments-rb Last commit date
languages 7 years ago class_rb_disable-comments.php 7 years ago disable-comments-rb.php 7 years ago options.php 7 years ago readme.txt 7 years ago screenshot-1.png 7 years ago screenshot-2.png 7 years ago
options.php
66 lines
1 <?php
2 /*
3 * RB Disable Comments
4 * Version: 1.0.6 - 78233
5 * Author: RBS
6 * Date: Thu, 24 Aug 2017 12:11:29 GMT
7 */
8
9 if( !defined('WPINC') || !defined("ABSPATH") ){
10 die();
11 }
12
13 $types = get_post_types( array( 'public' => true ), 'objects' );
14 foreach( array_keys( $types ) as $type ) {
15 if( ! in_array( $type, $this->modified_types ) && ! post_type_supports( $type, 'comments' ) )
16 unset( $types[$type] );
17 }
18
19 if ( isset( $_POST['submit'] ) ) {
20 check_admin_referer( 'disable-comments-rb-options' );
21 $this->options['remove_everywhere'] = ( $_POST['mode'] == 'remove_everywhere' );
22
23 if( $this->options['remove_everywhere'] )
24 $disabled_post_types = array_keys( $types );
25 else
26 $disabled_post_types = array() ;
27
28 $disabled_post_types = array_intersect( $disabled_post_types, array_keys( $types ) );
29
30 $this->options['disabled_post_types'] = $disabled_post_types;
31
32 $this->save_options();
33 }
34 ?>
35 <style> .indent {padding-left: 2em} </style>
36 <div class="wrap">
37 <h1><?php _e( 'Disable Comments RB', 'disable-comments-rb'); ?></h1>
38 <p>
39 <?php _e('Here you can configure your disabled comments tools. Section with all configuration settings of this tool.', 'disable-comments-rb') ;?>
40 </p>
41 <form action="" method="post" id="disable-comments">
42 <ul>
43 <li>
44 <label for="remove_everywhere">
45 <input type="radio" id="remove_everywhere" name="mode" value="remove_everywhere" <?php checked( isset($this->options['remove_everywhere']) && $this->options['remove_everywhere'] );?> />
46 <strong>
47 <?php _e( 'Disable all comments', 'disable-comments-rb'); ?>
48 </strong>
49 </label>
50 </li>
51 <li>
52 <label for="rb_disable_comments_off">
53 <input type="radio" id="rb_disable_comments_off" name="mode" value="rb_disable_comments_off" <?php checked( !isset($this->options['remove_everywhere']) || !$this->options['remove_everywhere'] );?> />
54 <strong>
55 <?php _e( 'Enable all Comments (comments on entire site will be turned on)', 'disable-comments-rb'); ?>
56 </strong>
57 </label>
58 </li>
59 </ul>
60 <?php wp_nonce_field( 'disable-comments-rb-options' ); ?>
61 <p class="submit">
62 <input class="button-primary" type="submit" name="submit" value="<?php _e( 'Save Changes', 'disable-comments-rb') ?>">
63 </p>
64 </form>
65 </div>
66