Last active
October 5, 2018 09:50
-
-
Save tivnet/8b0159667ca411859b47eaef466dc069 to your computer and use it in GitHub Desktop.
WooCommerce API Manager: Fix 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// class WC_Api_Manager_Helpers | |
// Status can be lowercase. | |
public function is_user_subscription_active( $status ) { | |
// Wrong: | |
// return $status == 'Active' || $status == 'Pending Cancellation' ? true : false; | |
// Correct: | |
return ( strtolower( $status ) === 'active' || $status === 'Pending Cancellation' ); | |
} |
We translated WooCommerce Subscriptions to Polish and then API keys and downloads disappeared from My Account page.
Status slugs should be used (i.e. active, pending-cancel) and not names. Because status names can be translated and then the whole system breaks.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@toddlahman
For your attention
Thanks