-
Notifications
You must be signed in to change notification settings - Fork 22
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: handle inactive woocommerce #1437
Conversation
@@ -79,6 +79,9 @@ public static function filter_lists( $lists ) { | |||
if ( ! is_array( $lists ) || empty( $lists ) ) { | |||
return $lists; | |||
} | |||
if ( ! function_exists( 'wc_memberships_is_post_content_restricted' ) ) { |
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.
Hmm so apparently this happens if woo memberships is active but woocommerce is not.
I think it's best to fix the check on the init
method, that checks class_exists( 'WC_Memberships_Loader' )
. If Woo and/or Woo memberships is not active, the hooks should not even be initalized
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.
Good idea, added in acacf58
🎉 This PR is included in version 2.12.0-alpha.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
# [2.12.0](v2.11.2...v2.12.0) (2024-03-25) ### Bug Fixes * handle inactive woocommerce ([#1437](#1437)) ([b369d54](b369d54)) * **mc:** log add_user_to_lists errors ([#1444](#1444)) ([c53b02a](c53b02a)) ### Features * update translation strings ([#1435](#1435)) ([822c7e1](822c7e1)) ### Reverts * chore(release): 2.12.0-alpha.1 to avoid conflicts [skip ci] ([4ba5000](4ba5000))
🎉 This PR is included in version 2.12.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
Add a check for WC function existence.
How to test the changes in this Pull Request:
Should be self-explanatory, but if testing is needed – I've encountered this after deactivating
woocommerce
and editing a post. PHP Errors are logged in this situation ontrunk
.Other information: