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 | includes/donors/backward-compatibility.php +4 -3 2.3.1 → 4.17.0 View file →
@@ -1,8 +1,9 @@
1 1 <?php
2 2 /**
3 3 * Get donor address from donor meta instead of user meta
4 4 *
5 + * @since 4.9.0 rename function - PHP 8 compatibility
5 6 * @since 2.0
6 7 *
7 8 * @param $meta_value
8 9 * @param $user_id
@@ -10,14 +11,14 @@
10 11 * @param $single
11 12 *
12 13 * @return string|array
13 14 */
14 -function __give_v20_bc_user_address( $meta_value, $user_id, $meta_key, $single ) {
15 +function give_v20_bc_user_address( $meta_value, $user_id, $meta_key, $single ) {
15 16 if (
16 17 give_has_upgrade_completed( 'v20_upgrades_user_address' ) &&
17 18 '_give_user_address' === $meta_key
18 19 ) {
19 - $meta_value = give_get_donor_address( $user_id );
20 + $meta_value = give_get_donor_address( $user_id, array( 'by_user_id' => true ) );
20 21
21 22 if ( $single ) {
22 23 $meta_value = array( $meta_value );
23 24 }
@@ -25,5 +26,5 @@
25 26
26 27 return $meta_value;
27 28 }
28 29
29 -add_filter( 'get_user_metadata', '__give_v20_bc_user_address', 10, 4 );
30 +add_filter( 'get_user_metadata', 'give_v20_bc_user_address', 10, 4 );