PHPackages                             ralfhortt/current-post-terms-query - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. ralfhortt/current-post-terms-query

ActiveWordpress-plugin

ralfhortt/current-post-terms-query
==================================

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

v1.0.3(1mo ago)04GPL-2.0-or-laterTypeScriptPHP &gt;=8.1

Since Jul 13Pushed 1mo agoCompare

[ Source](https://github.com/Horttcore/current-post-terms-query)[ Packagist](https://packagist.org/packages/ralfhortt/current-post-terms-query)[ RSS](/packages/ralfhortt-current-post-terms-query/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (4)DependenciesVersions (5)Used By (0)

Current Post Terms Query
========================

[](#current-post-terms-query)

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
------------

[](#requirements)

- WordPress 6.1 or later
- PHP 8.1 or later

Installation
------------

[](#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
-----

[](#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.

In the Site Editor, the preview skips template and template-part editing contexts so it does not treat the template itself as the current post. On the server, filtering only runs when an explicit `postId` is available in block context; template parts without post context remain unfiltered.

Development
-----------

[](#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
------

[](#author)

[Ralf Hortt](mailto:mail@ralfhortt.dev)

License
-------

[](#license)

GPL-2.0-or-later. See [the GNU General Public License](https://www.gnu.org/licenses/gpl-2.0.html).

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance90

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

47d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/45d54752dcf3da868ffe4a5ad2b876d6acb911fd914700b52e4d4777ff7d4a02?d=identicon)[Ralf Hortt](/maintainers/Ralf%20Hortt)

---

Top Contributors

[![Horttcore](https://avatars.githubusercontent.com/u/503252?v=4)](https://github.com/Horttcore "Horttcore (6 commits)")

---

Tags

block-editorquery-blockwordpress

### Embed Badge

![Health badge](/badges/ralfhortt-current-post-terms-query/health.svg)

```
[![Health](https://phpackages.com/badges/ralfhortt-current-post-terms-query/health.svg)](https://phpackages.com/packages/ralfhortt-current-post-terms-query)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
