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 | |
// Deletes WordPress user when the tag "REMOVE USER" is applied. | |
// Works when a webhook is received or during a batch Resync Tags operation is run. | |
// USE WITH CAUTION. | |
function my_wpf_delete_user( $user_id, $user_tags ) { | |
if ( wp_fusion()->user->has_tag( 'REMOVE USER', $user_id ) && ! user_can( $user_id, '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
<?php | |
function custom_awp_url($url) { | |
$user_meta = wp_get_current_user(); | |
$user_email = $user_meta->user_email; | |
$url = $url . '?leadsource=' . urlencode($user_email); |
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('wpf_user_can_access', 'my_wpf_flip_access_rules', 10, 3); | |
function my_wpf_flip_access_rules( $can_access, $user_id, $post_id ) { | |
// Optional: limit the rule flipping just to certain post IDs (1234 and 4567) | |
if( $post_id != 1234 ) { | |
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 wpf_alt_shortcode() { | |
if( ! is_admin() ) { | |
$wpf_shortcodes = new WPF_Shortcodes; | |
add_shortcode( 'wpf2', array( $wpf_shortcodes, 'shortcodes' ) ); | |
} | |
} |
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: AC Account Switch | |
Description: Switches AC API credentials for WP Fusion depending on user role | |
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 | |
// Put your intercom access token here | |
define( 'INTERCOM_ACCESS_TOKEN', 'aG9tOjyIyZmMxZDc2X2YxMzBfNDBhZV9hOTVjXzRhZDRlNzBiZWMyMzoxOjA=' ); | |
// We'll save the alternate CRM in a global so it can be re-used if multiple API calls need to be made in the same request | |
global $intercom; | |
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 | |
// Deletes user meta fields if the data loaded from the CRM is missing or empty | |
function wpf_remove_empty_meta_fields( $user_id, $user_meta ) { | |
$contact_fields = wp_fusion()->settings->get( 'contact_fields' ); | |
foreach ( $contact_fields as $field_id => $field_data ) { |
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 my_gform_after_submission( $entry, $form ) { | |
// Gets the first name and last name from field ID 3, and email from field ID 4 | |
$contact_data = array( | |
'FirstName' => rgar( $entry, '3.3' ), | |
'LastName' => rgar( $entry, '3.6' ), | |
'Email' => rgar( $entry, '4' ) | |
); |
OlderNewer