From 775baaf3fb05e78a30f44ccd3e4827445b0a3356 Mon Sep 17 00:00:00 2001
From: lucha <lucha@paranoici.org>
Date: Thu, 23 Nov 2017 15:00:03 -0800
Subject: [PATCH] [auto] plugin: disable-comments 1.7.1

---
 .../disable-comments/disable-comments.php     | 26 +++++++++++--------
 .../plugins/disable-comments/readme.txt       |  5 +++-
 2 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/wp-content/plugins/disable-comments/disable-comments.php b/wp-content/plugins/disable-comments/disable-comments.php
index d0687e22e..35ae36291 100644
--- a/wp-content/plugins/disable-comments/disable-comments.php
+++ b/wp-content/plugins/disable-comments/disable-comments.php
@@ -3,7 +3,7 @@
 Plugin Name: Disable Comments
 Plugin URI: https://wordpress.org/plugins/disable-comments/
 Description: Allows administrators to globally disable comments on their site. Comments can be disabled according to post type.
-Version: 1.7
+Version: 1.7.1
 Author: Samir Shah
 Author URI: http://www.rayofsolaris.net/
 License: GPL2
@@ -52,11 +52,11 @@ class Disable_Comments {
 	}
 
 	private function check_compatibility() {
-		if ( version_compare( $GLOBALS['wp_version'], '3.8', '<' ) ) {
+		if ( version_compare( $GLOBALS['wp_version'], '3.9', '<' ) ) {
 			require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
 			deactivate_plugins( __FILE__ );
 			if ( isset( $_GET['action'] ) && ( $_GET['action'] == 'activate' || $_GET['action'] == 'error_scrape' ) ) {
-				exit( sprintf( __( 'Disable Comments requires WordPress version %s or greater.', 'disable-comments' ), '3.8' ) );
+				exit( sprintf( __( 'Disable Comments requires WordPress version %s or greater.', 'disable-comments' ), '3.9' ) );
 			}
 		}
 	}
@@ -185,7 +185,8 @@ class Disable_Comments {
 
 			if( $this->options['remove_everywhere'] ) {
 				add_action( 'admin_menu', array( $this, 'filter_admin_menu' ), 9999 );	// do this as late as possible
-				add_action( 'admin_print_footer_scripts-index.php', array( $this, 'dashboard_js' ) );
+				add_action( 'admin_print_styles-index.php', array( $this, 'admin_css' ) );
+				add_action( 'admin_print_styles-profile.php', array( $this, 'admin_css' ) );
 				add_action( 'wp_dashboard_setup', array( $this, 'filter_dashboard' ) );
 				add_filter( 'pre_option_default_pingback_flag', '__return_zero' );
 			}
@@ -331,13 +332,16 @@ jQuery(document).ready(function($){
 		remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );
 	}
 
-	public function dashboard_js(){
-		echo '<script>
-		jQuery(function($){
-			$("#dashboard_right_now .comment-count, #latest-comments").hide();
-		 	$("#welcome-panel .welcome-comments").parent().hide();
-		});
-		</script>';
+	public function admin_css(){
+		echo '<style>
+			#dashboard_right_now .comment-count,
+			#dashboard_right_now .comment-mod-count,
+			#latest-comments,
+			#welcome-panel .welcome-comments,
+			.user-comment-shortcuts-wrap {
+				display: none !important;
+			}
+		</style>';
 	}
 
 	public function filter_existing_comments($comments, $post_id) {
diff --git a/wp-content/plugins/disable-comments/readme.txt b/wp-content/plugins/disable-comments/readme.txt
index b2a20d89e..2f944d425 100644
--- a/wp-content/plugins/disable-comments/readme.txt
+++ b/wp-content/plugins/disable-comments/readme.txt
@@ -3,7 +3,7 @@ Contributors: solarissmoke
 Donate link: http://www.rayofsolaris.net/donate/
 Tags: comments, disable, global
 Requires at least: 4.1
-Tested up to: 4.8
+Tested up to: 4.9
 Stable tag: trunk
 
 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
 
 == Changelog ==
 
+= 1.7.1 =
+* Small enhancements to hiding comment-related functionality in the admin.
+
 = 1.7 =
 * 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.
 * Removed the `disable_comments_allow_persistent_mode` filter. Define `DISABLE_COMMENTS_ALLOW_PERSISTENT_MODE` instead.
-- 
GitLab