impress-org / givewp

GiveWP - The #1 Donation Plugin for WordPress. Easily accept donations and fundraise using your WordPress website.
https://givewp.com/
GNU General Public License v3.0
344 stars 191 forks source link

Hook mismatch #2931

Closed Psypher9 closed 6 years ago

Psypher9 commented 6 years ago

User Story

I was trying to add a custom field to the Donations -> Donation Details page and saw that the givewp.com documentation of this issue (found here givewp.com) seems to either be outdated or at least ahead of the times and is documenting a future version. I'm currently on Give v. 2.0.6 and the documented pattern didn't work for me.

Here's what I did at first using the example from the docs:

add_action( 'give_view_donation_details_billing_after', '<my_custom_function>', 10, 1 );

But that yielded no results, so after poking around in the code a bit I noticed that the hook named there was nowhere to be found (`give_view_donation_details_billing_after). However, I did see a similar one which wasgive_view_order_details_billing_after` and using that worked. So my code is now:

add_action( 'give_view_order_details_billing_after', '<my_custom_function>', 10, 1 );

changing donation to order.

I noticed that the pattern of the deprecated hooks and filters were trending away from language that was more business oriented, so I figured that this might have been something that was missed. Just a heads up!

Current Behavior

I currently cannot access the documented hook.

Expected Behavior

I expect to use the action hook specified in the documentation to acheive its purpose.

Possible Solution

Update the givewp.com documentation or to deprecate the give_view_order_details_billing_after hook.

Tasks

DevinWalker commented 6 years ago

Hey @Psypher9 - Apologies for the confusion. We were documenting the near future. See this post for details: https://developers.givewp.com/2018/03/19/legacy-hooks-being-deprecated-within-2-0-7/

2.0.7 will be out shortly so you may want to use the new hooks depending on your needs.