Commit 4f8f1748 authored by lucha's avatar lucha
Browse files

[auto] plugin: disable-comments 1.7

parent c8fab4ac
......@@ -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.6
Version: 1.7
Author: Samir Shah
Author URI: http://www.rayofsolaris.net/
License: GPL2
......@@ -28,7 +28,7 @@ class Disable_Comments {
return self::$instance;
}
private function __construct() {
function __construct() {
// are we network activated?
$this->networkactive = ( is_multisite() && array_key_exists( plugin_basename( __FILE__ ), (array) get_site_option( 'active_sitewide_plugins' ) ) );
......@@ -196,7 +196,6 @@ class Disable_Comments {
if( $this->options['remove_everywhere'] ) {
add_filter( 'feed_links_show_comments_feed', '__return_false' );
add_action( 'wp_footer', array( $this, 'hide_meta_widget_link' ), 100 );
}
}
}
......@@ -341,12 +340,6 @@ jQuery(document).ready(function($){
</script>';
}
public function hide_meta_widget_link(){
if ( is_active_widget( false, false, 'meta', true ) && wp_script_is( 'jquery', 'enqueued' ) ) {
echo '<script> jQuery(function($){ $(".widget_meta a[href=\'' . esc_url( get_bloginfo( 'comments_rss2_url' ) ) . '\']").parent().remove(); }); </script>';
}
}
public function filter_existing_comments($comments, $post_id) {
$post = get_post( $post_id );
return ( $this->options['remove_everywhere'] || $this->is_post_type_disabled( $post->post_type ) ) ? array() : $comments;
......@@ -388,7 +381,7 @@ jQuery(document).ready(function($){
}
public function settings_menu() {
$title = __( 'Disable Comments', 'disable-comments' );
$title = _x( 'Disable Comments', 'settings menu title', 'disable-comments' );
if( $this->networkactive )
add_submenu_page( 'settings.php', $title, $title, 'manage_network_plugins', 'disable_comments_settings', array( $this, 'settings_page' ) );
else
......@@ -443,8 +436,6 @@ jQuery(document).ready(function($){
if( defined( 'DISABLE_COMMENTS_ALLOW_PERSISTENT_MODE' ) && DISABLE_COMMENTS_ALLOW_PERSISTENT_MODE == false ) {
return false;
}
// The filter below is deprecated and will be removed in future versions. Use the define instead.
return apply_filters( 'disable_comments_allow_persistent_mode', true );
}
public function single_site_deactivate() {
......
......@@ -46,7 +46,7 @@ if ( isset( $_POST['submit'] ) ) {
?>
<style> .indent {padding-left: 2em} </style>
<div class="wrap">
<h1><?php _e( 'Disable Comments', 'disable-comments') ?></h1>
<h1><?php _e( 'Disable Comments', 'settings page title', 'disable-comments') ?></h1>
<?php
if( $this->networkactive )
echo '<div class="updated"><p>' . __( '<em>Disable Comments</em> is Network Activated. The settings below will affect <strong>all sites</strong> in this network.', 'disable-comments') . '</p></div>';
......
# Copyright (C) 2016 Disable Comments
# Copyright (C) 2017 Disable Comments
# This file is distributed under the same license as the Disable Comments package.
msgid ""
msgstr ""
"Project-Id-Version: Disable Comments 1.6\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/disable-comments\n"
"POT-Creation-Date: 2016-12-02 07:47:59+00:00\n"
"POT-Creation-Date: 2017-07-08 03:05:14+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2016-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: 2017-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -21,7 +21,10 @@ msgid "Comments are closed."
msgstr ""
#: disable-comments.php:289
msgid "Note: The <em>Disable Comments</em> plugin is currently active, and comments are completely disabled on: %s. Many of the settings below will not be applicable for those post types."
msgid ""
"Note: The <em>Disable Comments</em> plugin is currently active, and comments "
"are completely disabled on: %s. Many of the settings below will not be "
"applicable for those post types."
msgstr ""
#: disable-comments.php:289
......@@ -29,7 +32,10 @@ msgid ", "
msgstr ""
#: disable-comments.php:317
msgid "The <em>Disable Comments</em> plugin is active, but isn't configured to do anything yet. Visit the <a href=\"%s\">configuration page</a> to choose which post types to disable comments on."
msgid ""
"The <em>Disable Comments</em> plugin is active, but isn't configured to do "
"anything yet. Visit the <a href=\"%s\">configuration page</a> to choose "
"which post types to disable comments on."
msgstr ""
#: disable-comments.php:382
......@@ -40,7 +46,8 @@ msgstr ""
msgid "Tools"
msgstr ""
#: disable-comments.php:391 includes/settings-page.php:49
#: disable-comments.php:391
msgctxt "settings menu title"
msgid "Disable Comments"
msgstr ""
......@@ -50,19 +57,34 @@ msgid "Delete Comments"
msgstr ""
#: includes/settings-page.php:43
msgid "If a caching/performance plugin is active, please invalidate its cache to ensure that changes are reflected immediately."
msgid ""
"If a caching/performance plugin is active, please invalidate its cache to "
"ensure that changes are reflected immediately."
msgstr ""
#: includes/settings-page.php:44
msgid "Options updated. Changes to the Admin Menu and Admin Bar will not appear until you leave or reload this page."
msgid ""
"Options updated. Changes to the Admin Menu and Admin Bar will not appear "
"until you leave or reload this page."
msgstr ""
#. #-#-#-#-# disable-comments.pot (Disable Comments 1.6) #-#-#-#-#
#. Plugin Name of the plugin/theme
#: includes/settings-page.php:49
msgid "Disable Comments"
msgstr ""
#: includes/settings-page.php:52
msgid "<em>Disable Comments</em> is Network Activated. The settings below will affect <strong>all sites</strong> in this network."
msgid ""
"<em>Disable Comments</em> is Network Activated. The settings below will "
"affect <strong>all sites</strong> in this network."
msgstr ""
#: includes/settings-page.php:54
msgid "It seems that a caching/performance plugin is active on this site. Please manually invalidate that plugin's cache after making any changes to the settings below."
msgid ""
"It seems that a caching/performance plugin is active on this site. Please "
"manually invalidate that plugin's cache after making any changes to the "
"settings below."
msgstr ""
#: includes/settings-page.php:58 includes/tools-page.php:85
......@@ -74,7 +96,10 @@ msgid "Disable all comment-related controls and settings in WordPress."
msgstr ""
#: includes/settings-page.php:59
msgid "%s: This option is global and will affect your entire site. Use it only if you want to disable comments <em>everywhere</em>. A complete description of what this option does is <a href=\"%s\" target=\"_blank\">available here</a>."
msgid ""
"%s: This option is global and will affect your entire site. Use it only if "
"you want to disable comments <em>everywhere</em>. A complete description of "
"what this option does is <a href=\"%s\" target=\"_blank\">available here</a>."
msgstr ""
#: includes/settings-page.php:59 includes/settings-page.php:80
......@@ -88,7 +113,11 @@ msgid "On certain post types"
msgstr ""
#: includes/settings-page.php:67 includes/tools-page.php:94
msgid "Only the built-in post types appear above. If you want to disable comments on other custom post types on the entire network, you can supply a comma-separated list of post types below (use the slug that identifies the post type)."
msgid ""
"Only the built-in post types appear above. If you want to disable comments "
"on other custom post types on the entire network, you can supply a comma-"
"separated list of post types below (use the slug that identifies the post "
"type)."
msgstr ""
#: includes/settings-page.php:68 includes/tools-page.php:95
......@@ -96,7 +125,10 @@ msgid "Custom post types:"
msgstr ""
#: includes/settings-page.php:70
msgid "Disabling comments will also disable trackbacks and pingbacks. All comment-related fields will also be hidden from the edit/quick-edit screens of the affected posts. These settings cannot be overridden for individual posts."
msgid ""
"Disabling comments will also disable trackbacks and pingbacks. All comment-"
"related fields will also be hidden from the edit/quick-edit screens of the "
"affected posts. These settings cannot be overridden for individual posts."
msgstr ""
#: includes/settings-page.php:75
......@@ -108,11 +140,18 @@ msgid "Use persistent mode"
msgstr ""
#: includes/settings-page.php:80
msgid "%s: <strong>This will make persistent changes to your database &mdash; comments will remain closed even if you later disable the plugin!</strong> You should not use it if you only want to disable comments temporarily. Please <a href=\"%s\" target=\"_blank\">read the FAQ</a> before selecting this option."
msgid ""
"%s: <strong>This will make persistent changes to your database &mdash; "
"comments will remain closed even if you later disable the plugin!</strong> "
"You should not use it if you only want to disable comments temporarily. "
"Please <a href=\"%s\" target=\"_blank\">read the FAQ</a> before selecting "
"this option."
msgstr ""
#: includes/settings-page.php:82
msgid "%s: Entering persistent mode on large multi-site networks requires a large number of database queries and can take a while. Use with caution!"
msgid ""
"%s: Entering persistent mode on large multi-site networks requires a large "
"number of database queries and can take a while. Use with caution!"
msgstr ""
#: includes/settings-page.php:89
......@@ -120,7 +159,9 @@ msgid "Save Changes"
msgstr ""
#: includes/settings-page.php:110
msgid "%s: Selecting this option will make persistent changes to your database. Are you sure you want to enable it?"
msgid ""
"%s: Selecting this option will make persistent changes to your database. Are "
"you sure you want to enable it?"
msgstr ""
#: includes/tools-page.php:13 includes/tools-page.php:75
......@@ -148,7 +189,9 @@ msgid "Delete all comments in WordPress."
msgstr ""
#: includes/tools-page.php:86
msgid "%s: This function and will affect your entire site. Use it only if you want to delete comments <em>everywhere</em>."
msgid ""
"%s: This function and will affect your entire site. Use it only if you want "
"to delete comments <em>everywhere</em>."
msgstr ""
#: includes/tools-page.php:88
......@@ -156,16 +199,29 @@ msgid "For certain post types"
msgstr ""
#: includes/tools-page.php:97
msgid "%s: Deleting comments will remove existing comment entries in the database and cannot be reverted without a database backup."
msgid ""
"%s: Deleting comments will remove existing comment entries in the database "
"and cannot be reverted without a database backup."
msgstr ""
#: includes/tools-page.php:102
msgid "Total Comments:"
msgstr ""
#. Plugin Name of the plugin/theme
msgid "Disable Comments"
#. Plugin URI of the plugin/theme
msgid "https://wordpress.org/plugins/disable-comments/"
msgstr ""
#. Description of the plugin/theme
msgid "Allows administrators to globally disable comments on their site. Comments can be disabled according to post type."
msgid ""
"Allows administrators to globally disable comments on their site. Comments "
"can be disabled according to post type."
msgstr ""
#. Author of the plugin/theme
msgid "Samir Shah"
msgstr ""
#. Author URI of the plugin/theme
msgid "http://www.rayofsolaris.net/"
msgstr ""
......@@ -2,8 +2,8 @@
Contributors: solarissmoke
Donate link: http://www.rayofsolaris.net/donate/
Tags: comments, disable, global
Requires at least: 4.0
Tested up to: 4.7
Requires at least: 4.1
Tested up to: 4.8
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,10 @@ These definitions can be made either in your main `wp-config.php` or in your the
== Changelog ==
= 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.
= 1.6 =
* Added a tool for deleting comments in bulk.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment