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: improve return value of Give_Donate_Form::get_goal()
#4020
Comments
Hey @andrewminion-luminfire thanks for the request. We're going to take a look at that return value and improve it in Give 2.4.2. |
false
if the goal is not enabled.Give_Donate_Form()->get_goal()
Give_Donate_Form()->get_goal()
Give_Donate_Form::get_goal()
Slack Chat Summary Participants: @DevinWalker @kevinwhoffman @ravinderk This is still open for discussion whether we can create |
Adding Returning only strings from |
fix: improve return value of `Give_Donate_Form::get_goal()` #4020
Bug Report
User Story
As a developer, I want
Give_Donate_Form
’sget_goal()
method to returnfalse
if the goal is disabled for a form so that I can use it to determine whether a goal is set without usingget_post_meta( $form_id, '_give_goal_option', true )
.Current Behavior
Currently,
get_goal()
returns the meta value for_give_set_goal
regardless of whether the goal is enabled or not. By default, the value is1.000000
. A default goal of $1.00 is unlikely but possible.Expected Behavior
In my opinion,
get_goal()
should first check to see if the goal is enabled and if not, returnfalse
.Bug Type
Steps to Reproduce
Possible Solution
Add a a check to see if the goal is set or not.
Acceptance Criteria
get_goal()
should return the goal.get_goal()
should return false, not the default value of1.000000
The text was updated successfully, but these errors were encountered: