承接 wvnderlab-agency/wp-disable-comments 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wvnderlab-agency/wp-disable-comments

最新稳定版本:0.2.0

Composer 安装命令:

composer require wvnderlab-agency/wp-disable-comments

包简介

A simple WordPress mu-plugin to disable comments.

README 文档

README

PHP WordPress WP Coding Standards

Installation

Via Composer

composer require wvnderlab-agency/wp-disable-comments

Via FTP

  1. Download the repository zip file.
  2. Unzip the file.
  3. Upload the unzipped folder to the /wp-content/muplugins or /wp-content/plugins/ directory on your server.
  4. Navigate to the 'Plugins' section in your WordPress admin dashboard.
  5. Find 'Disable Comments' in the list and click 'Activate'.

Via WordPress Admin Dashboard

  1. Download the repository zip file.
  2. Navigate to the 'Plugins' section in your WordPress admin dashboard.
  3. Click 'Add New' and then 'Upload Plugin'.
  4. Choose the downloaded zip file and click 'Install Now'.
  5. After installation, click 'Activate Plugin'.

Usage

Filter Hooks

wvnderlab/disable-comments/enabled (Default: true)

This filter allows you to disable the plugin functionality.

// disable the plugin functionality
add_filter( 'wvnderlab/disable-comments/enabled', '__return_false' );

wvnderlab/disable-comments/status-code (Default: 404)

This filter allows you to set the HTTP status code returned when comments are disabled.

You can set it to standard codes like 404 (Not Found), 410 (Gone), or redirect codes like 301 (Moved Permanently) or 302 (Found).

// set the status code to 301 - Moved Permanently
add_filter( 'wvnderlab/disable-comments/status-code', fn() => 301 );
// set the status code to 302 - Found
add_filter( 'wvnderlab/disable-comments/status-code', fn() => 302 );
// set the status code to 307 - Temporary Redirect
add_filter( 'wvnderlab/disable-comments/status-code', fn() => 307 );
// set the status code to 308 - Permanent Redirect
add_filter( 'wvnderlab/disable-comments/status-code', fn() => 308 );
// set the status code to 410 - Gone
add_filter( 'wvnderlab/disable-comments/status-code', fn() => 410 );

wvnderlab/disable-comments/redirect-url (Default: home_url())

This filter allows you to override the redirect URL when comments are disabled and the wvnderlab/disable-comments/status-code filter is set to use a redirect status code (e.g., 301 or 302).

// override the redirect URL
add_filter( 'wvnderlab/disable-comments/redirect_url', 'YOUR_REDIRECT_URL' );

Development

Install Dependencies

composer install

Analyse Code-Quality with WP-Coding-Standards

composer analyze

Refactor Code along WP-Coding-Standards

composer refactor

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固