Skip to content

Taxonomy ​

A Taxonomy field lets editors choose terms from one taxonomy, such as the Genre of a book, inside the VX form.

On posts, the choice becomes a real WordPress term assignment, exactly as if the editor had used WordPress's own taxonomy box. Archives, category pages, queries and other plugins all see it. That's the difference from a Select field that happens to list style names.

Settings ​

  • Taxonomy: which taxonomy the field assigns.
  • Allow creating new terms: editors can add a term that doesn't exist yet. Turn it off to keep the list controlled.
  • Minimum selections and Maximum selections.
  • Order: how terms are listed. Choose Manual to let editors drag the chosen terms into order. The taxonomy needs Preserve term order turned on for WordPress to keep that order.

VX editor or WordPress's own box ​

On post edit screens, When editing posts through the WordPress backend, edit this field using offers two modes:

  • Custom field (VX editor), the default: the terms are picked in the VX panel, and WordPress's own panel for that taxonomy is hidden, so editors have one place to choose terms.
  • Native WordPress metabox: editors keep using WordPress's own taxonomy box, and VX leaves the field out of its form. Conditional logic doesn't apply to it in this mode. An assistant, the REST API or your own code can still write the field, which assigns the terms.

Choosing a post's terms takes the same permission as in WordPress's own box: the taxonomy's capability to assign its terms, which by default everyone who can write posts has. Someone without it sees the field read-only, and saving the post leaves its terms as they are.

On terms and users ​

Terms and users can't be assigned to terms the way posts can. There, a Taxonomy field stores the chosen term IDs as an ordinary value.

Technical details for LLMs
  • Type key: taxonomy. Always multi-select (condition profile set). Settings: taxonomy, allow_create (default true), min_count, max_count, order_by (manual enables drag-reorder), backend_edit_mode (custom_field | native_metabox), placeholder.
  • Storage: on posts, term_assignment (wp_set_object_terms), not meta. Elsewhere, a JSON list of term ids in meta under the field key.
  • Capability: on posts, a signed-in user needs the taxonomy's assign_terms (cap->assign_terms, default edit_posts); without it the editor payload marks the field read_only and every save path, the block editor's meta write included, leaves the terms unchanged. Code that runs with no user signed in isn't limited.
  • native_metabox on posts: the VX form leaves the field out, and a save that doesn't send its key leaves the terms alone (a full save doesn't clear it). A save that sends the key (an ability, the REST vx field, save_fieldset_values()) assigns the terms, ignoring conditional logic. To assign terms without a Taxonomy field, use terms on vx-framework/create-post / vx-framework/update-post (Editing content).
  • Abilities: read term refs; write an array of term ids (on posts this sets term assignments). An id that isn't a term of the field's taxonomy is dropped with an unknown_term warning, so a strict write fails and a lenient one saves the rest.
  • Filter the offered taxonomies with vxframework/fieldsets/taxonomy_field/available_taxonomies.

Documentation for the VX Framework.