← All changes
|
includes/admin/emails/class-email-access-email.php
+3
-8
4.15.1
→
4.17.0
View file →
| @@ -256,8 +256,9 @@ | ||
| 256 | 256 | * |
| 257 | 257 | * @param int $donor_id Donor ID. |
| 258 | 258 | * @param string $email Donor Email. |
| 259 | 259 | * |
| 260 | + * @since 4.16.1 Return false instead of wp_die when donor is not found. | |
| 260 | 261 | * @since 2.0 |
| 261 | 262 | * @access public |
| 262 | 263 | * |
| 263 | 264 | * @return bool |
| @@ -264,16 +265,10 @@ | ||
| 264 | 265 | */ |
| 265 | 266 | public function setup_email_notification( $donor_id, $email ) { |
| 266 | 267 | $donor = Give()->donors->get_donor_by( 'email', $email ); |
| 267 | 268 | |
| 268 | - if ( ! $donor->id ) { | |
| 269 | - wp_die( | |
| 270 | - esc_html__( 'Cheatin’ uh?', 'give' ), | |
| 271 | - esc_html__( 'Error', 'give' ), | |
| 272 | - array( | |
| 273 | - 'response' => 400, | |
| 274 | - ) | |
| 275 | - ); | |
| 269 | + if ( ! is_object( $donor ) || ! $donor->id ) { | |
| 270 | + return false; | |
| 276 | 271 | } |
| 277 | 272 | |
| 278 | 273 | $this->recipient_email = $email; |
| 279 | 274 | |