You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've searched for any related issues and avoided creating a duplicate issue.
Please give us a description of what happened
I was using the get_primary_term_taxonomies filter to add two custom taxonomies to the taxonomies that can have a primary category (per the documentation, but it was not working. After looking into the source code, I discovered that the taxonomies that can have primary terms are being filtered to exclude non-hierarchical taxonomies.
Why do these taxonomies have to be hierarchical? Could this filter be removed from the Primary_Term_Helper class and the generate_primary_term_taxonomies function?
(I was able to work around this problem by changing my taxonomies to 'hierarchical' => true, but I don't want them to be hierarchical.)
To Reproduce
Step-by-step reproduction instructions
Create a custom taxonomy with the attribute 'hierarchical' => false.
Use the wpseo_primary_term_taxonomies filter to add the 'primary term' feature to your custom taxonomy.
Notice that the feature does not appear when multiple terms in that taxonomy are selected in the post editor.
Expected results
A primary term can be selected for a custom taxonomy.
Actual results
No primary term can be set for a custom taxonomy.
Screenshots, screen recording, code snippet
n/a
Technical info
If relevant, which editor is affected (or editors): n/a
Which browser is affected (or browsers): n/a
Used versions
Device you are using: n/a
Operating system: n/a
PHP version: 8.2
WordPress version: 6.6.2
WordPress Theme: [custom theme]
Yoast SEO version: 23.4
Relevant plugins in case of a bug: n/a
The text was updated successfully, but these errors were encountered:
Please give us a description of what happened
I was using the
get_primary_term_taxonomies
filter to add two custom taxonomies to the taxonomies that can have a primary category (per the documentation, but it was not working. After looking into the source code, I discovered that the taxonomies that can have primary terms are being filtered to exclude non-hierarchical taxonomies.Why do these taxonomies have to be hierarchical? Could this filter be removed from the
Primary_Term_Helper
class and thegenerate_primary_term_taxonomies
function?(I was able to work around this problem by changing my taxonomies to
'hierarchical' => true
, but I don't want them to be hierarchical.)To Reproduce
Step-by-step reproduction instructions
'hierarchical' => false
.wpseo_primary_term_taxonomies
filter to add the 'primary term' feature to your custom taxonomy.Expected results
Actual results
Screenshots, screen recording, code snippet
n/a
Technical info
Used versions
The text was updated successfully, but these errors were encountered: