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

Custom taxonomies on attachments #54

Closed
zoerooney opened this issue Dec 18, 2013 · 5 comments
Closed

Custom taxonomies on attachments #54

zoerooney opened this issue Dec 18, 2013 · 5 comments
Milestone

Comments

@zoerooney
Copy link

Hi there,

Your plugin looks really interesting but I have a couple issues with it, which I'll list in separate issue reports here. First, it doesn't seem to work with custom taxonomies on attachments (where 'post_type' => 'attachment'). Wondering if this has to do with post_status and attachments?

When using the combination of a custom taxonomy and attachments, there are no results returned.

Will post the other issue separately (it's more of a feature request).

Thanks,
Zoe

@zoerooney
Copy link
Author

This solution works, btw: http://wordpress.org/support/topic/attachments-not-included-in-cloud-results?replies=1 (adding 'inherit' as a valid post_status in the QueryBuilder.php file) but would still be better as an option or triggered based on post_type, I think

@rickard2
Copy link
Owner

Do you know when post status inherit is used? Is it only relevant for attachments?

@zoerooney
Copy link
Author

As far as I can tell (it's pretty incomplete in the Codex), it's only used for children of a post or page, so attachments, revisions, or sub-pages. Seems like mostly attachments but I guess there could be an edge case where someone might be intentionally displaying revisions, although I can't find anything in a quick search about whether that's possible on the front-end. For sub-pages, they typically have their own post status, but maybe there are cases where someone wants to use inherit to display them based on parent page status.

I ran into issues with your plugin where stragegy = current_list wasn't working (perhaps similar to this support thread: http://wordpress.org/support/topic/fetch-terms-base-on-the-current-list) - not using WooCommerce, but with a custom query on the page using WP_Query but would be happy to test further on a test site in the future if it's helpful.

@rickard2
Copy link
Owner

Ok, so the safest solution would be to add post_status = inherit AND post_type = attachment to the query to make sure that only attachments are included. I will try that in 2.6 and then maybe you could test the beta version and see if it works?

Regarding the current list strategy I'm aware that it will not work in every case since it relies on getting the current $wp_query and calculating the terms from there. (code: https://github.com/rickard2/utcw/blob/master/src/Plugin.php#L565)

If you can find any other way to more accurately find terms from the current list of posts I'm happy for your help/suggestions.

@rickard2
Copy link
Owner

First beta version is available now: http://downloads.wordpress.org/plugin/ultimate-tag-cloud-widget.2.6-beta1.zip

Or use WP-CLI:

rm -rf wp-content/plugins/ultimate-tag-cloud-widget/
wp plugin install ultimate-tag-cloud-widget --version=2.6-beta1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants