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 this code to your theme's functions.php file | |
function custom_raf_popup() { | |
// Check if the URL contains the 'raf' query parameter | |
if (isset($_GET['raf'])) { | |
// Add popup HTML, CSS, and JS to footer | |
add_action('wp_footer', 'custom_popup_html'); | |
} |
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 | |
// Exit if accessed directly | |
if (!defined('ABSPATH')) { | |
exit; | |
} | |
add_action('rest_api_init', 'register_withreach_webhook_endpoint'); | |
function register_withreach_webhook_endpoint() { | |
register_rest_route('withreach/v1', '/webhook', array( |
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 save user meta when a user registers | |
add_action('user_register', 'save_source_tracker_user_meta', 10, 1); | |
function save_source_tracker_user_meta($user_id) { | |
$disabled = get_option('wpgens_st_disable'); | |
if ($disabled) { | |
return; |
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 | |
function save_source_tracker_meta($order_id) | |
{ | |
$disabled = get_option('wpgens_st_disable'); | |
if ($disabled) { | |
return; | |
} |
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( 'woocommerce_before_calculate_totals', 'wpgens_auto_apply_coupons_and_add_product', 10, 1 ); | |
function wpgens_auto_apply_coupons_and_add_product( $cart ) { | |
if ( is_admin() && ! defined( 'DOING_AJAX' ) ) | |
return; | |
if ( did_action( 'woocommerce_before_calculate_totals' ) >= 2 ) | |
return; | |
if(!is_user_logged_in()) | |
return; |
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 | |
class WPGens_RAF_Email | |
{ | |
private $email; | |
private $coupon_code; | |
private $name; |
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 (!bwfan_is_autonami_pro_active() || version_compare(BWFAN_PRO_VERSION, '2.0.3', '>=')) { | |
class BWFAN_Contact_Referral_ID extends BWFAN_Merge_Tag { | |
private static $instance = null; | |
public function __construct() { | |
$this->tag_name = 'contact_referral_id'; | |
$this->tag_description = __('Contact Referral ID', 'wp-marketing-automations'); |
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('init', 'generate_coupon_manually'); | |
function generate_coupon_manually() { | |
if (isset($_GET['generate_once']) && $_GET['generate_once'] == 'true') { | |
// Check if admin | |
if (!current_user_can('manage_options')) { | |
wp_die('You do not have permission to access this page.'); | |
} |
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('wpgens_raf_new_user_referral_id', 'process_new_user_referral', 10, 2); | |
function process_new_user_referral($referral_id, $user_id) { | |
// Get user data | |
$user = get_userdata($user_id); | |
$email = $user->user_email; | |
// Send to Klaviyo |
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; // Exit if accessed directly | |
/** | |
* @param $order_get_id | |
* hook to thank you page referer plugin | |
* @@@ codja | |
*/ | |
function cj_action_woocommerce_thankyou($order_get_id) | |
{ | |
if (class_exists('WPGens_RAF')) { |