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
340 stars 191 forks source link

Improve ways to query donors from database #2101

Closed DevinWalker closed 6 years ago

DevinWalker commented 6 years ago

Issue Overview

I was having trouble properly sorting based on donor's metadata while working on https://github.com/WordImpress/Give-Gift-Aid/issues/56 and https://github.com/WordImpress/Give-Gift-Aid/issues/57

I was attempting to use $donors = Give()->donors->get_donors(); but unfortunately the args you can pass into it are limited.

Expected Behavior

Developers can more easily query donors with flexibility.

Current Behavior

It is very limited.

Possible Solution

I noticed EDD now has https://github.com/easydigitaldownloads/easy-digital-downloads/blob/master/includes/class-edd-customer-query.php now which was seemingly developed out of the same frustration.

mathetos commented 6 years ago

This is awesome. Great work!

These would make for some easy shortcodes as well: https://developers.givewp.com/2017/10/11/give-1-8-14-introducing-new-give_donors_query-class/