Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

post-type taxonomy appears in get_taxonomies() output without proper labels #1173

Closed
benlk opened this issue Mar 17, 2016 · 5 comments · May be fixed by #1843
Closed

post-type taxonomy appears in get_taxonomies() output without proper labels #1173

benlk opened this issue Mar 17, 2016 · 5 comments · May be fixed by #1843
Assignees
Labels
priority: low Nice-to-have in a release. type: bug

Comments

@benlk
Copy link
Collaborator

benlk commented Mar 17, 2016

This happens only if the option to enable the post-types prominence term is unchecked in Theme Options > Advanced > Enable "Post Types" taxonomy.

If the option is unchecked, the label of the post-type taxonomy as rendered in the Largo Taxonomy List widget is "Tag":
screen shot 2016-03-17 at 11 59 21 am

If the option is checked, the label is the correct "Post Types":
screen shot 2016-03-17 at 11 58 53 am

I think this is because the action that hides the taxonomy is stripping all the labels: https://github.com/INN/Largo/blob/74508518af57e99a378cdf8fd31317c56667118f/inc/taxonomies.php#L466-L471

    if ( of_get_option('post_types_enabled') == 0 ) {
        register_taxonomy( 'post-type', array(), array('show_in_nav_menus' => false) );
    }

So the solution is to either change the initial registration function in inc/term-icons.php to set show_in_nav_menus on registration, or to change the reregistration function to not obliterate the labels.

@benlk benlk added this to the Backlog milestone Mar 17, 2016
@benlk
Copy link
Collaborator Author

benlk commented Mar 17, 2016

IMHO, this should be tackled before 0.5.5 ships with #1171. It will cause confusion otherwise: Users will select the post-types "Tag" entry and wonder why no tags appear.

@benlk
Copy link
Collaborator Author

benlk commented Mar 17, 2016

The public option of the term should also be set to false if the taxonomy is meant to be hidden.

https://codex.wordpress.org/Function_Reference/register_taxonomy

@aschweigert
Copy link

People are literally only going to use this widget for series (and maybe categories) as I've said before :)

But, I do agree with the general point that we should set these options correctly when all custom taxonomies are registered. Also, the post types taxonomy should be registered in inc/taxonomies with everything else and not in inc/term-icons

@benlk benlk added the priority: low Nice-to-have in a release. label Mar 17, 2016
@benlk benlk modified the milestones: hotfix, Backlog Mar 17, 2016
@benlk
Copy link
Collaborator Author

benlk commented Mar 17, 2016

Moving to hotfix for HELPDESK-589, will include this fix in #1171.

@benlk
Copy link
Collaborator Author

benlk commented Mar 31, 2016

#1171 is closed; this fix is now in #1187 targeting 0.5.5.

@benlk benlk modified the milestones: 0.5.5 - Story Elements, hotfix Mar 31, 2016
@benlk benlk assigned benlk and unassigned aschweigert Mar 31, 2016
@benlk benlk mentioned this issue Feb 6, 2020
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: low Nice-to-have in a release. type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants