PluginProbe ʕ •ᴥ•ʔ
Disable Comments / 1.0.5
Disable Comments v1.0.5
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 8 years ago class_rb_disable-comments.php 8 years ago disable-comments-rb.php 8 years ago options.php 8 years ago readme.txt 8 years ago screenshot-1.png 8 years ago screenshot-2.png 8 years ago
options.php
68 lines
1 <?php
2 /*
3 * RB Disable Comments
4 * Version: 1.0.5 - 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
29 $disabled_post_types = array_intersect( $disabled_post_types, array_keys( $types ) );
30
31
32 $this->options['disabled_post_types'] = $disabled_post_types;
33
34 $this->save_options();
35 }
36 ?>
37 <style> .indent {padding-left: 2em} </style>
38 <div class="wrap">
39 <h1><?php _e( 'Disable Comments RB', 'disable-comments-rb'); ?></h1>
40 <p>
41 Here you can configure your disabled comments tools. Section with all configuration settings of this tool.
42 </p>
43 <form action="" method="post" id="disable-comments">
44 <ul>
45 <li>
46 <label for="remove_everywhere">
47 <input type="radio" id="remove_everywhere" name="mode" value="remove_everywhere" <?php checked( $this->options['remove_everywhere'] );?> />
48 <strong>
49 <?php _e( 'Disable all comments'); ?>
50 </strong>
51 </label>
52 </li>
53 <li>
54 <label for="rb_disable_comments_off">
55 <input type="radio" id="rb_disable_comments_off" name="mode" value="rb_disable_comments_off" <?php checked( !$this->options['remove_everywhere'] );?> />
56 <strong>
57 <?php _e( 'Enable'); ?>
58 </strong>
59 </label>
60 </li>
61 </ul>
62 <?php wp_nonce_field( 'disable-comments-rb-options' ); ?>
63 <p class="submit">
64 <input class="button-primary" type="submit" name="submit" value="<?php _e( 'Save Changes') ?>">
65 </p>
66 </form>
67 </div>
68