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

Differentiate selected terms by slug and taxonomy #774

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

lvl99
Copy link

@lvl99 lvl99 commented Sep 25, 2017

I added in a way to differentiate terms by slug and taxonomy, much like the post_select has a way to differentiate by post type. I often have a number of categories with the same name (e.g. same named categories for men's and women's products on sale) so required the further differentiation.

Additionally, wp_count_terms uses get_terms anyway, so I edited it to work better with IDEs like PHPStorm which complain about wp_count_terms requiring $taxonomy_type to be a string.

…tiple taxonomies to select from. Additionally, I added in a way to differentiate terms by slug and taxonomy
@lvl99 lvl99 changed the title Added wa Differentiate selected terms by slug and taxonomy Sep 25, 2017
@goldenapples
Copy link
Contributor

I can see it being good to differentiate between term in different taxonomies with the same name, but I'm not sure about adding slugs in there. That seems like a very specialized case - in most situations, the content author shouldn't be concerned with the slugs for any terms.

Also, can you update this so that the taxonomy is only shown if more than one taxonomy is being queried, similarly to how the post type is being shown on post_select fields?

… term slug and also made these only visible if multiple post types or taxonomies are enabled
@lvl99
Copy link
Author

lvl99 commented Sep 27, 2017

Thanks for your input @goldenapples.

I modified the post_select and term_select to show relative URLs instead of slugs (what I mainly needed was to see the location of where the page is, not just the slug).

I also made it show the relative URL and taxonomy type only if there are multiple post types/taxonomies configured for the field.

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.

2 participants