Disable Comments - Version 1.0.6

Version Description

Download this release

Release Info

Developer rbplugins
Plugin Icon 128x128 Disable Comments
Version 1.0.6
Comparing to
See all releases

Code changes from version 1.0.5 to 1.0.6

class_rb_disable-comments.php CHANGED
@@ -1,7 +1,7 @@
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
  */
@@ -11,7 +11,7 @@ if( !defined('WPINC') || !defined("ABSPATH") ){
11
  }
12
 
13
 
14
- class Robo_Disable_Comments {
15
 
16
  private static $instance = null;
17
 
@@ -38,13 +38,16 @@ class Robo_Disable_Comments {
38
 
39
 
40
  private function get_disabled_post_types() {
41
- $types = $this->options['disabled_post_types'];
 
 
 
42
  return $types;
43
  }
44
 
45
 
46
  private function hooks() {
47
- if( $this->options['remove_everywhere'] ) {
48
  add_action( 'widgets_init', array( $this, 'disable_rc_widget' ) );
49
  add_filter( 'wp_headers', array( $this, 'filter_wp_headers' ) );
50
  add_action( 'template_redirect', array( $this, 'filter_query' ), 9 );
@@ -85,7 +88,7 @@ class Robo_Disable_Comments {
85
  add_action( 'admin_menu', array( $this, 'settings_menu' ) );
86
  add_filter( 'plugin_action_links', array( $this, 'plugin_actions_links'), 10, 2 );
87
 
88
- if( $this->options['remove_everywhere'] ) {
89
  add_action( 'admin_menu', array( $this, 'filter_admin_menu' ), 9999 );
90
  add_action( 'admin_print_footer_scripts-index.php', array( $this, 'dashboard_js' ) );
91
  add_action( 'wp_dashboard_setup', array( $this, 'filter_dashboard' ) );
@@ -94,7 +97,7 @@ class Robo_Disable_Comments {
94
  } else {
95
  add_action( 'template_redirect', array( $this, 'check_comment_template' ) );
96
 
97
- if( $this->options['remove_everywhere'] ) {
98
  add_filter( 'feed_links_show_comments_feed', '__return_false' );
99
  add_action( 'wp_footer', array( $this, 'hide_meta_widget_link' ), 100 );
100
  }
@@ -102,7 +105,7 @@ class Robo_Disable_Comments {
102
  }
103
 
104
  public function check_comment_template() {
105
- if( is_singular() && ( $this->options['remove_everywhere'] ) ) {
106
  wp_deregister_script( 'comment-reply' );
107
  remove_action( 'wp_head', 'feed_links_extra', 3 );
108
  }
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
  */
11
  }
12
 
13
 
14
+ class Rbs_Disable_Comments {
15
 
16
  private static $instance = null;
17
 
38
 
39
 
40
  private function get_disabled_post_types() {
41
+ $types = '';
42
+ if(isset($this->options['disabled_post_types']) && $this->options['disabled_post_types'] ){
43
+ $types = $this->options['disabled_post_types'];
44
+ }
45
  return $types;
46
  }
47
 
48
 
49
  private function hooks() {
50
+ if( isset($this->options['remove_everywhere']) && $this->options['remove_everywhere'] ) {
51
  add_action( 'widgets_init', array( $this, 'disable_rc_widget' ) );
52
  add_filter( 'wp_headers', array( $this, 'filter_wp_headers' ) );
53
  add_action( 'template_redirect', array( $this, 'filter_query' ), 9 );
88
  add_action( 'admin_menu', array( $this, 'settings_menu' ) );
89
  add_filter( 'plugin_action_links', array( $this, 'plugin_actions_links'), 10, 2 );
90
 
91
+ if( isset($this->options['remove_everywhere']) && $this->options['remove_everywhere'] ) {
92
  add_action( 'admin_menu', array( $this, 'filter_admin_menu' ), 9999 );
93
  add_action( 'admin_print_footer_scripts-index.php', array( $this, 'dashboard_js' ) );
94
  add_action( 'wp_dashboard_setup', array( $this, 'filter_dashboard' ) );
97
  } else {
98
  add_action( 'template_redirect', array( $this, 'check_comment_template' ) );
99
 
100
+ if( isset($this->options['remove_everywhere']) && $this->options['remove_everywhere'] ) {
101
  add_filter( 'feed_links_show_comments_feed', '__return_false' );
102
  add_action( 'wp_footer', array( $this, 'hide_meta_widget_link' ), 100 );
103
  }
105
  }
106
 
107
  public function check_comment_template() {
108
+ if( is_singular() && ( isset($this->options['remove_everywhere']) && $this->options['remove_everywhere'] ) ) {
109
  wp_deregister_script( 'comment-reply' );
110
  remove_action( 'wp_head', 'feed_links_extra', 3 );
111
  }
disable-comments-rb.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Disable Comments RB
4
  Plugin URI: https://robosoft.co/wordpress-plugins/disable-comments
5
  Description: Easy tool to disable comments for your blog posts, pages. Admin can disable comments in just few clicks. Delete comments from blog post.
6
- Version: 1.0.5
7
  Author: rbPlugins
8
  Author URI: https://robosoft.co/wordpress-plugins/disable-comments
9
  License: GPL2
@@ -14,10 +14,8 @@ Domain Path: /languages/
14
  if( !defined('WPINC') || !defined("ABSPATH") ) die();
15
 
16
  define("RB_DISABLE_COMMENTS_PATH", plugin_dir_path( __FILE__ ) );
17
- define("RB_DISABLE_COMMENTS_VERSION", '1.0.5' );
18
 
19
  include_once( RB_DISABLE_COMMENTS_PATH .'class_rb_disable-comments.php');
20
 
21
- //$rb_DisableComments = new Robo_Disable_Comments();
22
-
23
- Robo_Disable_Comments::get_instance();
3
  Plugin Name: Disable Comments RB
4
  Plugin URI: https://robosoft.co/wordpress-plugins/disable-comments
5
  Description: Easy tool to disable comments for your blog posts, pages. Admin can disable comments in just few clicks. Delete comments from blog post.
6
+ Version: 1.0.6
7
  Author: rbPlugins
8
  Author URI: https://robosoft.co/wordpress-plugins/disable-comments
9
  License: GPL2
14
  if( !defined('WPINC') || !defined("ABSPATH") ) die();
15
 
16
  define("RB_DISABLE_COMMENTS_PATH", plugin_dir_path( __FILE__ ) );
17
+ define("RB_DISABLE_COMMENTS_VERSION", '1.0.6' );
18
 
19
  include_once( RB_DISABLE_COMMENTS_PATH .'class_rb_disable-comments.php');
20
 
21
+ Rbs_Disable_Comments::get_instance();
 
 
options.php CHANGED
@@ -1,9 +1,9 @@
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") ){
@@ -44,7 +44,7 @@ if ( isset( $_POST['submit'] ) ) {
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>
@@ -52,7 +52,7 @@ if ( isset( $_POST['submit'] ) ) {
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>
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") ){
44
  <ul>
45
  <li>
46
  <label for="remove_everywhere">
47
+ <input type="radio" id="remove_everywhere" name="mode" value="remove_everywhere" <?php checked( isset($this->options['remove_everywhere']) && $this->options['remove_everywhere'] );?> />
48
  <strong>
49
  <?php _e( 'Disable all comments'); ?>
50
  </strong>
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( !isset($this->options['remove_everywhere']) || !$this->options['remove_everywhere'] );?> />
56
  <strong>
57
  <?php _e( 'Enable'); ?>
58
  </strong>