This file contains hidden or 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 | |
| /** | |
| * A Simple Code Snippet to check if the provided email in FluentForms submission is a CRM contact and is in a block lists tags. | |
| * If yes, then it will reject the form submission | |
| */ | |
| add_filter('fluentform/validate_input_item_email', function ($error, $field, $formData) { | |
| if ($error || !defined('FLUENT_CRM')) { | |
| return $error; // already an error or FLUENTCRM is not activated |
This file contains hidden or 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 | |
| /** | |
| * Code Snippet to support old affiliateWP Pretty links to FluentAffiliate | |
| * This will check if the URL contains /partner/{referral_code} and will convert it to ?ref={referral_code} | |
| * where 'ref' (or new variable) is the query variable that you had set in FluentAffiliate settings. | |
| */ | |
| add_action('wp', function () { | |
| if (!defined('FLUENT_AFFILIATE_DIR')) { | |
| return; |
This file contains hidden or 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 | |
| /* | |
| * FluentCRM get contact count by tag ids | |
| * Example Usage: fcrmGetContactCountByTagIds([1,2,4]); | |
| * @param array $tagIds | |
| * @return int | |
| */ | |
| function fcrmGetContactCountByTagIds($tagIds = []) | |
| { |
This file contains hidden or 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 // do not include this line in FluentSnippets | |
| add_action('woocommerce_order_list_table_restrict_manage_orders', function($type) { | |
| if ( 'shop_order' !== $type ) { | |
| return; | |
| } | |
| // get all payment methods, even inactive ones |
This file contains hidden or 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 | |
| /* | |
| * This snippet is assuming the user already logged in or the provided email address is available in users | |
| * After the form submission the user will be added to the course. | |
| */ | |
| add_action( 'fluentform_submission_inserted', 'ff_register_user_to_learndash_course', 100, 3 ); | |
| function ff_register_user_to_learndash_course( $entryId, $formData, $form ) { | |
| // Check if the form is the one we want |
This file contains hidden or 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('fluent_crm_asset_listed_slugs', function ($slugs) { | |
| $slugs[] = '\/atarim-visual-collaboration\/'; | |
| return $slugs; | |
| }); |
This file contains hidden or 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 Title Attributes to Fluent Forms | |
| */ | |
| add_filter('fluent_form_html_attributes', function ($atts, $form) { | |
| $atts['name'] = esc_attr($form->title); | |
| return $atts; | |
| }, 10, 2); |
This file contains hidden or 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 | |
| /* | |
| * Internal Function for Fluent Forms Custom Slug | |
| * Do not EDIT this function | |
| */ | |
| function customFfLandingPageSlug($slug) | |
| { | |
| add_action('init', function () use ($slug) { | |
| add_rewrite_endpoint($slug, EP_ALL); |
This file contains hidden or 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('fluentform_submission_inserted', function ($insertId, $formData, $form) { | |
| if($form->id != 23) { // 23 is your target form id | |
| return; | |
| } | |
| $userId = get_current_user_id(); | |
| if(!$userId) { | |
| return; |
NewerOlder