You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The output is echoed, causing several problems. This is especially a major issue for the REST API as it breaks entire responses, since HTML is printed out before the actual JSON response.
Possible Solution
In the above linked area, the two lines should not echo the information, but instead append it to a variable and then return it.
Steps to Reproduce (for bugs)
To see how that bug breaks the REST API, access the wp/v2/pages endpoint for the page that is currently set to host the donation history.
The text was updated successfully, but these errors were encountered:
That would be a possibility, but I think not using echo and instead appending to a variable and returning that is more efficient. Such as:
$output = apply_filters( 'give_donation_history_nonuser_message', give_output_error( __( 'You must be logged in to view your donation history. Please login using your account or create an account using the same email you used to donate with.', 'give' ), false ) );
$output .= do_shortcode( '[give_login]' );
return $output;
Issue Overview
Currently the
give_donation_history()
function for the shortcode may print output directly (see https://github.com/WordImpress/Give/blob/master/includes/shortcodes.php#L62), however shortcodes should never do that, they must always return their output.Expected Behavior
The output should be returned instead of echoed.
Current Behavior
The output is echoed, causing several problems. This is especially a major issue for the REST API as it breaks entire responses, since HTML is printed out before the actual JSON response.
Possible Solution
In the above linked area, the two lines should not echo the information, but instead append it to a variable and then return it.
Steps to Reproduce (for bugs)
To see how that bug breaks the REST API, access the
wp/v2/pages
endpoint for the page that is currently set to host the donation history.The text was updated successfully, but these errors were encountered: