[wp-trac] [WordPress Trac] #56351: Shared terms will not apply properly to a post in WordPress 6.0
WordPress Trac
noreply at wordpress.org
Mon Aug 8 21:16:11 UTC 2022
#56351: Shared terms will not apply properly to a post in WordPress 6.0
--------------------------+-----------------------------
Reporter: kaygee79 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Taxonomy | Version:
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
Starting with WordPress 6.0, and with a databases that still as shared
terms, only one taxonomy can be applied to a post.
Having a term that belongs to multiple taxonomies e.g.
{{{
+---------+---------------+---------------+----------+
| term_id | name | slug | taxonomy |
+---------+---------------+---------------+----------+
| 277 | TermSplitTest | termsplittest | category |
| 277 | TermSplitTest | termsplittest | post_tag |
+---------+---------------+---------------+----------+
+------------------+---------+----------+-------------+--------+-------+
| term_taxonomy_id | term_id | taxonomy | description | parent | count |
+------------------+---------+----------+-------------+--------+-------+
| 472 | 277 | category | | 0 | 8 |
| 277 | 277 | post_tag | | 0 | 6 |
+------------------+---------+----------+-------------+--------+-------+
}}}
A post will apply the term to only one taxonomy e.g. selecting this term
as a category will apply this term as a post tag or vice versa. This
change was introduced in: https://core.trac.wordpress.org/changeset/52921/
With WordPress 5.9.x the `term_exists` function would return the correct
`term_taxonomy_id`:
{{{
term_exists( 277, 'category' );
Array
(
[term_id] => 277
[term_taxonomy_id] => 472
)
term_exists( 277, 'post_tag' );
Array
(
[term_id] => 277
[term_taxonomy_id] => 277
)
}}}
With WordPress 6.0.x `term_exists` returns the same `term_taxonomy_id`:
{{{
term_exists( 277, 'category' );
Array
(
[term_id] => 277
[term_taxonomy_id] => 277
)
term_exists( 277, 'post_tag' );
Array
(
[term_id] => 277
[term_taxonomy_id] => 277
)
}}}
The term will be split if you re-save it in `wp-admin` using the
`category` taxonomy. The same does not happen if you re-save the term in
the `post_tag` taxonomy. Instead you get an error:
[[Image(https://d.pr/i/Ll8FoF.png)]]
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56351>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list