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 process_file_download() { | |
if( ! isset( $_GET['ifs_download'] ) || empty( $_GET['ifs_download'] ) || ! is_user_logged_in() ) { | |
return; | |
} | |
$file_id = $_GET['ifs_download']; |
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 | |
// Prevents data from syncing to CRM for users with the role "subscriber" | |
function block_updates_by_role( $user_meta, $user_id ) { | |
$user = get_user_by( 'id', $user_id ); | |
if ( in_array( 'subscriber', (array) $user->roles ) ) { | |
return false; |
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 | |
/* | |
Plugin Name: WP Fusion - WooCommerce Coupon Sync | |
Description: Syncs a coupon used at checkout to a custom field on the contact record | |
Plugin URI: https://verygoodplugins.com/ | |
Version: 1.0 | |
Author: Very Good Plugins | |
Author URI: https://verygoodplugins.com/ | |
*/ |
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 | |
// Use first name and lastname as the username | |
function wpf_use_names_as_logins( $user_meta ) { | |
$user_meta['user_login'] = strtolower( $user_meta['first_name'] . $user_meta['last_name'] ); | |
return $user_meta; |
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 add_sf_instance_url( $settings ) { | |
$settings['sf_instance_url'] = array( | |
'title' => 'Instance URL', | |
'desc' => '', | |
'std' => '', | |
'type' => 'text', | |
'section' => 'setup' |
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 wpf_email_notify( $timestamp, $level, $user, $message, $source, $context ) { | |
if( $level == 'error' ) { | |
wp_mail( 'youremail@example.com', 'WP Fusion API Error', 'Error message: ' . $message . ' for user ID ' . $user ); | |
} |
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 unlock_for_fb_referral( $can_access, $user_id, $post_id ) { | |
if( isset( $_SERVER['HTTP_REFERER'] ) && strpos( $_SERVER['HTTP_REFERER'], 'facebook') !== false ) { | |
return true; | |
} | |
return $can_access; |
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 set_object_type( $object_type ) { | |
return 'Leads'; | |
} | |
add_filter( 'wpf_crm_object_type', 'set_object_type' ); |