-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
Fix Largo_Related #1338
Fix Largo_Related #1338
Conversation
…y' and 'post_tag' taxonomies.
The current state of the plugin queries for categories and terms, and displays related posts from those taxonomy terms in that order. But categories are generally more generic than tags - should this instead display related posts from tags first, and then from categories if there aren't enough related tags? |
Looks like the tests fixed in https://github.com/INN/Largo/pull/1293/files are broken by this; possibly because they're expecting the wrong order of posts or no posts? #1293 introduced the bad slugs at least. |
…put, in accordance with wp_insert_post parameters
…eak tests in a way that is not intuitive.
…e tax_input, in accordance with wp_insert_post parameters" This reverts commit 0a43166.
I'm leaving the series query alone for now, and making some notes on #1335 about that. This PR now only touches the term args, and doesn't appear to fail those tests. |
Just a note that we'll also need to update the plugin version of this (for NPRDS and because that will ultimately be the replacement for this when it's removed from Largo and pulled out into a separate plugin) |
re: "The current state of the plugin queries for categories and terms, and displays related posts from those taxonomy terms in that order. But categories are generally more generic than tags - should this instead display related posts from tags first, and then from categories if there aren't enough related tags?" Yes, it should use tags over categories because they're more specific (usually) |
Changes
'taxonomy'
and'term'
query vars with a'tax_query'
array, so we're using the modern style instead of the style deprecated in WordPress 3.1: https://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters (class Largo_Related uses ancient tax query parameters for its series query #1335)This probably would have been caught by #884 if we had tests.
I'll make a note of this PR on #1274, which removes this widget and puts it in a plugin.