1 | <?php |
---|
2 | |
---|
3 | /* |
---|
4 | * Plugin Name: Turn Off Comments |
---|
5 | * Plugin URI: https://wordpress.org/plugins/turn-off-comments/ |
---|
6 | * Description: Turn Off Comments from your WordPress Website. |
---|
7 | * Version: 1.6.6 |
---|
8 | * Tested Up to: 6.5 |
---|
9 | * Requires at least: 4.4 |
---|
10 | * Requires PHP: 7.0 |
---|
11 | * Author: Mehraz Morshed |
---|
12 | * Author URI: https://profiles.wordpress.org/mehrazmorshed/ |
---|
13 | * License: GPL v2 or later |
---|
14 | * License URI: https://www.gnu.org/licenses/gpl-2.0.html |
---|
15 | * Text Domain: turn-off-comments |
---|
16 | * Domain Path: /languages |
---|
17 | */ |
---|
18 | |
---|
19 | /** |
---|
20 | * Turn Off Comments is free software: you can redistribute it and/or modify |
---|
21 | * it under the terms of the GNU General Public License as published by |
---|
22 | * the Free Software Foundation, either version 3 of the License, or |
---|
23 | * (at your option) any later version. |
---|
24 | * |
---|
25 | * Turn Off Comments is distributed in the hope that it will be useful, |
---|
26 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
27 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
28 | * GNU General Public License for more details. |
---|
29 | |
---|
30 | * You should have received a copy of the GNU General Public License |
---|
31 | * along with this program. If not, see <https://www.gnu.org/licenses/>. |
---|
32 | */ |
---|
33 | |
---|
34 | defined( 'ABSPATH' ) or die( 'Access denied.' ); |
---|
35 | |
---|
36 | require_once plugin_dir_path( __FILE__ ) . 'functions.php'; |
---|
37 | |
---|
38 | add_action( 'init', 'turn_off_comments_load_textdomain' ); |
---|
39 | |
---|
40 | add_action( 'pre_comment_on_post', 'turn_off_comments_no_wp_comments' ); |
---|
41 | |
---|
42 | add_action( 'admin_menu', 'turn_off_comments_admin_menu' ); |
---|
43 | |
---|
44 | add_action( 'admin_init', 'turn_off_comments_dashboard' ); |
---|
45 | |
---|
46 | add_filter( 'comments_open', 'turn_off_comments_status', 20, 2 ); |
---|
47 | |
---|
48 | add_filter( 'pings_open', 'turn_off_comments_status', 20, 2 ); |
---|
49 | |
---|
50 | add_filter( 'comments_array', 'turn_off_comments_hide_existing_comments', 10, 2 ); |
---|
51 | |
---|
52 | add_action('wp_before_admin_bar_render', 'turn_off_comments_admin_bar_render'); |
---|
53 | |
---|
54 | add_action('admin_init', 'turn_off_comments_admin_menu_redirect'); |
---|
55 | |
---|
56 | add_action( 'admin_init', 'turn_off_comments_post_types_support' ); |
---|
57 | |
---|
58 | add_action( 'wp_head', 'disable_comment_theme_support' ); |
---|
59 | |
---|
60 | register_activation_hook( __FILE__, 'turn_off_comments_activation_hook' ); |
---|
61 | |
---|
62 | add_action( 'admin_notices', 'turn_off_comments_activation_notification' ); |
---|
63 | |
---|