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 / Convert Numbers to Words - Bangladesh.php
Last active September 4, 2025 03:59
Convert Numbers to Words - for Bangladeshi counting system
<?php
/**
* Function: convert_number
*
* Description:
* Converts a given integer (in range [0..1T-1], inclusive) into
* alphabetical format ("one", "two", etc.)
*
* @int
*
@techjewel
techjewel / fluentform-submission-success.js
Last active August 21, 2025 03:57
Form submission success JS Event in Fluent Forms
// Event on form submission success
// You can paste this script to Form's custom JS Box
$form.on('fluentform_submission_success', function() {
// You can run your own JS and will be run on successful form submission
});
@techjewel
techjewel / fluentform-radio-as-button.css
Created May 25, 2020 23:10
Fluent Forms Radio as Buttons
// You can make the inline radio button look like button switch
// Steps:
// Add container class of the element "ff_button_style"
// Select Layout: Inline Layout
// Lastly add this css to custom css of the form
.ff-el-group.ff_list_inline.ff_button_style .ff-el-form-check {
background: #d2d2d2;
margin: 0 !important;
padding: 0 !important;
@techjewel
techjewel / event-for-all-forms.js
Created August 6, 2020 11:27
Track Google Analytics event for all fluent forms in your site
(function($){
if(typeof gtag != 'function') {
return;
}
var fluentForms = $('form.frm-fluent-form');
fluentForms.each(function() {
var $form = $(this);
var formId = $form.attr('data-form_id');
gtag('event', 'ViewForm', {
@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);
<?php
/*
* Code snippet to make login form with Fluent Forms WordPress Plugins
* Steps:
* 1. make a form with email and password (Make sure the name attribute is 'email' and 'password' for corresponding field)
* 2. Paste the shorcode in a page
* 3. Change the form id in the bellow code (23) with your created fluentform's form id and paste in your theme's functions.php file
* 4. That's it
*
@techjewel
techjewel / fluentform-checkbox-max-restriction.js
Last active August 22, 2024 20:46
prevent users to check max 3/x items from a checkbox group - Fluent Forms
/**
* Function to prevent users mark more than expected items.
* This code must need to be placed in custom JS of your form
* @param: containerClass String - The contaner class of the target checkbox block.
* You can add a custom container class in the form settings
*
* @param: maxChecked Integer - Max Number of items user can mark
* @return: void
*
*/
@techjewel
techjewel / CapFirstLetter.js
Created May 22, 2020 15:35
Capitalize First Letter of Name Input Field in Fluent Forms
/*
* Add this js snippet in Form's JS box
*/
function capitalizeFLetter() {
var $input = $form.find('.ff-name-field-wrapper').find('input');
$input.on('blur', function() {
var string = $(this).val();
if(string) {
string = string[0].toUpperCase() + string.slice(1);