PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / trunk
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More vtrunk
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | stripe/helpers/FrmTransLiteAppHelper.php +14 -1 6.32.1 → trunk View file →
@@ -361,9 +361,22 @@
361 361 *
362 362 * @return int
363 363 */
364 364 public static function get_user_id_for_current_payment() {
365 - return is_user_logged_in() ? get_current_user_id() : 0;
365 + $user_id = is_user_logged_in() ? get_current_user_id() : 0;
366 +
367 + /**
368 + * Set the user who owns the payment being made.
369 + * This makes it possible for an add on to claim the payment for a user who isn't logged in yet,
370 + * for example when the same submission registers them.
371 + *
372 + * @since 6.35
373 + *
374 + * @param int $user_id The logged in user, or 0 for a guest.
375 + */
376 + $user_id = (int) apply_filters( 'frm_payment_user_id', $user_id );
377 +
378 + return max( 0, $user_id );
366 379 }
367 380
368 381 /**
369 382 * @param int $user_id