Download the PHP package viget/viget-primary-term without Composer
On this page you can find all versions of the php package viget/viget-primary-term. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download viget/viget-primary-term
More information about viget/viget-primary-term
Files in viget/viget-primary-term
Package viget-primary-term
Short Description Lets editors pick a primary term for a post from the block editor's taxonomy panels.
License GPL-2.0-or-later
Homepage https://github.com/vigetlabs/viget-primary-term
Informations about the package viget-primary-term
Viget Primary Term
Lets editors pick a primary term for a post from the block editor's taxonomy panels, e.g. a primary category for a post with several.
Features
- Turn taxonomies on from Settings → Primary Terms, or register them in code with the
vgpt_registered_taxonomiesfilter. Registered taxonomies show on the settings page as locked rows. - A Primary {Term} select appears under the taxonomy's panel once 2+ terms are checked. It lists only the checked terms, including ones just added from the panel.
- The first option shows the fallback, e.g. "Default: Chains › Roller". With no primary term,
get_primary_term()uses the deepest term (hierarchical) or the first by name (flat). - Unchecking the primary term clears it.
- Checks for updates from GitHub releases in the WordPress dashboard.
Block editor only. The classic editor isn't supported.
Installation
Manual
- Download the latest release zip.
- Upload it via Plugins → Add New → Upload Plugin, or extract it to
wp-content/plugins/viget-primary-term/. - Activate the plugin.
Composer
Usage
Turn on a taxonomy from Settings → Primary Terms, or in code:
Read a post's primary term:
The term ID is stored in post meta as _vgpt_primary_{taxonomy}, registered for the REST API on every post type the taxonomy is attached to. Those post types get custom-fields support, which the REST API needs to include meta.
Auto-Updates
This plugin checks GitHub releases every 12 hours and surfaces updates in Plugins. See includes/class-github-plugin-updater.php. That's incompatible with the wordpress.org plugin directory, which this plugin isn't listed in.
Developer API
Public methods and filters are documented in docs/api.md.