Changeset 2984583
- Timestamp:
- 10/26/2023 06:43:09 PM (2 years ago)
- Location:
- turn-comments-off
- Files:
-
- 12 edited
- 1 copied
-
assets/banner-1544x500.jpg (modified) (1 prop) (previous)
-
assets/banner-772x250.jpg (modified) (1 prop) (previous)
-
assets/icon-128x128.jpg (modified) (1 prop) (previous)
-
assets/icon-256x256.jpg (modified) (1 prop) (previous)
-
tags/1.3.0 (copied) (copied from turn-comments-off/trunk)
-
tags/1.3.0/build/index.asset.php (modified) (1 diff)
-
tags/1.3.0/build/index.js (modified) (1 diff)
-
tags/1.3.0/plugin.php (modified) (9 diffs)
-
tags/1.3.0/readme.txt (modified) (3 diffs)
-
trunk/build/index.asset.php (modified) (1 diff)
-
trunk/build/index.js (modified) (1 diff)
-
trunk/plugin.php (modified) (9 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
turn-comments-off/assets/banner-1544x500.jpg
-
Property
svn:mime-type
changed from
application/octet-streamtoimage/jpeg
-
Property
svn:mime-type
changed from
-
turn-comments-off/assets/banner-772x250.jpg
-
Property
svn:mime-type
changed from
application/octet-streamtoimage/jpeg
-
Property
svn:mime-type
changed from
-
turn-comments-off/assets/icon-128x128.jpg
-
Property
svn:mime-type
changed from
application/octet-streamtoimage/jpeg
-
Property
svn:mime-type
changed from
-
turn-comments-off/assets/icon-256x256.jpg
-
Property
svn:mime-type
changed from
application/octet-streamtoimage/jpeg
-
Property
svn:mime-type
changed from
-
turn-comments-off/tags/1.3.0/build/index.asset.php
r2831413 r2984583 1 <?php return array('dependencies' => array('wp-blocks', 'wp-dom-ready'), 'version' => '1 05d3c0577a1f1b9d0cf');1 <?php return array('dependencies' => array('wp-blocks', 'wp-dom-ready'), 'version' => '13623f35a22fbab135b9'); -
turn-comments-off/tags/1.3.0/build/index.js
r2831413 r2984583 1 (()=>{"use strict";var e={n:o=>{var t=o&&o.__esModule?()=>o.default:()=>o;return e.d(t,{a:t}),t},d:(o,t)=>{for(var c in t)e.o(t,c)&&!e.o(o,c)&&Object.defineProperty(o,c,{enumerable:!0,get:t[c]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o)};const o=window.wp.blocks,t=window.wp.domReady;e.n(t)()((()=>{["core/comments","core/comments-query-loop","core/comment-author-avatar","core/comment-author-name","core/comment-content","core/comment-date","core/comment-edit-link","core/comment-reply-link","core/comment-template","core/comments-pagination","core/comments-pagination-next","core/comments-pagination-numbers","core/comments-pagination-previous","core/comments-title","core/latest-comments","core/post-comment","core/post-comments-count","core/post-comments-form","core/post-comments-link"].forEach((e=>{void 0!==(0,o.getBlockType)(e)&&(0,o.unregisterBlockType)(e)}))}))})();1 !function(){"use strict";var o={n:function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,{a:t}),t},d:function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:function(o,e){return Object.prototype.hasOwnProperty.call(o,e)}},e=window.wp.blocks,t=window.wp.domReady;o.n(t)()((()=>{["core/comments","core/comments-query-loop","core/comment-author-avatar","core/comment-author-name","core/comment-content","core/comment-date","core/comment-edit-link","core/comment-reply-link","core/comment-template","core/comments-pagination","core/comments-pagination-next","core/comments-pagination-numbers","core/comments-pagination-previous","core/comments-title","core/latest-comments","core/post-comment","core/post-comments-count","core/post-comments-form","core/post-comments-link"].forEach((o=>{void 0!==(0,e.getBlockType)(o)&&(0,e.unregisterBlockType)(o)}))}))}(); -
turn-comments-off/tags/1.3.0/plugin.php
r2889508 r2984583 3 3 * Plugin Name: Turn Comments Off 4 4 * Description: Turn comments off everywhere in WordPress. 5 * Version: 1. 2.15 * Version: 1.3.0 6 6 * Plugin URI: https://github.com/happyprime/turn-comments-off/ 7 7 * Author: Happy Prime 8 8 * Author URI: https://happyprime.co 9 9 * Text Domain: turn-comments-off 10 * Requires PHP: 5.610 * Requires PHP: 7.4 11 11 * 12 12 * This program is free software; you can redistribute it and/or modify … … 59 59 add_filter( 'wp_count_comments', __NAMESPACE__ . '\filter_wp_count_comments' ); 60 60 add_action( 'add_admin_bar_menus', __NAMESPACE__ . '\remove_admin_bar_comments_menu' ); 61 add_action( 'admin_bar_menu', __NAMESPACE__ . '\remove_my_sites_comments_menu', 21 ); 61 62 add_action( 'admin_menu', __NAMESPACE__ . '\remove_comments_menu_page' ); 62 63 add_action( 'load-options-discussion.php', __NAMESPACE__ . '\block_comments_admin_screen' ); … … 67 68 * it by priority 99 on init. 68 69 */ 69 function remove_comment_support() {70 function remove_comment_support(): void { 70 71 $post_types = get_post_types_by_support( 'comments' ); 71 72 … … 79 80 * it by priority 99 on init. 80 81 */ 81 function remove_trackback_support() {82 function remove_trackback_support(): void { 82 83 $post_types = get_post_types_by_support( 'trackbacks' ); 83 84 … … 93 94 * @since 1.1.0 94 95 */ 95 function unregister_comment_blocks_javascript() {96 function unregister_comment_blocks_javascript(): void { 96 97 $asset_data = include_once __DIR__ . '/build/index.asset.php'; 97 98 … … 112 113 * @since 1.1.0 113 114 */ 114 function unregister_comment_blocks() {115 function unregister_comment_blocks(): void { 115 116 116 117 // Retrieve all registered blocks. … … 154 155 * side menu in the dashboard. 155 156 */ 156 function remove_comments_menu_page() {157 function remove_comments_menu_page(): void { 157 158 remove_menu_page( 'edit-comments.php' ); 158 159 remove_submenu_page( 'options-general.php', 'options-discussion.php' ); … … 162 163 * Remove the comments menu from the admin bar. 163 164 */ 164 function remove_admin_bar_comments_menu() {165 function remove_admin_bar_comments_menu(): void { 165 166 remove_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 60 ); 166 167 } 167 168 168 169 /** 170 * Remove the "Manage Comments" node from each site's menu under My Sites. 171 * 172 * @since 1.3.0 173 */ 174 function remove_my_sites_comments_menu(): void { 175 global $wp_admin_bar; 176 177 // Only parse for the menu if it's going to be there, part 1. 178 if ( ! is_multisite() || ! is_user_logged_in() ) { 179 return; 180 } 181 182 // Only parse for the menu if it's going to be there, part 2. 183 if ( count( $wp_admin_bar->user->blogs ) < 1 ) { 184 return; 185 } 186 187 // The plugin API is not always available on the front-end. 188 if ( ! function_exists( 'is_plugin_active_for_network' ) ) { 189 require_once ABSPATH . '/wp-admin/includes/plugin.php'; 190 } 191 192 // We can't accurately remove the menu item if the plugin is not network activated. 193 if ( ! is_plugin_active_for_network( plugin_basename( __FILE__ ) ) ) { 194 return; 195 } 196 197 foreach ( $wp_admin_bar->user->blogs as $blog ) { 198 $wp_admin_bar->remove_menu( 'blog-' . $blog->userblog_id . '-c' ); 199 } 200 } 201 202 /** 169 203 * Filter wp_count_comments() so that it always returns 0. 170 204 * 171 205 * This hides Recent Comments from the dashboard activity widget. 172 206 * 173 * @return stdClass An object with expected count properties.174 */ 175 function filter_wp_count_comments() {207 * @return \stdClass An object with expected count properties. 208 */ 209 function filter_wp_count_comments(): \stdClass { 176 210 return (object) array( 177 211 'approved' => 0, … … 189 223 * in the admin. 190 224 */ 191 function block_comments_admin_screen() {225 function block_comments_admin_screen(): void { 192 226 wp_die( esc_html__( 'This screen is disabled by the Turn Comments Off plugin.', 'turn-comments-off' ) ); 193 exit; 194 } 227 } -
turn-comments-off/tags/1.3.0/readme.txt
r2889508 r2984583 1 1 # Turn Comments Off 2 Contributors: happyprime, jeremyfelt, slocker, philcable , wpgirl3692 Contributors: happyprime, jeremyfelt, slocker, philcable 3 3 Tags: comments 4 4 Requires at least: 5.9 5 Tested up to: 6. 26 Stable tag: 1. 2.15 Tested up to: 6.4 6 Stable tag: 1.3.0 7 7 License: GPLv2 or later 8 Requires PHP: 5.68 Requires PHP: 7.4 9 9 10 10 Turn comments off everywhere in WordPress. … … 21 21 * Remove the comments feed link. 22 22 * Unregister all core comment blocks in the editor. 23 * Remove "Manage Comments" from My Sites on multisite. (If network activated.) 23 24 24 25 No configuration necessary (or available). … … 27 28 28 29 ## Changelog 30 31 ### 1.3.0 32 33 * Remove "Manage Comments" from site menus under My Sites on multisite. 34 * Confirm WordPress 6.4 support. 35 * Update `wordpress/scripts` dependency to 26.15.0. 36 * Improve linting configuration. 29 37 30 38 ### 1.2.1 -
turn-comments-off/trunk/build/index.asset.php
r2831413 r2984583 1 <?php return array('dependencies' => array('wp-blocks', 'wp-dom-ready'), 'version' => '1 05d3c0577a1f1b9d0cf');1 <?php return array('dependencies' => array('wp-blocks', 'wp-dom-ready'), 'version' => '13623f35a22fbab135b9'); -
turn-comments-off/trunk/build/index.js
r2831413 r2984583 1 (()=>{"use strict";var e={n:o=>{var t=o&&o.__esModule?()=>o.default:()=>o;return e.d(t,{a:t}),t},d:(o,t)=>{for(var c in t)e.o(t,c)&&!e.o(o,c)&&Object.defineProperty(o,c,{enumerable:!0,get:t[c]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o)};const o=window.wp.blocks,t=window.wp.domReady;e.n(t)()((()=>{["core/comments","core/comments-query-loop","core/comment-author-avatar","core/comment-author-name","core/comment-content","core/comment-date","core/comment-edit-link","core/comment-reply-link","core/comment-template","core/comments-pagination","core/comments-pagination-next","core/comments-pagination-numbers","core/comments-pagination-previous","core/comments-title","core/latest-comments","core/post-comment","core/post-comments-count","core/post-comments-form","core/post-comments-link"].forEach((e=>{void 0!==(0,o.getBlockType)(e)&&(0,o.unregisterBlockType)(e)}))}))})();1 !function(){"use strict";var o={n:function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,{a:t}),t},d:function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:function(o,e){return Object.prototype.hasOwnProperty.call(o,e)}},e=window.wp.blocks,t=window.wp.domReady;o.n(t)()((()=>{["core/comments","core/comments-query-loop","core/comment-author-avatar","core/comment-author-name","core/comment-content","core/comment-date","core/comment-edit-link","core/comment-reply-link","core/comment-template","core/comments-pagination","core/comments-pagination-next","core/comments-pagination-numbers","core/comments-pagination-previous","core/comments-title","core/latest-comments","core/post-comment","core/post-comments-count","core/post-comments-form","core/post-comments-link"].forEach((o=>{void 0!==(0,e.getBlockType)(o)&&(0,e.unregisterBlockType)(o)}))}))}(); -
turn-comments-off/trunk/plugin.php
r2889508 r2984583 3 3 * Plugin Name: Turn Comments Off 4 4 * Description: Turn comments off everywhere in WordPress. 5 * Version: 1. 2.15 * Version: 1.3.0 6 6 * Plugin URI: https://github.com/happyprime/turn-comments-off/ 7 7 * Author: Happy Prime 8 8 * Author URI: https://happyprime.co 9 9 * Text Domain: turn-comments-off 10 * Requires PHP: 5.610 * Requires PHP: 7.4 11 11 * 12 12 * This program is free software; you can redistribute it and/or modify … … 59 59 add_filter( 'wp_count_comments', __NAMESPACE__ . '\filter_wp_count_comments' ); 60 60 add_action( 'add_admin_bar_menus', __NAMESPACE__ . '\remove_admin_bar_comments_menu' ); 61 add_action( 'admin_bar_menu', __NAMESPACE__ . '\remove_my_sites_comments_menu', 21 ); 61 62 add_action( 'admin_menu', __NAMESPACE__ . '\remove_comments_menu_page' ); 62 63 add_action( 'load-options-discussion.php', __NAMESPACE__ . '\block_comments_admin_screen' ); … … 67 68 * it by priority 99 on init. 68 69 */ 69 function remove_comment_support() {70 function remove_comment_support(): void { 70 71 $post_types = get_post_types_by_support( 'comments' ); 71 72 … … 79 80 * it by priority 99 on init. 80 81 */ 81 function remove_trackback_support() {82 function remove_trackback_support(): void { 82 83 $post_types = get_post_types_by_support( 'trackbacks' ); 83 84 … … 93 94 * @since 1.1.0 94 95 */ 95 function unregister_comment_blocks_javascript() {96 function unregister_comment_blocks_javascript(): void { 96 97 $asset_data = include_once __DIR__ . '/build/index.asset.php'; 97 98 … … 112 113 * @since 1.1.0 113 114 */ 114 function unregister_comment_blocks() {115 function unregister_comment_blocks(): void { 115 116 116 117 // Retrieve all registered blocks. … … 154 155 * side menu in the dashboard. 155 156 */ 156 function remove_comments_menu_page() {157 function remove_comments_menu_page(): void { 157 158 remove_menu_page( 'edit-comments.php' ); 158 159 remove_submenu_page( 'options-general.php', 'options-discussion.php' ); … … 162 163 * Remove the comments menu from the admin bar. 163 164 */ 164 function remove_admin_bar_comments_menu() {165 function remove_admin_bar_comments_menu(): void { 165 166 remove_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 60 ); 166 167 } 167 168 168 169 /** 170 * Remove the "Manage Comments" node from each site's menu under My Sites. 171 * 172 * @since 1.3.0 173 */ 174 function remove_my_sites_comments_menu(): void { 175 global $wp_admin_bar; 176 177 // Only parse for the menu if it's going to be there, part 1. 178 if ( ! is_multisite() || ! is_user_logged_in() ) { 179 return; 180 } 181 182 // Only parse for the menu if it's going to be there, part 2. 183 if ( count( $wp_admin_bar->user->blogs ) < 1 ) { 184 return; 185 } 186 187 // The plugin API is not always available on the front-end. 188 if ( ! function_exists( 'is_plugin_active_for_network' ) ) { 189 require_once ABSPATH . '/wp-admin/includes/plugin.php'; 190 } 191 192 // We can't accurately remove the menu item if the plugin is not network activated. 193 if ( ! is_plugin_active_for_network( plugin_basename( __FILE__ ) ) ) { 194 return; 195 } 196 197 foreach ( $wp_admin_bar->user->blogs as $blog ) { 198 $wp_admin_bar->remove_menu( 'blog-' . $blog->userblog_id . '-c' ); 199 } 200 } 201 202 /** 169 203 * Filter wp_count_comments() so that it always returns 0. 170 204 * 171 205 * This hides Recent Comments from the dashboard activity widget. 172 206 * 173 * @return stdClass An object with expected count properties.174 */ 175 function filter_wp_count_comments() {207 * @return \stdClass An object with expected count properties. 208 */ 209 function filter_wp_count_comments(): \stdClass { 176 210 return (object) array( 177 211 'approved' => 0, … … 189 223 * in the admin. 190 224 */ 191 function block_comments_admin_screen() {225 function block_comments_admin_screen(): void { 192 226 wp_die( esc_html__( 'This screen is disabled by the Turn Comments Off plugin.', 'turn-comments-off' ) ); 193 exit; 194 } 227 } -
turn-comments-off/trunk/readme.txt
r2889508 r2984583 1 1 # Turn Comments Off 2 Contributors: happyprime, jeremyfelt, slocker, philcable , wpgirl3692 Contributors: happyprime, jeremyfelt, slocker, philcable 3 3 Tags: comments 4 4 Requires at least: 5.9 5 Tested up to: 6. 26 Stable tag: 1. 2.15 Tested up to: 6.4 6 Stable tag: 1.3.0 7 7 License: GPLv2 or later 8 Requires PHP: 5.68 Requires PHP: 7.4 9 9 10 10 Turn comments off everywhere in WordPress. … … 21 21 * Remove the comments feed link. 22 22 * Unregister all core comment blocks in the editor. 23 * Remove "Manage Comments" from My Sites on multisite. (If network activated.) 23 24 24 25 No configuration necessary (or available). … … 27 28 28 29 ## Changelog 30 31 ### 1.3.0 32 33 * Remove "Manage Comments" from site menus under My Sites on multisite. 34 * Confirm WordPress 6.4 support. 35 * Update `wordpress/scripts` dependency to 26.15.0. 36 * Improve linting configuration. 29 37 30 38 ### 1.2.1
Note: See TracChangeset
for help on using the changeset viewer.