-
-
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
largo_category_and_tags does not accept specification of an arbitrary post ID #1647
Comments
We can't remove |
…tags(), and a fix for #1647 by not calling largo_category_and_tags() when the post given to largo_top_term() does not match the post returned by get_the_ID()
Post-#1648, our next steps are:
Remove: https:/INN/largo/blob/512da701664b329f2f92244bbe54880a6e146431/inc/related-content.php#L399-L431 Refactor: https:/INN/largo/blob/512da701664b329f2f92244bbe54880a6e146431/inc/related-content.php#L235-L250 |
Consider the following code:
Assuming that post 5 has a top term set, the top term returned will be that set on post 5.
If no top term is set on post 5,
largo_top_term()
callslargo_category_and_tags()
to get a list of categories and tags. That function doesn't use post 5, but instead fetches terms from theget_the_ID()
post, which in many situations (like the homepage) is not the post that we want terms for.There are two situations to consider:
largo_category_and_tags()
, because its output will be wrong.largo_top_term()
will get the post ID to use fromget_the_ID()
the same aslargo_category_and_tags()
. This use case includes the top term on single posts.Identified during work on #1646
The text was updated successfully, but these errors were encountered: