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

Add Filter to Disable WooPay for Improved Compatibility #10468

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

BurakParsAydin
Copy link
Contributor

Fixes #9938

Changes proposed in this Pull Request

Added New Filter: Introduced the disable_woopay filter, allowing developers to conditionally disable WooPay, enhancing compatibility with custom themes and plugins.

Testing instructions

add_filter('disable_woopay', 'test_conditionally_disable_woopay');

function test_conditionally_disable_woopay() {
   
    if (is_user_logged_in()) {
        return true; // Disable WooPay
    }

    return false;
}

  • Run npm run changelog to add a changelog file, choose patch to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.
  • Covered with tests (or have a good reason not to test in description ☝️)
  • Tested on mobile (or does not apply)

@BurakParsAydin
Copy link
Contributor Author

@leonardola I'm not sure if I implemented the filter correctly. When I use the filter in the Storefront theme, I still see 'Payments' in the main admin navigation menu. Before spending more time on testing, I wanted to check in with you first to see if you have any insights or suggestions.
Thanks in advance for your help!

Copy link
Contributor

@leonardola leonardola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this issue @BurakParsAydin I left a comment about WooPay getting disabled even when nothing is hooking to the disable_woopay filter

@BurakParsAydin
Copy link
Contributor Author

@leonardola Thank you for your review. I’ve updated it according to your request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add hook for other plugins/themes to disable WooPay
2 participants