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

Prevent the order count transient from being set before $wc_order_types is populated #52

Merged
merged 3 commits into from
Sep 17, 2020

Conversation

stevegrunwell
Copy link
Contributor

This PR defers the generation of the OrderLimiter::TRANSIENT_NAME transient until after WooCommerce populates its $wc_order_types variable (by default, this occurs at init:5).

Additionally, if the plugin is attempting to generate the transient while $wc_order_types is empty, the plugin will automatically re-queue the operation until init:10, ensuring it still happens on the given request (just later than intended).

Fixes #48.

@stevegrunwell stevegrunwell added the bug Something isn't working label Sep 17, 2020
@stevegrunwell stevegrunwell added this to the Version 1.3.1 milestone Sep 17, 2020
@bswatson bswatson merged commit 4b84d69 into develop Sep 17, 2020
@bswatson bswatson deleted the fix/empty-transient branch September 17, 2020 18:16
@stevegrunwell stevegrunwell mentioned this pull request Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transient is being regenerated before WooCommerce post types are registered
2 participants