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
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Plugin Name: Disable Comments Plugin Name: Disable Comments
Plugin URI: https://wordpress.org/plugins/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. 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: Samir Shah
Author URI: http://www.rayofsolaris.net/ Author URI: http://www.rayofsolaris.net/
License: GPL2 License: GPL2
...@@ -52,11 +52,11 @@ class Disable_Comments { ...@@ -52,11 +52,11 @@ class Disable_Comments {
} }
private function check_compatibility() { 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' ); require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
deactivate_plugins( __FILE__ ); deactivate_plugins( __FILE__ );
if ( isset( $_GET['action'] ) && ( $_GET['action'] == 'activate' || $_GET['action'] == 'error_scrape' ) ) { 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 { ...@@ -185,7 +185,8 @@ class Disable_Comments {
if( $this->options['remove_everywhere'] ) { if( $this->options['remove_everywhere'] ) {
add_action( 'admin_menu', array( $this, 'filter_admin_menu' ), 9999 ); // do this as late as possible 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_action( 'wp_dashboard_setup', array( $this, 'filter_dashboard' ) );
add_filter( 'pre_option_default_pingback_flag', '__return_zero' ); add_filter( 'pre_option_default_pingback_flag', '__return_zero' );
} }
...@@ -331,13 +332,16 @@ jQuery(document).ready(function($){ ...@@ -331,13 +332,16 @@ jQuery(document).ready(function($){
remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' ); remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );
} }
public function dashboard_js(){ public function admin_css(){
echo '<script> echo '<style>
jQuery(function($){ #dashboard_right_now .comment-count,
$("#dashboard_right_now .comment-count, #latest-comments").hide(); #dashboard_right_now .comment-mod-count,
$("#welcome-panel .welcome-comments").parent().hide(); #latest-comments,
}); #welcome-panel .welcome-comments,
</script>'; .user-comment-shortcuts-wrap {
display: none !important;
}
</style>';
} }
public function filter_existing_comments($comments, $post_id) { public function filter_existing_comments($comments, $post_id) {
......
...@@ -3,7 +3,7 @@ Contributors: solarissmoke ...@@ -3,7 +3,7 @@ Contributors: solarissmoke
Donate link: http://www.rayofsolaris.net/donate/ Donate link: http://www.rayofsolaris.net/donate/
Tags: comments, disable, global Tags: comments, disable, global
Requires at least: 4.1 Requires at least: 4.1
Tested up to: 4.8 Tested up to: 4.9
Stable tag: trunk 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. 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,6 +72,9 @@ These definitions can be made either in your main `wp-config.php` or in your the
== Changelog == == Changelog ==
= 1.7.1 =
* Small enhancements to hiding comment-related functionality in the admin.
= 1.7 = = 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. * 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. * 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