PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.7.0
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.7.0
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 / addons / charitable-recipients / charitable-recipients-functions.php

charitable-recipients-functions.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.7.0, at includes/addons/charitable-recipients/charitable-recipients-functions.php

60 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Charitable Recipients Functions.
5 *
6 * @package Charitable/Functions/Recipients
7 * @author David Bisset
8 * @copyright Copyright (c) 2022, WP Charitable LLC
9 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
10 * @since 1.0.0
11 * @version 1.0.0
12 */
13
14 // Exit if accessed directly.
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit;
17 }
18
19 /**
20 * Registers a recipient type.
21 *
22 * @since 1.0.0
23 *
24 * @param string $recipient_type The ID of the recipient type we're registering.
25 * @param array $args Set of arguments defining that recipient type.
26 * @return void
27 */
28 function charitable_register_recipient_type( $recipient_type, $args = array() ) {
29 Charitable_Recipient_Types::get_instance()->register( $recipient_type, $args );
30 }
31
32 /**
33 * Returns the registered recipient types.
34 *
35 * @since 1.0.0
36 *
37 * @return array
38 */
39 function charitable_get_recipient_types() {
40 return Charitable_Recipient_Types::get_instance()->get_types();
41 }
42
43 /**
44 * Returns a given recipient type, or false if the recipient type is not registered.
45 *
46 * @since 1.0.0
47 *
48 * @param string $recipient_type The recipient type we want to retrieve.
49 * @return array|false
50 */
51 function charitable_get_recipient_type( $recipient_type ) {
52 $recipient_types = charitable_get_recipient_types();
53
54 if ( ! array_key_exists( $recipient_type, $recipient_types ) ) {
55 return false;
56 }
57
58 return $recipient_types[ $recipient_type ];
59 }
60