From 3515a6eef16b10fdf1919f1a330786040758d619 Mon Sep 17 00:00:00 2001 From: Kelly Dwan Date: Fri, 22 Nov 2019 15:44:28 -0500 Subject: [PATCH] Check `pledge_id` to prevent returning all contributors --- plugins/wporg-5ftf/includes/contributor.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/wporg-5ftf/includes/contributor.php b/plugins/wporg-5ftf/includes/contributor.php index 8bc5177..83d1647 100644 --- a/plugins/wporg-5ftf/includes/contributor.php +++ b/plugins/wporg-5ftf/includes/contributor.php @@ -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' );