Skip to content

Instantly share code, notes, and snippets.

View techjewel's full-sized avatar
🎯
Focusing

Shahjahan Jewel techjewel

🎯
Focusing
View GitHub Profile
@techjewel
techjewel / fluentcrm-contact-check-ff-email-validation.php
Created January 13, 2026 15:04
A Simple Code Snippet to check if the provided email in FluentForms submission is a CRM contact and is in a block lists tags.
<?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
@techjewel
techjewel / affwp_pretty_links_to_fluent_affiliate.php
Created September 10, 2025 12:21
Code Snippet to support old affiliateWP Pretty links to FluentAffiliate
@techjewel
techjewel / fcrm_contact_count.php
Created January 25, 2024 14:57
get contact count by tag ids
<?php
/*
* FluentCRM get contact count by tag ids
* Example Usage: fcrmGetContactCountByTagIds([1,2,4]);
* @param array $tagIds
* @return int
*/
function fcrmGetContactCountByTagIds($tagIds = [])
{
@techjewel
techjewel / woo-filter-by-payment-gateway.php
Last active December 21, 2023 05:26
Filter WooCommerce orders by payment gateway
<?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
<?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
@techjewel
techjewel / atarim-support-for-fluent-crm.php
Created November 17, 2022 14:19
Atarim Support For FluentCRM
<?php
add_filter('fluent_crm_asset_listed_slugs', function ($slugs) {
$slugs[] = '\/atarim-visual-collaboration\/';
return $slugs;
});
@techjewel
techjewel / fluent-forms-title-to-form-html.php
Last active October 20, 2022 00:39
Add name Attributes to Fluent Forms HTML attributes
<?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);
@techjewel
techjewel / fluent-form-landing-slug.php
Last active December 19, 2024 14:16
Custom Fluent Forms Conversational Form Landing Page Slug
<?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);
@techjewel
techjewel / fluent_form_user_role_change.php
Created January 4, 2022 17:25
Change User Role on Fluent Forms Submission
<?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;
<?php
add_action('admin_menu', function () {
global $menu;
foreach ($menu as $index => $menuItem) {
if(!empty($menuItem[2]) && $menuItem[2] == 'ninja_tables') {
$menu[$index][0] = 'My Tables';
}
}
}, 100);