Skip to content

Instantly share code, notes, and snippets.

@annuman97
annuman97 / webhhook-trigger-after-double-opt-in.php
Created October 1, 2025 12:04
Trigger Webhook after confirming the double opt-in in Fluent Forms
<?php
/**
* Handling the fluent form entry confirmation hook that is triggered on double optin confirmation
* for forms that have that option enabled (this part is coded as webhook UI for fluent forms triggers
* upon form submission, before the user as double opted in. This is the only way
* to access the confirmation hook.
*
* This module will trigger 2 webhooks :
* 1-to add the email to the encharge subscriber list
* 2-to create or update a contact in one page CRM for the subcriber
@annuman97
annuman97 / fb_to_ff_duration_timeDate.js
Created September 26, 2025 12:06
Fluent Booking Meeting Duration and Selected Time and Date
let pickedSlot = '';
let pickedDurationNum = '';
function getDurationNumber() {
const sel = document.querySelector('.fcal_multi_duration .fcal_duration.is_selected');
if (sel) {
const txt = sel.textContent.replace(/\s+/g, ' ').trim(); // "45 Minutes"
const m = txt.match(/\d+/);
if (m) return m[0];
@annuman97
annuman97 / booking_dateTime_to_ff_input_field.js
Created September 25, 2025 17:58
Take booking seleccted date and time to the fluent form input field in order to put the value in custom html field.
let pickedSlot = ''; //picked value from calendar
document.addEventListener('click', function (e) {
const spot = e.target.closest('.fcal_spot');
const next = e.target.closest('.ff-btn-next');
if (spot) {
setTimeout(() => {
const el = document.querySelector('.slot_time_range span');
@annuman97
annuman97 / external_scripts_fluent_community.php
Created September 5, 2025 11:17
When you need to add external scripts to the community portal frontend.
add_action('fluent_community/portal_head', function () {
wp_enqueue_script(
'my-ext-on-portal',
'https://cdn.example.com/sdk.min.js',
[],
null,
false
);
@annuman97
annuman97 / custom_ff_userCase.js
Last active August 29, 2025 09:34
Custom Fluent Form use case where if required checkboxes are not selected it will won't go to next step and show a validation error message.
(function () {
var FORM_ID = 47; //Your Form ID
function q(form, sel) { return form.querySelector(sel); }
function qa(form, sel) { return form.querySelectorAll(sel); }
function getErrorStack(form) {
return q(form, '#fluentform_' + FORM_ID + '_errors');
}
@annuman97
annuman97 / ninja_tables_rowspan.js
Created August 28, 2025 11:00
Ninja Tables: JS code for RowSpan. Add the code to the table's custom CSS section and add the class 'combine' to the column advanced setting where you want to add rowspan
/*!
* jQuery Rowspanizer Plugin (Modified) v0.2
* https://github.com/marcosesperon/jquery.rowspanizer.js
*
* Copyright 2011, 2015 Marcos Esperón
* Released under the MIT license
*
* https://github.com/jquery-boilerplate/boilerplate/
*/
;( function( $, window, document, undefined ) {
@annuman97
annuman97 / highlight_words_in_community_post.php
Last active August 13, 2025 09:48
Search and style the Words in the Community Post content
add_action('fluent_community/portal_head', function() {
?>
<style>
.highlighted-day {
background-color: yellow !important;
color: blue !important;
padding: 2px 4px;
border-radius: 3px;
font-weight: bold;
}
@annuman97
annuman97 / fluentCommunitySVGSupport.php
Created August 8, 2025 08:33
By default Wordpress doesn't allow SVG upload for security reason. But if someone wants to support SVG upload in community portal, first it needs to support to the WordPress and then use the fluent community hook
function allow_svg_uploads($mimes) {
$mimes['svg'] = 'image/svg+xml';
return $mimes;
}
add_filter('upload_mimes', 'allow_svg_uploads');
add_filter('fluent_community/support_attachment_types', function($types) {
$types[] = 'image/svg+xml';
return $types;
});
@annuman97
annuman97 / disablePoll.php
Created July 31, 2025 09:05
If someone wants to disable Fluent Community Poll Feature, Use the following code to the functions.php file
add_filter( 'fluent_community/portal_vars', function( $vars ) {
if ( isset( $vars['features'] ) ) {
$vars['features']['has_survey_poll'] = false;
}
return $vars;
}, 20 );
@annuman97
annuman97 / prevent_selecting_a_date_in_calendar.js
Created July 16, 2025 12:03
Use a dropdown field with the class name .evening that includes options like "Noon" and "Evening", and a date/time field with the class name .datee. This form script prevents users from booking appointments on Sundays or during the evening. It shows alerts and disables selections to enforce these scheduling restrictions.
$(document).ready(function () {
var timeDropdown = $('.evening');
var calendarInput = $(".datee");
var fp = flatpickr(calendarInput[0], {
enableTime: true,
dateFormat: "Y-m-d H:i",
minDate: "today",
time_24hr: true,
onChange: function(selectedDates, dateStr, instance) {