Skip to content
Snippets Groups Projects
Commit 775baaf3 authored by lucha's avatar lucha
Browse files

[auto] plugin: disable-comments 1.7.1

parent 52534bdf
Branches
No related tags found
No related merge requests found
......@@ -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) {
......
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment