PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.3.2
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.3.2
1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 1.7.0.9 1.8.0 All 210 releases
charitable / includes / users / charitable-user-functions.php

charitable-user-functions.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.3.2, at includes/users/charitable-user-functions.php

36 lines 926 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Charitable User Functions.
5 *
6 * User related functions.
7 *
8 * @package Charitable/Functions/User
9 * @version 1.0.0
10 * @author Eric Daams
11 * @copyright Copyright (c) 2015, Studio 164a
12 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
13 */
14
15 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
16
17 /**
18 * Returns a Charitable_User object for the given user.
19 *
20 * This will first attempt to retrieve it from the object cache to prevent duplicate objects.
21 *
22 * @param int $user_id
23 * @param boolean $foce
24 * @return Charitable_User
25 * @since 1.0.0
26 */
27 function charitable_get_user( $user_id, $force = false ) {
28 $user = wp_cache_get( $user_id, 'charitable_user', $force );
29
30 if ( ! $user ) {
31 $user = new Charitable_User( $user_id );
32 wp_cache_set( $user_id, $user, 'charitable_user' );
33 }
34
35 return $user;
36 }