close
Skip to content

fix(terms): honour selected taxonomy on term generation - #227

Merged
bordoni merged 1 commit into
mainfrom
fix/218-tags-generate-as-categories
Jul 16, 2026
Merged

fix(terms): honour selected taxonomy on term generation#227
bordoni merged 1 commit into
mainfrom
fix/218-tags-generate-as-categories

Conversation

@bordoni

@bordoni bordoni commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Fixes #218

Reported on wp.org: https://wordpress.org/support/topic/tags-not-being-created/

Problem

Generating terms with Tags selected created Categories instead — every term landed in category regardless of the selection.

Root cause

Terms.php registered a singular taxonomy arg with a hard-coded default => category. WP REST merges that default into every request, and the old translate block unconditionally copied it over the admin form's plural taxonomies value:

if ( isset( $params['taxonomy'] ) ) {   // always true — it is the injected default
    $params['taxonomies'] = $params['taxonomy'];   // clobbers the real selection with "category"
}

Same class of bug as the Posts post_types (#210) and Users role (#217) regressions.

Fix

Prefer the plural taxonomies value, accept the singular taxonomy as a deprecated alias, normalise arrays to a comma-separated string, and drop the category schema default.

Tests

TermsEndpointTest: plural taxonomies generates tags, plural wins over the singular alias, and a CSV taxonomies value samples across the requested taxonomies.

Milestone: 0.9.2

The Terms endpoint registered a singular 'taxonomy' arg with a hard-coded
'category' default, which WP REST injects into every request; the old
translate block then copied that default over the admin form's plural
'taxonomies' value, so every term landed in 'category' regardless of the
Tags/Categories selection. Prefer the plural 'taxonomies' value, accept the
singular 'taxonomy' as an alias, normalise arrays to a comma-separated string,
and drop the schema default. Mirrors the Posts #210 and Users #217 fixes.

Fixes #218
@bordoni bordoni added this to the 0.9.2 milestone Jul 16, 2026
@bordoni
bordoni merged commit 8e14e00 into main Jul 16, 2026
3 of 5 checks passed
@bordoni
bordoni deleted the fix/218-tags-generate-as-categories branch July 16, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tags not being generated

1 participant