PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.17.0
GiveWP – Donation Plugin and Fundraising Platform v4.17.0
4.17.0 4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 All 256 releases
← All changes | src/DonorDashboards/Helpers.php +4 -2 4.16.7.1 → 4.17.0 View file →
@@ -1,9 +1,8 @@
1 1 <?php
2 2
3 3 namespace Give\DonorDashboards;
4 4
5 -use Give\Donors\Models\Donor;
6 5 use WP_User;
7 6
8 7 /**
9 8 * @since 2.10.0
@@ -12,8 +11,9 @@
12 11 {
13 12
14 13 /**
15 14 * Retrieve the current donor ID from based on session
15 + * @since 4.16.8.1 Guard against get_donor_by() finding no matching donor for the token's email.
16 16 * @since 2.10.0
17 17 */
18 18 public static function getCurrentDonorId()
19 19 {
@@ -30,9 +30,11 @@
30 30
31 31 if ($useToken) {
32 32 $donor = give()->donors->get_donor_by('email', give()->email_access->token_email);
33 33
34 - return $donor->id;
34 + if ($donor) {
35 + return $donor->id;
36 + }
35 37 }
36 38 }
37 39
38 40 return null;