This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('wpgens_raf_code','gens_raf_code',10,1); | |
function gens_raf_code($raf_code) { | |
if( !current_user_can('manage_options')) { | |
return 'Referral code is available only to Editors'; | |
} | |
return $raf_code; | |
} | |
add_filter('wpgens_raf_link','gens_raf_link',10,3); | |
function gens_raf_link($raf_link, $referral_id, $type) { | |
if( !current_user_can('manage_options')) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Custom_RAF_Status | |
{ | |
/** | |
* Hook in order meta boxes and save order meta | |
* | |
* @since 2.0.0 | |
*/ | |
public function __construct() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('user_register', 'wpgens_generate_referral_reward', 10, 1); | |
function wpgens_generate_referral_reward($user_id) | |
{ | |
if (isset($_COOKIE["gens_raf"])) { | |
global $wpdb; | |
$results = $wpdb->get_results($wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key='gens_referral_id' AND meta_value = %s", sanitize_text_field($_COOKIE["gens_raf"]))); | |
if (!empty($results)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
wpcf7_add_form_tag( 'gens_raf_advance', 'wpcf7_wpgens_form_tag_handler', | |
array( | |
'url-attr' => true | |
) | |
); | |
function wpcf7_wpgens_form_tag_handler( $tag ){ | |
$url = $tag['url']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!defined('ABSPATH')) | |
exit; | |
class AWDP_Api | |
{ | |
/** | |
* @var object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('gens_raf_coupon_amount','change_coupon_amount',10, 2); | |
function change_coupon_amount($amount,$order_id){ | |
// get number of referrals | |
$referrer_id = get_post_meta($order_id,'_wpgens_raf_id',true); | |
$user = reset(get_users(array('meta_key' => 'gens_referral_id', 'meta_value' => $referrer_id))); | |
$roles = $user->roles; | |
if(in_array('kol', $roles)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Email Body for Email Share | |
* | |
* @see http://wpgens.helpscoutdocs.com/article/34-how-to-edit-template-files-and-keep-them-after-plugin-update | |
* @version 2.0.0 | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; // Exit if accessed directly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#, fuzzy | |
msgid "" | |
msgstr "" | |
"Project-Id-Version: Refer a Friend for WooCommerce PREMIUM\n" | |
"POT-Creation-Date: 2019-06-12 09:38+0100\n" | |
"PO-Revision-Date: 2019-06-12 09:38+0100\n" | |
"Last-Translator: \n" | |
"Language-Team: \n" | |
"MIME-Version: 1.0\n" | |
"Content-Type: text/plain; charset=UTF-8\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Hook into checkout | |
* | |
* @since 2.0.0 | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Hook to Woo Tools to add buttons for missing rafs. | |
* @author WPGens | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} |