Fix Incorrect Terminology: action to filter on woocommerce_get_formatted_order_total
#9340
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #9335
Changes proposed in this Pull Request
Title: Fix action hook placement and change
add_action
toadd_filter
for better consistency.Description:
This PR addresses an issue where the
add_action
hook was used incorrectly instead ofadd_filter
. The line in question has been moved below the relevant filters to ensure proper execution order. Changingadd_action
toadd_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
No visual changes are introduced, so no before/after screenshots are needed.
npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant.Post merge