PluginProbe
GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI / 7.9.8
GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI v7.9.8
8.0.4 8.0.3 8.0.1 8.0.2 8.0.0 7.9.9.7 7.9.9.6 7.9.9.5 7.9.9.4 7.9.9.3 7.9.9.2 7.9.9.1 7.9.9 7.9.8 7.9.7 7.9.6 7.9.5 7.9.4 7.9.3 7.9.2 7.9.1 7.9.0 7.8.9 7.8.8 7.8.7 All 46 releases
gamipress / integrations / affiliatepress / includes / functions.php

functions.php in GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI 7.9.8, at integrations/affiliatepress/includes/functions.php

47 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Functions
4 *
5 * @package GamiPress\Integrations\AffilatePress
6 * @since 1.0.0
7 */
8
9 // Exit if accessed directly
10 if ( ! defined( 'ABSPATH' ) ) exit;
11
12 /**
13 * Get WordPress user ID by affiliate ID
14 *
15 * @since 1.0.0
16 *
17 * @param int $affiliate_id
18 */
19 function gamipress_affiliatepress_get_user_id ( $affiliate_id ) {
20
21 global $wpdb;
22
23 $table_name = $wpdb->prefix . 'affiliatepress_affiliates';
24 $user_id = $wpdb->get_var( $wpdb->prepare( "SELECT ap_affiliates_user_id FROM $table_name WHERE ap_affiliates_id = %d", $affiliate_id ) );
25
26 return $user_id;
27
28 }
29
30 /**
31 * Get affiliate ID by payout ID
32 *
33 * @since 1.0.0
34 *
35 * @param int $payout_id
36 */
37 function gamipress_affiliatepress_get_affiliate_id_by_payout ( $payout_id ) {
38
39 global $wpdb;
40
41 $table_name = $wpdb->prefix . 'affiliatepress_payouts';
42 $affiliate_id = $wpdb->get_var( $wpdb->prepare( "SELECT ap_payout_selected_affiliate FROM $table_name WHERE ap_payout_id = %d", $payout_id ) );
43
44 return $affiliate_id;
45
46 }
47