Download the PHP package kaiseki/wp-get-terms-by-post-type without Composer
On this page you can find all versions of the php package kaiseki/wp-get-terms-by-post-type. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kaiseki/wp-get-terms-by-post-type
More information about kaiseki/wp-get-terms-by-post-type
Files in kaiseki/wp-get-terms-by-post-type
Package wp-get-terms-by-post-type
Short Description Extend WordPress get_terms() to count and constrain terms by the post types attached to them
License MIT
Homepage https://github.com/kaisekidev/kaiseki-wp-get-terms-by-post-type
Informations about the package wp-get-terms-by-post-type
kaiseki/wp-get-terms-by-post-type
Extend WordPress get_terms() to count and constrain terms by the post types attached to them.
A single kaiseki/wp-hook HookProviderInterface (HookRegistry) that filters terms_clauses so a
get_terms() query restricted with a post_type argument returns only terms attached to those post
types, each with a count of matching posts. By default only published posts are counted; pass
post_status to override.
Installation
Requires PHP 8.2 or newer.
Usage
Register ConfigProvider with your laminas-style config aggregator and activate the provider via
kaiseki/wp-hook:
With the provider active, pass post_type (and optionally post_status) to get_terms():
Queries that request 'fields' => 'count' are passed through unchanged.
Development
License
MIT — see LICENSE.
All versions of wp-get-terms-by-post-type with dependencies
kaiseki/config Version ^2.0
kaiseki/wp-hook Version ^2.0
psr/container Version ^1.1 || ^2.0