Changeset 2831413
- Timestamp:
- 12/10/2022 12:55:51 AM (3 years ago)
- Location:
- turn-comments-off
- Files:
-
- 44 added
- 26 deleted
- 24 edited
- 1 copied
-
tags/1.2.0 (copied) (copied from turn-comments-off/trunk)
-
tags/1.2.0/.git/FETCH_HEAD (modified) (1 diff)
-
tags/1.2.0/.git/HEAD (modified) (1 diff)
-
tags/1.2.0/.git/config (modified) (1 diff)
-
tags/1.2.0/.git/hooks/fsmonitor-watchman.sample (modified) (1 diff)
-
tags/1.2.0/.git/index (modified) (previous)
-
tags/1.2.0/.git/logs/HEAD (modified) (1 diff)
-
tags/1.2.0/.git/objects/07 (deleted)
-
tags/1.2.0/.git/objects/12 (added)
-
tags/1.2.0/.git/objects/12/50cd7cce5d4c01fff95924f11e3062cf9fff45 (added)
-
tags/1.2.0/.git/objects/18 (added)
-
tags/1.2.0/.git/objects/18/44ee33aa53e1cc389e674b2e9e21a073f82bcd (added)
-
tags/1.2.0/.git/objects/18/c51f859a464f5e235186da7ebcea8402329b43 (added)
-
tags/1.2.0/.git/objects/26 (deleted)
-
tags/1.2.0/.git/objects/36 (deleted)
-
tags/1.2.0/.git/objects/41 (deleted)
-
tags/1.2.0/.git/objects/48 (deleted)
-
tags/1.2.0/.git/objects/55 (deleted)
-
tags/1.2.0/.git/objects/58 (deleted)
-
tags/1.2.0/.git/objects/67 (added)
-
tags/1.2.0/.git/objects/67/589f23f7070fe266a9f59f6ef6cc4429ca4eb1 (added)
-
tags/1.2.0/.git/objects/67/612b0d7d5e37db71f0c67c0fd83b52785651b8 (added)
-
tags/1.2.0/.git/objects/6d/af8e6cf6b13549e868fb1d363d386dd94d4826 (added)
-
tags/1.2.0/.git/objects/77 (deleted)
-
tags/1.2.0/.git/objects/7a (added)
-
tags/1.2.0/.git/objects/7a/ff1a44750d71241ba634f07f53ae3c229e6f82 (added)
-
tags/1.2.0/.git/objects/7b (deleted)
-
tags/1.2.0/.git/objects/87 (added)
-
tags/1.2.0/.git/objects/87/a5f6a4abd3c3b90c6f0975d731d138302e9178 (added)
-
tags/1.2.0/.git/objects/a8 (deleted)
-
tags/1.2.0/.git/objects/c8 (deleted)
-
tags/1.2.0/.git/objects/db (added)
-
tags/1.2.0/.git/objects/db/9bab69802924806ae0024ed47e42cbf9e2d8df (added)
-
tags/1.2.0/.git/objects/e0 (added)
-
tags/1.2.0/.git/objects/e0/5649cb4cf08be4f3d10a5487e1268d8541203b (added)
-
tags/1.2.0/.git/objects/e2 (deleted)
-
tags/1.2.0/.git/objects/ef (added)
-
tags/1.2.0/.git/objects/ef/9e328ddde294db6369d2a0095017867bfdf0b5 (added)
-
tags/1.2.0/.git/objects/ff (added)
-
tags/1.2.0/.git/objects/ff/4502b917ec4fa233c804f29b70a81cc4b05a76 (added)
-
tags/1.2.0/.git/refs/tags/1.1.1 (deleted)
-
tags/1.2.0/.git/refs/tags/1.2.0 (added)
-
tags/1.2.0/.git/shallow (modified) (1 diff)
-
tags/1.2.0/build/index.asset.php (modified) (1 diff)
-
tags/1.2.0/build/index.js (modified) (1 diff)
-
tags/1.2.0/plugin.php (modified) (3 diffs)
-
tags/1.2.0/readme.txt (modified) (2 diffs)
-
tags/1.2.0/src/index.js (modified) (1 diff)
-
trunk/.git/FETCH_HEAD (modified) (1 diff)
-
trunk/.git/HEAD (modified) (1 diff)
-
trunk/.git/config (modified) (1 diff)
-
trunk/.git/hooks/fsmonitor-watchman.sample (modified) (1 diff)
-
trunk/.git/index (modified) (previous)
-
trunk/.git/logs/HEAD (modified) (1 diff)
-
trunk/.git/objects/07 (deleted)
-
trunk/.git/objects/12 (added)
-
trunk/.git/objects/12/50cd7cce5d4c01fff95924f11e3062cf9fff45 (added)
-
trunk/.git/objects/18 (added)
-
trunk/.git/objects/18/44ee33aa53e1cc389e674b2e9e21a073f82bcd (added)
-
trunk/.git/objects/18/c51f859a464f5e235186da7ebcea8402329b43 (added)
-
trunk/.git/objects/26 (deleted)
-
trunk/.git/objects/36 (deleted)
-
trunk/.git/objects/41 (deleted)
-
trunk/.git/objects/48 (deleted)
-
trunk/.git/objects/55 (deleted)
-
trunk/.git/objects/58 (deleted)
-
trunk/.git/objects/67 (added)
-
trunk/.git/objects/67/589f23f7070fe266a9f59f6ef6cc4429ca4eb1 (added)
-
trunk/.git/objects/67/612b0d7d5e37db71f0c67c0fd83b52785651b8 (added)
-
trunk/.git/objects/6d/af8e6cf6b13549e868fb1d363d386dd94d4826 (added)
-
trunk/.git/objects/77 (deleted)
-
trunk/.git/objects/7a (added)
-
trunk/.git/objects/7a/ff1a44750d71241ba634f07f53ae3c229e6f82 (added)
-
trunk/.git/objects/7b (deleted)
-
trunk/.git/objects/87 (added)
-
trunk/.git/objects/87/a5f6a4abd3c3b90c6f0975d731d138302e9178 (added)
-
trunk/.git/objects/a8 (deleted)
-
trunk/.git/objects/c8 (deleted)
-
trunk/.git/objects/db (added)
-
trunk/.git/objects/db/9bab69802924806ae0024ed47e42cbf9e2d8df (added)
-
trunk/.git/objects/e0 (added)
-
trunk/.git/objects/e0/5649cb4cf08be4f3d10a5487e1268d8541203b (added)
-
trunk/.git/objects/e2 (deleted)
-
trunk/.git/objects/ef (added)
-
trunk/.git/objects/ef/9e328ddde294db6369d2a0095017867bfdf0b5 (added)
-
trunk/.git/objects/ff (added)
-
trunk/.git/objects/ff/4502b917ec4fa233c804f29b70a81cc4b05a76 (added)
-
trunk/.git/refs/tags/1.1.1 (deleted)
-
trunk/.git/refs/tags/1.2.0 (added)
-
trunk/.git/shallow (modified) (1 diff)
-
trunk/build/index.asset.php (modified) (1 diff)
-
trunk/build/index.js (modified) (1 diff)
-
trunk/plugin.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/index.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
turn-comments-off/tags/1.2.0/.git/FETCH_HEAD
r2747176 r2831413 1 41387465da40b079f85565778bd37fb005d91672 '41387465da40b079f85565778bd37fb005d91672' of https://github.com/happyprime/turn-comments-off1 7aff1a44750d71241ba634f07f53ae3c229e6f82 '7aff1a44750d71241ba634f07f53ae3c229e6f82' of https://github.com/happyprime/turn-comments-off -
turn-comments-off/tags/1.2.0/.git/HEAD
r2747176 r2831413 1 41387465da40b079f85565778bd37fb005d916721 7aff1a44750d71241ba634f07f53ae3c229e6f82 -
turn-comments-off/tags/1.2.0/.git/config
r2747176 r2831413 10 10 auto = 0 11 11 [http "https://github.com/"] 12 extraheader = AUTHORIZATION: basic eC1hY2Nlc3MtdG9rZW46Z2hzX 2hDZXpQOFdHajdvWUZrd3RtenY3NmgyeHVCQkJXQTRKR3BNVA==12 extraheader = AUTHORIZATION: basic eC1hY2Nlc3MtdG9rZW46Z2hzX1ZobGVzOFloMjM2MGlxSmJMOWl2RmpZaFU3T1ByajRKRkx1MQ== -
turn-comments-off/tags/1.2.0/.git/hooks/fsmonitor-watchman.sample
r2706000 r2831413 87 87 # output to file names only. Then we're using the "expression" term to 88 88 # further constrain the results. 89 my $last_update_line = ""; 89 90 if (substr($last_update_token, 0, 1) eq "c") { 90 91 $last_update_token = "\"$last_update_token\""; 92 $last_update_line = qq[\n"since": $last_update_token,]; 91 93 } 92 94 my $query = <<" END"; 93 ["query", "$git_work_tree", { 94 "since": $last_update_token, 95 ["query", "$git_work_tree", {$last_update_line 95 96 "fields": ["name"], 96 97 "expression": ["not", ["dirname", ".git"]] -
turn-comments-off/tags/1.2.0/.git/logs/HEAD
r2747176 r2831413 1 0000000000000000000000000000000000000000 41387465da40b079f85565778bd37fb005d91672 runner <runner@fv-az39-923.k1oyn45vu3de5gjdjdp3nrnp3b.cx.internal.cloudapp.net> 1656000008 +0000 checkout: moving from master to refs/tags/1.1.11 0000000000000000000000000000000000000000 7aff1a44750d71241ba634f07f53ae3c229e6f82 runner <runner@fv-az203-956.ruvxqjmswdaexpdv5kjf3tcyhb.jx.internal.cloudapp.net> 1670633716 +0000 checkout: moving from master to refs/tags/1.2.0 -
turn-comments-off/tags/1.2.0/.git/shallow
r2747176 r2831413 1 41387465da40b079f85565778bd37fb005d916721 7aff1a44750d71241ba634f07f53ae3c229e6f82 -
turn-comments-off/tags/1.2.0/build/index.asset.php
r2747164 r2831413 1 <?php return array('dependencies' => array('wp-blocks', 'wp-dom-ready'), 'version' => ' 2856a872f0fe58be7167');1 <?php return array('dependencies' => array('wp-blocks', 'wp-dom-ready'), 'version' => '105d3c0577a1f1b9d0cf'); -
turn-comments-off/tags/1.2.0/build/index.js
r2747164 r2831413 1 (()=>{"use strict";var e={n:o=>{var r=o&&o.__esModule?()=>o.default:()=>o;return e.d(r,{a:r}),r},d:(o,r)=>{for(var t in r)e.o(r,t)&&!e.o(o,t)&&Object.defineProperty(o,t,{enumerable:!0,get:r[t]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o)};const o=window.wp.blocks,r=window.wp.domReady;e.n(r)()((()=>{(0,o.unregisterBlockType)("core/latest-comments"),(0,o.unregisterBlockType)("core/comments-query-loop"),(0,o.unregisterBlockType)("core/post-comments-form"),(0,o.unregisterBlockType)("core/comment-author-name"),(0,o.unregisterBlockType)("core/comment-content"),(0,o.unregisterBlockType)("core/comment-date"),(0,o.unregisterBlockType)("core/comment-edit-link"),(0,o.unregisterBlockType)("core/comment-reply-link"),(0,o.unregisterBlockType)("core/comment-template"),(0,o.unregisterBlockType)("core/comments-pagination"),(0,o.unregisterBlockType)("core/comments-pagination-next"),(0,o.unregisterBlockType)("core/comments-pagination-numbers"),(0,o.unregisterBlockType)("core/comments-pagination-previous"),(0,o.unregisterBlockType)("core/comments-title"),(0,o.unregisterBlockType)("core/post-comments-count"),(0,o.unregisterBlockType)("core/post-comments-link")}))})();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)}))}))})(); -
turn-comments-off/tags/1.2.0/plugin.php
r2747176 r2831413 3 3 * Plugin Name: Turn Comments Off 4 4 * Description: Turn comments off everywhere in WordPress. 5 * Version: 1. 1.15 * Version: 1.2.0 6 6 * Plugin URI: https://github.com/happyprime/turn-comments-off/ 7 7 * Author: Happy Prime … … 111 111 */ 112 112 function unregister_comment_blocks() { 113 unregister_block_type( 'core/comment-author-name' ); 114 unregister_block_type( 'core/comment-content' ); 115 unregister_block_type( 'core/comment-date' ); 116 unregister_block_type( 'core/comment-edit-link' ); 117 unregister_block_type( 'core/comment-reply-link' ); 118 unregister_block_type( 'core/comment-template' ); 119 unregister_block_type( 'core/comments-pagination' ); 120 unregister_block_type( 'core/comments-pagination-next' ); 121 unregister_block_type( 'core/comments-pagination-numbers' ); 122 unregister_block_type( 'core/comments-pagination-previous' ); 123 unregister_block_type( 'core/comments-query-loop' ); 124 unregister_block_type( 'core/comments-title' ); 125 unregister_block_type( 'core/latest-comments' ); 126 unregister_block_type( 'core/post-comments-form' ); 127 unregister_block_type( 'core/post-comments-count' ); // Gutenberg only. 128 unregister_block_type( 'core/post-comments-link' ); // Gutenberg only. 113 114 // Retrieve all registered blocks. 115 $registered_blocks = \WP_Block_Type_Registry::get_instance()->get_all_registered(); 116 117 $blocks = [ 118 'core/comments', 119 'core/comments-query-loop', // Replaced by core/comments in Gutenberg 13.7. 120 121 'core/comment-author-avatar', 122 'core/comment-author-name', 123 'core/comment-content', 124 'core/comment-date', 125 'core/comment-edit-link', 126 'core/comment-reply-link', 127 'core/comment-template', 128 129 'core/comments-pagination', 130 'core/comments-pagination-next', 131 'core/comments-pagination-numbers', 132 'core/comments-pagination-previous', 133 'core/comments-title', 134 135 'core/latest-comments', 136 137 'core/post-comment', 138 'core/post-comments-count', 139 'core/post-comments-form', 140 'core/post-comments-link', 141 ]; 142 143 foreach ( $blocks as $block ) { 144 if ( isset( $registered_blocks[ $block ] ) ) { 145 unregister_block_type( $block ); 146 } 147 } 129 148 } 130 149 … … 134 153 */ 135 154 function remove_comments_menu_page() { 136 remove_menu_page( 'edit-comments.php');155 remove_menu_page( 'edit-comments.php' ); 137 156 remove_submenu_page( 'options-general.php', 'options-discussion.php' ); 138 157 } -
turn-comments-off/tags/1.2.0/readme.txt
r2747176 r2831413 3 3 Tags: comments 4 4 Requires at least: 5.9 5 Tested up to: 6. 06 Stable tag: 1. 1.15 Tested up to: 6.1 6 Stable tag: 1.2.0 7 7 License: GPLv2 or later 8 8 Requires PHP: 5.6 … … 28 28 ## Changelog 29 29 30 ### 1.2.0 31 32 * Update the list of blocks unregistered to include latest from Gutenberg and WordPress. 33 * Update `wordpress/scripts` to 24.6.0. 34 * Refactor how the list of blocks is managed to make future maintenance easier. Props [@huubl](https://profiles.wordpress.org/huubl/). 35 * Only unregister blocks that are registered. Props [@huubl](https://profiles.wordpress.org/huubl/). 36 30 37 ### 1.1.1 31 38 -
turn-comments-off/tags/1.2.0/src/index.js
r2747164 r2831413 1 import { unregisterBlockType } from '@wordpress/blocks';1 import { getBlockType, unregisterBlockType } from '@wordpress/blocks'; 2 2 import domReady from '@wordpress/dom-ready'; 3 3 4 4 // Unregister comment-related blocks provided by WordPress core. 5 domReady(() => { 6 // Blocks that will usually show as available on posts and pages. 7 unregisterBlockType('core/latest-comments'); 8 unregisterBlockType('core/comments-query-loop'); 9 unregisterBlockType('core/post-comments-form'); 5 domReady( () => { 6 const blocks = [ 7 'core/comments', 8 'core/comments-query-loop', // Replaced by core/comments in Gutenberg 13.7. 10 9 11 // Blocks used inside the comments query loop block. 12 unregisterBlockType('core/comment-author-name'); 13 unregisterBlockType('core/comment-content'); 14 unregisterBlockType('core/comment-date'); 15 unregisterBlockType('core/comment-edit-link'); 16 unregisterBlockType('core/comment-reply-link'); 17 unregisterBlockType('core/comment-template'); 18 unregisterBlockType('core/comments-pagination'); 19 unregisterBlockType('core/comments-pagination-next'); 20 unregisterBlockType('core/comments-pagination-numbers'); 21 unregisterBlockType('core/comments-pagination-previous'); 22 unregisterBlockType('core/comments-title'); 23 unregisterBlockType('core/post-comments-count'); 24 unregisterBlockType('core/post-comments-link'); 25 }); 10 'core/comment-author-avatar', 11 'core/comment-author-name', 12 'core/comment-content', 13 'core/comment-date', 14 'core/comment-edit-link', 15 'core/comment-reply-link', 16 'core/comment-template', 17 18 'core/comments-pagination', 19 'core/comments-pagination-next', 20 'core/comments-pagination-numbers', 21 'core/comments-pagination-previous', 22 'core/comments-title', 23 24 'core/latest-comments', 25 26 'core/post-comment', 27 'core/post-comments-count', 28 'core/post-comments-form', 29 'core/post-comments-link', 30 ]; 31 32 blocks.forEach( ( block ) => { 33 if ( undefined !== getBlockType( block ) ) { 34 unregisterBlockType( block ); 35 } 36 } ); 37 } ); -
turn-comments-off/trunk/.git/FETCH_HEAD
r2747176 r2831413 1 41387465da40b079f85565778bd37fb005d91672 '41387465da40b079f85565778bd37fb005d91672' of https://github.com/happyprime/turn-comments-off1 7aff1a44750d71241ba634f07f53ae3c229e6f82 '7aff1a44750d71241ba634f07f53ae3c229e6f82' of https://github.com/happyprime/turn-comments-off -
turn-comments-off/trunk/.git/HEAD
r2747176 r2831413 1 41387465da40b079f85565778bd37fb005d916721 7aff1a44750d71241ba634f07f53ae3c229e6f82 -
turn-comments-off/trunk/.git/config
r2747176 r2831413 10 10 auto = 0 11 11 [http "https://github.com/"] 12 extraheader = AUTHORIZATION: basic eC1hY2Nlc3MtdG9rZW46Z2hzX 2hDZXpQOFdHajdvWUZrd3RtenY3NmgyeHVCQkJXQTRKR3BNVA==12 extraheader = AUTHORIZATION: basic eC1hY2Nlc3MtdG9rZW46Z2hzX1ZobGVzOFloMjM2MGlxSmJMOWl2RmpZaFU3T1ByajRKRkx1MQ== -
turn-comments-off/trunk/.git/hooks/fsmonitor-watchman.sample
r2706000 r2831413 87 87 # output to file names only. Then we're using the "expression" term to 88 88 # further constrain the results. 89 my $last_update_line = ""; 89 90 if (substr($last_update_token, 0, 1) eq "c") { 90 91 $last_update_token = "\"$last_update_token\""; 92 $last_update_line = qq[\n"since": $last_update_token,]; 91 93 } 92 94 my $query = <<" END"; 93 ["query", "$git_work_tree", { 94 "since": $last_update_token, 95 ["query", "$git_work_tree", {$last_update_line 95 96 "fields": ["name"], 96 97 "expression": ["not", ["dirname", ".git"]] -
turn-comments-off/trunk/.git/logs/HEAD
r2747176 r2831413 1 0000000000000000000000000000000000000000 41387465da40b079f85565778bd37fb005d91672 runner <runner@fv-az39-923.k1oyn45vu3de5gjdjdp3nrnp3b.cx.internal.cloudapp.net> 1656000008 +0000 checkout: moving from master to refs/tags/1.1.11 0000000000000000000000000000000000000000 7aff1a44750d71241ba634f07f53ae3c229e6f82 runner <runner@fv-az203-956.ruvxqjmswdaexpdv5kjf3tcyhb.jx.internal.cloudapp.net> 1670633716 +0000 checkout: moving from master to refs/tags/1.2.0 -
turn-comments-off/trunk/.git/shallow
r2747176 r2831413 1 41387465da40b079f85565778bd37fb005d916721 7aff1a44750d71241ba634f07f53ae3c229e6f82 -
turn-comments-off/trunk/build/index.asset.php
r2747164 r2831413 1 <?php return array('dependencies' => array('wp-blocks', 'wp-dom-ready'), 'version' => ' 2856a872f0fe58be7167');1 <?php return array('dependencies' => array('wp-blocks', 'wp-dom-ready'), 'version' => '105d3c0577a1f1b9d0cf'); -
turn-comments-off/trunk/build/index.js
r2747164 r2831413 1 (()=>{"use strict";var e={n:o=>{var r=o&&o.__esModule?()=>o.default:()=>o;return e.d(r,{a:r}),r},d:(o,r)=>{for(var t in r)e.o(r,t)&&!e.o(o,t)&&Object.defineProperty(o,t,{enumerable:!0,get:r[t]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o)};const o=window.wp.blocks,r=window.wp.domReady;e.n(r)()((()=>{(0,o.unregisterBlockType)("core/latest-comments"),(0,o.unregisterBlockType)("core/comments-query-loop"),(0,o.unregisterBlockType)("core/post-comments-form"),(0,o.unregisterBlockType)("core/comment-author-name"),(0,o.unregisterBlockType)("core/comment-content"),(0,o.unregisterBlockType)("core/comment-date"),(0,o.unregisterBlockType)("core/comment-edit-link"),(0,o.unregisterBlockType)("core/comment-reply-link"),(0,o.unregisterBlockType)("core/comment-template"),(0,o.unregisterBlockType)("core/comments-pagination"),(0,o.unregisterBlockType)("core/comments-pagination-next"),(0,o.unregisterBlockType)("core/comments-pagination-numbers"),(0,o.unregisterBlockType)("core/comments-pagination-previous"),(0,o.unregisterBlockType)("core/comments-title"),(0,o.unregisterBlockType)("core/post-comments-count"),(0,o.unregisterBlockType)("core/post-comments-link")}))})();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)}))}))})(); -
turn-comments-off/trunk/plugin.php
r2747176 r2831413 3 3 * Plugin Name: Turn Comments Off 4 4 * Description: Turn comments off everywhere in WordPress. 5 * Version: 1. 1.15 * Version: 1.2.0 6 6 * Plugin URI: https://github.com/happyprime/turn-comments-off/ 7 7 * Author: Happy Prime … … 111 111 */ 112 112 function unregister_comment_blocks() { 113 unregister_block_type( 'core/comment-author-name' ); 114 unregister_block_type( 'core/comment-content' ); 115 unregister_block_type( 'core/comment-date' ); 116 unregister_block_type( 'core/comment-edit-link' ); 117 unregister_block_type( 'core/comment-reply-link' ); 118 unregister_block_type( 'core/comment-template' ); 119 unregister_block_type( 'core/comments-pagination' ); 120 unregister_block_type( 'core/comments-pagination-next' ); 121 unregister_block_type( 'core/comments-pagination-numbers' ); 122 unregister_block_type( 'core/comments-pagination-previous' ); 123 unregister_block_type( 'core/comments-query-loop' ); 124 unregister_block_type( 'core/comments-title' ); 125 unregister_block_type( 'core/latest-comments' ); 126 unregister_block_type( 'core/post-comments-form' ); 127 unregister_block_type( 'core/post-comments-count' ); // Gutenberg only. 128 unregister_block_type( 'core/post-comments-link' ); // Gutenberg only. 113 114 // Retrieve all registered blocks. 115 $registered_blocks = \WP_Block_Type_Registry::get_instance()->get_all_registered(); 116 117 $blocks = [ 118 'core/comments', 119 'core/comments-query-loop', // Replaced by core/comments in Gutenberg 13.7. 120 121 'core/comment-author-avatar', 122 'core/comment-author-name', 123 'core/comment-content', 124 'core/comment-date', 125 'core/comment-edit-link', 126 'core/comment-reply-link', 127 'core/comment-template', 128 129 'core/comments-pagination', 130 'core/comments-pagination-next', 131 'core/comments-pagination-numbers', 132 'core/comments-pagination-previous', 133 'core/comments-title', 134 135 'core/latest-comments', 136 137 'core/post-comment', 138 'core/post-comments-count', 139 'core/post-comments-form', 140 'core/post-comments-link', 141 ]; 142 143 foreach ( $blocks as $block ) { 144 if ( isset( $registered_blocks[ $block ] ) ) { 145 unregister_block_type( $block ); 146 } 147 } 129 148 } 130 149 … … 134 153 */ 135 154 function remove_comments_menu_page() { 136 remove_menu_page( 'edit-comments.php');155 remove_menu_page( 'edit-comments.php' ); 137 156 remove_submenu_page( 'options-general.php', 'options-discussion.php' ); 138 157 } -
turn-comments-off/trunk/readme.txt
r2747176 r2831413 3 3 Tags: comments 4 4 Requires at least: 5.9 5 Tested up to: 6. 06 Stable tag: 1. 1.15 Tested up to: 6.1 6 Stable tag: 1.2.0 7 7 License: GPLv2 or later 8 8 Requires PHP: 5.6 … … 28 28 ## Changelog 29 29 30 ### 1.2.0 31 32 * Update the list of blocks unregistered to include latest from Gutenberg and WordPress. 33 * Update `wordpress/scripts` to 24.6.0. 34 * Refactor how the list of blocks is managed to make future maintenance easier. Props [@huubl](https://profiles.wordpress.org/huubl/). 35 * Only unregister blocks that are registered. Props [@huubl](https://profiles.wordpress.org/huubl/). 36 30 37 ### 1.1.1 31 38 -
turn-comments-off/trunk/src/index.js
r2747164 r2831413 1 import { unregisterBlockType } from '@wordpress/blocks';1 import { getBlockType, unregisterBlockType } from '@wordpress/blocks'; 2 2 import domReady from '@wordpress/dom-ready'; 3 3 4 4 // Unregister comment-related blocks provided by WordPress core. 5 domReady(() => { 6 // Blocks that will usually show as available on posts and pages. 7 unregisterBlockType('core/latest-comments'); 8 unregisterBlockType('core/comments-query-loop'); 9 unregisterBlockType('core/post-comments-form'); 5 domReady( () => { 6 const blocks = [ 7 'core/comments', 8 'core/comments-query-loop', // Replaced by core/comments in Gutenberg 13.7. 10 9 11 // Blocks used inside the comments query loop block. 12 unregisterBlockType('core/comment-author-name'); 13 unregisterBlockType('core/comment-content'); 14 unregisterBlockType('core/comment-date'); 15 unregisterBlockType('core/comment-edit-link'); 16 unregisterBlockType('core/comment-reply-link'); 17 unregisterBlockType('core/comment-template'); 18 unregisterBlockType('core/comments-pagination'); 19 unregisterBlockType('core/comments-pagination-next'); 20 unregisterBlockType('core/comments-pagination-numbers'); 21 unregisterBlockType('core/comments-pagination-previous'); 22 unregisterBlockType('core/comments-title'); 23 unregisterBlockType('core/post-comments-count'); 24 unregisterBlockType('core/post-comments-link'); 25 }); 10 'core/comment-author-avatar', 11 'core/comment-author-name', 12 'core/comment-content', 13 'core/comment-date', 14 'core/comment-edit-link', 15 'core/comment-reply-link', 16 'core/comment-template', 17 18 'core/comments-pagination', 19 'core/comments-pagination-next', 20 'core/comments-pagination-numbers', 21 'core/comments-pagination-previous', 22 'core/comments-title', 23 24 'core/latest-comments', 25 26 'core/post-comment', 27 'core/post-comments-count', 28 'core/post-comments-form', 29 'core/post-comments-link', 30 ]; 31 32 blocks.forEach( ( block ) => { 33 if ( undefined !== getBlockType( block ) ) { 34 unregisterBlockType( block ); 35 } 36 } ); 37 } );
Note: See TracChangeset
for help on using the changeset viewer.