-
+
diff --git a/adminpages/report-csv.php b/adminpages/report-csv.php
index 08b96d2..c7edae0 100644
--- a/adminpages/report-csv.php
+++ b/adminpages/report-csv.php
@@ -63,6 +63,13 @@
'total',
);
+ /**
+ * Filter the headings for the CSV export.
+ *
+ * @param array $headings The headings for the CSV export.
+ *
+ * @return array The modified headings.
+ */
$headings = apply_filters( 'pmpro_affiliate_list_csv_extra_columns', $headings ); // Add to the string.
echo implode( ',', $headings ) . "\n";
@@ -84,6 +91,14 @@
pmpro_enclose( $order->total ),
);
+ /**
+ * Filter the data for the CSV export.
+ *
+ * @param array $pmpro_affiliate_report_data The data for the CSV export.
+ * @param object $order The order object.
+ * @param object $level The membership level object.
+ * @return array The modified data.
+ */
$pmpro_affiliate_report_data = apply_filters( 'pmpro_affiliate_list_csv_extra_column_data', $pmpro_affiliate_report_data, $order, $level );
echo implode( ',', $pmpro_affiliate_report_data ) . "\n";
diff --git a/adminpages/report.php b/adminpages/report.php
index 12ad6f3..1971256 100644
--- a/adminpages/report.php
+++ b/adminpages/report.php
@@ -96,7 +96,12 @@
-
+
@@ -156,7 +161,14 @@
total * $order->commissionrate ); ?>
total ); ?>
order_id ) . '">' . $affiliate_paid . ''; // We escape the $affiliate_paid before outputting further up.?>
-
+
id );
$code = pmpro_affiliates_getNewCode();
if ( ! empty( $pmpro_create_affiliate_level ) ) {
+ /**
+ * Filter the number of days to set the cookie for the affiliate.
+ *
+ * @param int $days The number of days to set the cookie for the affiliate.
+ * @param int $user_id The user ID.
+ * @param object $pmpro_level The membership level object.
+ * @return int The number of days to set the cookie for the affiliate.
+ */
$days = intval( apply_filters( 'pmproaf_default_cookie_duration', 30, $user_id, $pmpro_level ) );
$sqlQuery = "INSERT INTO $wpdb->pmpro_affiliates (code, name, affiliateuser, trackingcode, cookiedays, enabled) VALUES('" . esc_sql( $code ) . "', '" . esc_sql( $user->display_name ) . "', '" . esc_sql( $user->user_login ) . "', '', $days, '1')";
$wpdb->query( $sqlQuery );