定制 ralfhortt/current-post-terms-query 二次开发

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

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

ralfhortt/current-post-terms-query

Composer 安装命令:

composer require ralfhortt/current-post-terms-query

包简介

A WordPress plugin that filters Terms Query blocks by the current post's terms.

README 文档

README

A WordPress plugin that adds a Show only terms of the current post option to Terms Query blocks.

When enabled, a Terms Query block displays only terms assigned to the post currently being viewed. The editor preview and rendered block output use the same filtering behavior.

Requirements

  • WordPress 6.1 or later
  • PHP 8.1 or later

Installation

Install the plugin with Composer:

composer require ralfhortt/current-post-terms-query

Alternatively, download or clone this repository into wp-content/plugins/current-post-terms-query.

If you are building from source, install the JavaScript dependencies:

npm install

Build the editor assets:

npm run build

Finally, activate Current Post Terms Query in WordPress.

Usage

  1. Add a Terms Query block to a template or post.
  2. Select a taxonomy.
  3. Enable Show only terms of the current post in the block settings.

If the Terms Query has configured included term IDs, the result is limited to the intersection of those IDs and the current post's terms.

Development

Build the production editor bundle:

npm run build

Start the development watcher:

npm run start

The PHP filter is implemented in src/CurrentPostTermsQueryFilter.php. Editor controls and preview behavior are implemented in src/js/editor/.

Author

Ralf Hortt

License

GPL-2.0-or-later. See the GNU General Public License.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: TypeScript

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2026-07-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固