Changeset 3173645
- Timestamp:
- 10/22/2024 12:35:34 PM (17 months ago)
- Location:
- disable-comments-entire
- Files:
-
- 4 added
- 3 edited
-
tags/1.1 (added)
-
tags/1.1/class-disable-entire-comment.php (added)
-
tags/1.1/disable-entire-comment.php (added)
-
tags/1.1/readme.txt (added)
-
trunk/class-disable-entire-comment.php (modified) (7 diffs)
-
trunk/disable-entire-comment.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
disable-comments-entire/trunk/class-disable-entire-comment.php
r3016762 r3173645 7 7 private static $instance = null; 8 8 9 /** 10 * Initializes the plugin by setting up constants and actions/filters to disable comments. 11 * 12 * @since 1.0 13 * @uses DECMC_constants 14 * @uses DECMC_init 15 * @return void 16 */ 9 17 public function __construct() { 10 18 $this->DECMC_constants(); … … 13 21 14 22 23 /** 24 * Set constants 25 * 26 * If not defined, set 'DECMC_ADMIN_BAR_PLUGIN_URL' to the URL of the plugin directory. 27 * 28 * @since 1.0 29 * @uses plugins_url 30 * @uses __FILE__ 31 * @uses trailingslashit 32 * @return void 33 */ 15 34 public function DECMC_constants(){ 16 35 if (!defined('DECMC_ADMIN_BAR_PLUGIN_URL')) { … … 19 38 } 20 39 40 /** 41 * Initialize the plugin by setting up actions and filters to disable comments. 42 * 43 * - Redirects users attempting to access the comments page. 44 * - Disables comments and pings on the front-end. 45 * - Hides all existing comments. 46 * - Removes the comments page from the dashboard menu. 47 * - Removes comments links from the dashboard admin bar. 48 * - Filters media comment status to be closed. 49 * - Loads the plugin text domain for translations. 50 * 51 * @since 1.0 52 */ 21 53 public function DECMC_init(){ 22 54 // Redirect all user trying to access comments page … … 47 79 } 48 80 81 49 82 /** 50 * Disabling access 83 * Redirects users from the comments page to the admin dashboard. 84 * 85 * - Checks if the current page is 'edit-comments.php' and redirects to the admin dashboard if true. 86 * - Removes the recent comments metabox from the dashboard. 87 * - Disables support for trackbacks and comments for all post types that support comments. 88 * 89 * @since 1.0 51 90 */ 52 91 public function DECMC_redirect_on_comment_page_access() { … … 71 110 } 72 111 112 /** 113 * Filters the media comment status. 114 * 115 * Checks if the post type is 'attachment' and returns false to disable comments. 116 * 117 * @param bool $open Whether the comments are open for the post. 118 * @param int $post_id The ID of the post. 119 * @return bool The updated comment status. 120 */ 73 121 public function DECMC_filter_media_comment_status( $open, $post_id ) { 74 122 $post = get_post( $post_id ); … … 79 127 } 80 128 129 /** 130 * Loads the plugin text domain for translations. 131 * 132 * @since 1.0 133 */ 81 134 public function DECMC_load_text_domain() { 82 135 load_plugin_textdomain( $this->textdomain , false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); … … 88 141 */ 89 142 143 /** 144 * Returns the instance of the class, creating it if it doesn't exist yet. 145 * 146 * @since 1.0 147 * @return DECMC_disable 148 */ 90 149 public static function DECMC_instance() 91 150 { -
disable-comments-entire/trunk/disable-entire-comment.php
r3016766 r3173645 4 4 * Plugin URI: https://wordpress.org/plugins/search/disable-comments-entire/ 5 5 * Description: This plugin enables you to deactivate all comment-related features across your entire website. No additional settings or extra code are required—simply activate the plugin. 6 * Version: 1. 06 * Version: 1.1 7 7 * Requires at least: 5.2 8 8 * Requires PHP: 5.6 -
disable-comments-entire/trunk/readme.txt
r3016766 r3173645 3 3 Tags: disable comments, disable media comments, disable entire comments, disable full comments, no more comments 4 4 Requires at least: 5.2 5 Tested up to: 6. 4.26 Stable tag: 1. 05 Tested up to: 6.6.2 6 Stable tag: 1.1 7 7 Requires PHP: 8.0 8 8 License: GPLv3 or later … … 25 25 == Changelog == 26 26 27 = 1.1 = 28 Tested up to WordPress 6.6.2 29 27 30 = 1.0 = 28 31 Plugin created!
Note: See TracChangeset
for help on using the changeset viewer.