Skip to content

Instantly share code, notes, and snippets.

View codelion7's full-sized avatar

Christian Freeman codelion7

  • Team Extreme
  • United States
View GitHub Profile
@codelion7
codelion7 / gist:e6a7ad69cb76b09be7b06d1b74d92921
Created March 5, 2021 17:36
Add the Affiliate's Email Address to the Affiliate Data Dropdown in the Tree View (AffiliateWP MLM)
// Run if AffiliateWP MLM is Active
if ( class_exists( 'AffiliateWP_Multi_Level_Marketing' ) ) {
/**
* Adds Affiliate URL to Affiliate Data from the Sub Affiliates Tooltip (Downline Only)
*
* @since 1.1.6
* @return array
*/
function affwp_mlm_add_email_aff_data( $aff_data = array(), $affiliate_id = 0, $disabled_aff_data = array() ) {
@codelion7
codelion7 / add_aff_url.php
Last active March 31, 2022 20:19
Add Affiliate URL to Sub Affiliate Data in Tree View
// Run if AffiliateWP MLM is Active
if ( class_exists( 'AffiliateWP_Multi_Level_Marketing' ) ) {
/**
* Adds Affiliate URL to Affiliate Data from the Sub Affiliates Tooltip (Downline Only)
*
* @since 1.1.6
* @return array
*/
function affwp_mlm_add_url_aff_data( $aff_data = array(), $affiliate_id = 0, $disabled_aff_data = array() ) {
@codelion7
codelion7 / dashboard-tab-bonuses.php
Last active October 14, 2020 18:53
Add CSS Styles Inline for the Bonuses Tab of the Affiliate Area
<?php
$affiliate_id = affwp_get_affiliate_id();
$bonuses = get_active_bonuses();
$bonus_count = count( $bonuses );
// Run if AffiliateWP Ranks is Active
if ( class_exists( 'AffiliateWP_Ranks' ) ) {
$ranks = get_ranks();
}
@codelion7
codelion7 / kbs-edd-fes.php
Last active May 19, 2020 21:40
Auto-Assign KB Support Ticket to EDD FES Vendor, based on the Download/Product Submitted
<?php
if ( class_exists( 'KB_Support' ) ) {
/**
* Allow Vendors to Manage Tickets (Make them Support Agents)
*
* @since 1.0
* @return array
*/
@codelion7
codelion7 / affiliatewp-customization-cycles.php
Last active April 10, 2020 18:08
Require a Specific Rank & Product Purchase to Start a New Cycle
// Make sure AffiliateWP is active
if ( function_exists( 'affiliate_wp' ) ) {
// Make sure AffiliateWP MLM is active
//if ( ! class_exists( 'AffiliateWP_Multi_Level_Marketing' ) ) return;
/**
* Require a Specific Rank & Product Purchase to Start a New Cycle
*
* @since 1.0
@codelion7
codelion7 / hide-invite-code.css
Created April 17, 2019 17:04
Hide Invite Code in Affiliate Area - AffiliateWP Invites
#affwp-affiliate-dashboard-invites .affwp-invites-aff-invite-code-header,
#affwp-affiliate-dashboard-invites .affwp-invites-aff-invite-code,
#affwp-affiliate-dashboard-invites .affwp-invites-aff-invite-code-message {display:none;}
@codelion7
codelion7 / affwp_referrals_export_parent_column.php
Last active October 25, 2018 21:22
Add Parent Affiliate Column to Referrals Export
<?php
/**
* Add new column to the exported referrals CSV file for the affiliate's Parent
*/
function affwp_mlm_export_referrals_csv_cols( $cols ) {
$cols['parent_name'] = 'Parent Affiliate';
return $cols;
}
@codelion7
codelion7 / vendor_can_add_product.php
Created October 18, 2017 16:48
Add a filter to the product limit
/**
* Allowed WooCommerce Post Types
*
* @return bool
* @since 1.2.0
* @author Andrea Grillo <andrea.grillo@yithemes.com>
*/
public function vendor_can_add_products( $vendor, $post_type ){
$enable_amount = 'yes' == get_option( 'yith_wpv_enable_product_amount' ) ? true : false;
if( $enable_amount && 'product' == $post_type ){
@codelion7
codelion7 / non-parent-rate.php
Last active October 17, 2017 09:08
AffiliateWP MLM - Apply a 30% Direct Commission Rate for Affiliates without Sub Affiliates
/**
* Apply a 30% direct commission rate for affiliates without Sub Affiliates
*/
function affwp_mlm_get_non_parent_rate( $rate, $affiliate_id, $type, $reference ) {
// If a per-affiliate rate is set, use that
if ( affiliate_wp()->affiliates->get_column( 'rate', $affiliate_id ) ) {
return $rate;
}
@codelion7
codelion7 / mlm-remove-downline-data.php
Created August 23, 2017 15:44
Removes Specific MLM Affiliate Data from the Sub Affiliates Tooltip (Downline Only)
// Run if AffiliateWP MLM is Active
if ( class_exists( 'AffiliateWP_Multi_Level_Marketing' ) ) {
/**
* Removes Specific MLM Affiliate Data from the Sub Affiliates Tooltip (Downline Only)
*
* @since 1.1.1
* @return array
*/
function affwp_mlm_remove_downline_aff_data( $aff_data = array(), $affiliate_id = 0 ) {