Disable Comments - Version 1.7.1

Version Description

  • Small enhancements to hiding comment-related functionality in the admin.
Download this release

Release Info

Developer solarissmoke
Plugin Icon 128x128 Disable Comments
Version 1.7.1
Comparing to
See all releases

Code changes from version 1.7 to 1.7.1

Files changed (2) hide show
  1. disable-comments.php +15 -11
  2. readme.txt +4 -1
disable-comments.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Disable Comments
4
  Plugin URI: https://wordpress.org/plugins/disable-comments/
5
  Description: Allows administrators to globally disable comments on their site. Comments can be disabled according to post type.
6
- Version: 1.7
7
  Author: Samir Shah
8
  Author URI: http://www.rayofsolaris.net/
9
  License: GPL2
@@ -52,11 +52,11 @@ class Disable_Comments {
52
  }
53
 
54
  private function check_compatibility() {
55
- if ( version_compare( $GLOBALS['wp_version'], '3.8', '<' ) ) {
56
  require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
57
  deactivate_plugins( __FILE__ );
58
  if ( isset( $_GET['action'] ) && ( $_GET['action'] == 'activate' || $_GET['action'] == 'error_scrape' ) ) {
59
- exit( sprintf( __( 'Disable Comments requires WordPress version %s or greater.', 'disable-comments' ), '3.8' ) );
60
  }
61
  }
62
  }
@@ -185,7 +185,8 @@ class Disable_Comments {
185
 
186
  if( $this->options['remove_everywhere'] ) {
187
  add_action( 'admin_menu', array( $this, 'filter_admin_menu' ), 9999 ); // do this as late as possible
188
- add_action( 'admin_print_footer_scripts-index.php', array( $this, 'dashboard_js' ) );
 
189
  add_action( 'wp_dashboard_setup', array( $this, 'filter_dashboard' ) );
190
  add_filter( 'pre_option_default_pingback_flag', '__return_zero' );
191
  }
@@ -331,13 +332,16 @@ jQuery(document).ready(function($){
331
  remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );
332
  }
333
 
334
- public function dashboard_js(){
335
- echo '<script>
336
- jQuery(function($){
337
- $("#dashboard_right_now .comment-count, #latest-comments").hide();
338
- $("#welcome-panel .welcome-comments").parent().hide();
339
- });
340
- </script>';
 
 
 
341
  }
342
 
343
  public function filter_existing_comments($comments, $post_id) {
3
  Plugin Name: Disable Comments
4
  Plugin URI: https://wordpress.org/plugins/disable-comments/
5
  Description: Allows administrators to globally disable comments on their site. Comments can be disabled according to post type.
6
+ Version: 1.7.1
7
  Author: Samir Shah
8
  Author URI: http://www.rayofsolaris.net/
9
  License: GPL2
52
  }
53
 
54
  private function check_compatibility() {
55
+ if ( version_compare( $GLOBALS['wp_version'], '3.9', '<' ) ) {
56
  require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
57
  deactivate_plugins( __FILE__ );
58
  if ( isset( $_GET['action'] ) && ( $_GET['action'] == 'activate' || $_GET['action'] == 'error_scrape' ) ) {
59
+ exit( sprintf( __( 'Disable Comments requires WordPress version %s or greater.', 'disable-comments' ), '3.9' ) );
60
  }
61
  }
62
  }
185
 
186
  if( $this->options['remove_everywhere'] ) {
187
  add_action( 'admin_menu', array( $this, 'filter_admin_menu' ), 9999 ); // do this as late as possible
188
+ add_action( 'admin_print_styles-index.php', array( $this, 'admin_css' ) );
189
+ add_action( 'admin_print_styles-profile.php', array( $this, 'admin_css' ) );
190
  add_action( 'wp_dashboard_setup', array( $this, 'filter_dashboard' ) );
191
  add_filter( 'pre_option_default_pingback_flag', '__return_zero' );
192
  }
332
  remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );
333
  }
334
 
335
+ public function admin_css(){
336
+ echo '<style>
337
+ #dashboard_right_now .comment-count,
338
+ #dashboard_right_now .comment-mod-count,
339
+ #latest-comments,
340
+ #welcome-panel .welcome-comments,
341
+ .user-comment-shortcuts-wrap {
342
+ display: none !important;
343
+ }
344
+ </style>';
345
  }
346
 
347
  public function filter_existing_comments($comments, $post_id) {
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: solarissmoke
3
  Donate link: http://www.rayofsolaris.net/donate/
4
  Tags: comments, disable, global
5
  Requires at least: 4.1
6
- Tested up to: 4.8
7
  Stable tag: trunk
8
 
9
  Allows administrators to globally disable comments on their site. Comments can be disabled according to post type. Multisite friendly. Provides tool to delete all comments or according to post type.
@@ -72,6 +72,9 @@ These definitions can be made either in your main `wp-config.php` or in your the
72
 
73
  == Changelog ==
74
 
 
 
 
75
  = 1.7 =
76
  * Dropped logic to try and hide the comments link from the Meta widget. Administrators should manually add styling to hide this link, or replace the Meta widget with an alternative.
77
  * Removed the `disable_comments_allow_persistent_mode` filter. Define `DISABLE_COMMENTS_ALLOW_PERSISTENT_MODE` instead.
3
  Donate link: http://www.rayofsolaris.net/donate/
4
  Tags: comments, disable, global
5
  Requires at least: 4.1
6
+ Tested up to: 4.9
7
  Stable tag: trunk
8
 
9
  Allows administrators to globally disable comments on their site. Comments can be disabled according to post type. Multisite friendly. Provides tool to delete all comments or according to post type.
72
 
73
  == Changelog ==
74
 
75
+ = 1.7.1 =
76
+ * Small enhancements to hiding comment-related functionality in the admin.
77
+
78
  = 1.7 =
79
  * Dropped logic to try and hide the comments link from the Meta widget. Administrators should manually add styling to hide this link, or replace the Meta widget with an alternative.
80
  * Removed the `disable_comments_allow_persistent_mode` filter. Define `DISABLE_COMMENTS_ALLOW_PERSISTENT_MODE` instead.