impress-org / givewp-snippet-library

A collection of code snippets to enhance or expand on the free Give WordPress Donation Plugin.
https://givewp.com
140 stars 90 forks source link

Create start-date-for-give-totals-shortcode.php #123

Closed jr70 closed 3 years ago

jr70 commented 3 years ago

Adds start_date option and {start_date} message placeholder to [give_totals] shortcode.

Resolves # https://feedback.givewp.com/feature-requests/p/date-filter-for-the-progress-bar

Review requested.

Description

Currently the '[give_totals]' shortcode sums all the donations ever received (filtered by form id, category or tag if set). This snippet allows the user to add a 'start_date' option so only donations since that date are totalled and displayed. This means users can, for example, set a goal for the amount to raise this year and show: "So far this year we've raised $xxx thanks to our generous donors." or, with the '{start_date}' message placeholder: "Since 1 January 2021 we've raised...".

Affects

[give_totals] shortcode

Visuals

Testing Instructions

Pre-review Checklist

Hi! I'm not a developer - I just write code snippets from time to time when I need them - and I'm not yet very familiar with GitHub so I may have submitted all this incorrectly. If so, please accept my apologies; any guidance on how to do it properly would be appreciated. I've tried to follow the documented procedures I can find so if you get this, I hope it's useful!