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

Fix Incorrect Terminology: action to filter on woocommerce_get_formatted_order_total #9340

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

alexmigf
Copy link

Fixes #9335

Changes proposed in this Pull Request

Title: Fix action hook placement and change add_action to add_filter for better consistency.

Description:
This PR addresses an issue where the add_action hook was used incorrectly instead of add_filter. The line in question has been moved below the relevant filters to ensure proper execution order. Changing add_action to add_filter ensures that the code behaves as expected within the WordPress framework, particularly in cases where the intent is to modify existing behavior rather than add new behavior. This fix was necessary to prevent unexpected issues arising from the incorrect hook usage.

How can this code break?
If the hook order is not respected, it could lead to unexpected behavior where the filter doesn't apply as intended, or subsequent filters/actions may not execute correctly.

What are we doing to make sure this code doesn't break?
The change has been carefully tested to ensure that the hook is applied correctly and that no side effects occur from the altered execution order. Additional tests have been performed to confirm that the filter operates as intended.

Testing instructions

  1. Apply the PR and verify that the filter now correctly influences the intended functionality.
  2. Ensure that there are no errors or unexpected behaviors due to the change in hook placement and type.
  3. Test across various scenarios where the filter should apply to ensure consistency.

No visual changes are introduced, so no before/after screenshots are needed.


  • Run npm run changelog to add a changelog file, choose patch to leave it empty if the change is not significant.
  • Covered with tests (or have a good reason not to test in description ☝️)
  • Tested on mobile (or does not apply)

Post merge

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.

Incorrect Terminology: Action Used Instead of Filter
1 participant