-
Notifications
You must be signed in to change notification settings - Fork 33
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
Replacing get_posts with wc_get_orders #719
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @wjrosa I'm sorry to say but these functions will no longer be used and will be deprecated once we merge #163 so I don't think we need to update them 😢 Sorry!
I think we can also ignore the get_posts()
used in wcs_get_subscription_id_from_key()
as it's an old helper function from back when a subscription object used to be an array of data stored in order meta (stored in meta {$order_id}_{$product_id}
which we referred to as a subscriptions key) 🙈
I guess it technically still works and it's not a deprecated helper 🤷 So maybe it's fine for us to update it? Although, just above this get_posts()
is a direct posts
table query so we'd need to update that as well.
I'll leave it up to you if you want to update it or close this PR entirely.
If we do decide to leave it, we should probably add an inline comment in case someone stumbles upon this get_posts()
and has questions xD
No worries! Thanks for letting me know. I have just added the comment above the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @wjrosa for the latest changes! Approving this :)
Fixes 2248-gh-woocommerce/woocommerce-subscriptions
Description
This PR replaces the usage of the function
get_posts
withwc_get_orders
to improve performance. To do that, I have updated all the parameters accordingly.How to test this PR
Code review. Check if the tests are still passing.
Product impact