PluginProbe
AutomatorWP – No-Code Workflow Automation, Integration & Webhooks Plugin, now with AI / 6.0.3
AutomatorWP – No-Code Workflow Automation, Integration & Webhooks Plugin, now with AI v6.0.3
6.0.3 6.0.2 6.0.1 6.0.0 5.8.6 5.8.5 5.8.4 5.8.3 5.8.2 5.8.1 5.8.0 5.7.9.2 5.7.9.1 5.7.8 5.7.9 5.7.6 5.7.7 5.7.5 5.7.4 5.7.3 5.7.2 5.7.1 trunk 5.6.0 5.6.1 All 34 releases
automatorwp / integrations / affiliatepress / includes / functions.php

functions.php in AutomatorWP – No-Code Workflow Automation, Integration & Webhooks Plugin, now with AI 6.0.3, at integrations/affiliatepress/includes/functions.php

48 lines 1.1 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 AutomatorWP\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 automatorwp_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 automatorwp_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
48