定制 wvnderlab-agency/wp-disable-date-based-archives 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

wvnderlab-agency/wp-disable-date-based-archives

最新稳定版本:0.1.0

Composer 安装命令:

composer require wvnderlab-agency/wp-disable-date-based-archives

包简介

A simple WordPress mu-plugin to disable date based archives.

README 文档

README

PHP WordPress WP Coding Standards

Installation

Via Composer

composer require wvnderlab-agency/wp-disable-date-based-archives

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 posts' 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-date-based-archives/enabled (Default: true)

This filter allows you to disable the plugin functionality.

// disable the plugin functionality
add_filter( 'wvnderlab/disable-date-based-archives/enabled', '__return_false' );

wvnderlab/disable-date-based-archives/status-code (Default: 404)

This filter allows you to set the HTTP status code returned when posts 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-date-based-archives/status-code', fn() => 301 );
// set the status code to 302 - Found
add_filter( 'wvnderlab/disable-date-based-archives/status-code', fn() => 302 );
// set the status code to 307 - Temporary Redirect
add_filter( 'wvnderlab/disable-date-based-archives/status-code', fn() => 307 );
// set the status code to 308 - Permanent Redirect
add_filter( 'wvnderlab/disable-date-based-archives/status-code', fn() => 308 );
// set the status code to 410 - Gone
add_filter( 'wvnderlab/disable-date-based-archives/status-code', fn() => 410 );

wvnderlab/disable-date-based-archives/redirect-url (Default: home_url())

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

// override the redirect URL
add_filter( 'wvnderlab/disable-date-based-archives/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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固