Check pledge_id to prevent returning all contributors

This commit is contained in:
Kelly Dwan 2019-11-22 15:44:28 -05:00
parent b1b2ba9732
commit 3515a6eef1
No known key found for this signature in database
GPG key ID: 8BA5575F3D11575D

View file

@ -248,6 +248,9 @@ function get_pledge_contributors( $pledge_id, $status = 'publish', $contributor_
* @return array An array of contributor data, ready to be used in the JS templates.
*/
function get_pledge_contributors_data( $pledge_id ) {
if ( ! $pledge_id ) {
return array();
}
$contrib_data = array();
$contributors = get_pledge_contributors( $pledge_id, 'all' );