Skip to content

Instantly share code, notes, and snippets.

View redifmail's full-sized avatar
🎯
Focusing

redifmail

🎯
Focusing
View GitHub Profile
@redifmail
redifmail / gist:580de9e939fb450b512638834064b8fd
Created June 28, 2026 07:33
Hide empty field in jetform builder send email submit acction
// Shortcode to display field and label only if the field is not empty
function jfb_display_if_not_empty($atts, $content = null) {
// Define default attributes and merge with user-defined attributes
$defaults = array(
'field' => '', // The field value to check
'label' => '', // The label text to display
);
$atts = shortcode_atts($defaults, $atts);
@redifmail
redifmail / gist:9e32e70ea4797a6f78e9702005a70c03
Created April 4, 2026 05:09
JetForm Builder Success/Error Messages Fix
/* JetFormBuilder Success Messages Floating Toast - CENTERED */
.jet-form-builder-message {
position: fixed !important;
top: 50% !important;
left: 50% !important;
bottom: auto !important;
right: auto !important;
z-index: 999999 !important;
background: #ffffff !important;
padding: 16px 24px !important;
@redifmail
redifmail / gist:10dbd58cd98207f1a9d7f25856aff201
Created April 1, 2026 13:52
Independent Analytics White Label
add_action('admin_footer', function () {
$screen = function_exists('get_current_screen') ? get_current_screen() : null;
if (!$screen || strpos($screen->id, 'independent-analytics') === false) {
return;
}
$sidebar_logo = 'https://mkdeesigns.com/wp-content/uploads/2026/01/Analytics-by-MK-Designs.png'; //change URL to your logo
?>
<script>
@redifmail
redifmail / gist:857bb4e5c9d9b2229bdff3800286ccff
Created February 22, 2025 17:47
Delete media attached to CCT
add_action('admin_init', function () {
// Check if the current URL matches the target URL
$current_url = $_SERVER['REQUEST_URI'];
$target_url = '/wp-admin/admin.php?page=jet-cct-your-cct'; // Your specific CCT URL
if (strpos($current_url, $target_url) === false) {
return; // Exit if the current URL does not match the target URL
}
// Check if the action is triggered by the CCT delete button
@redifmail
redifmail / Clear JetFormBuilder Input Data.txt
Created September 3, 2024 12:11
Clear JetFormBuilder Input Data
Add following script in HTML widget of your JetForm.
<script>
(function() {
// Initialize the universal clear button for the form
function initializeUniversalClearButton() {
const form = document.querySelector('.jet-form-builder');
if (!form) return;
// Create the universal clear button
@redifmail
redifmail / Collapse specific checkbox field.txt
Last active November 4, 2026 08:20
Collapse option for JetFormBuilder specific checkbox field from multiple checkbox fields
If you have more than one checkbox fields in same form, and want to target only specific checkbox field.
Assign specific class to desired checkbox. Instead assigning custom class to checkbox field, add class to parent block of checkbox field.
Below, I have added ".checkbox-needed" class to parent block.
-------------------------------------------------
Add below CSS via plugin or custom CSS. This will ensure extra checkbox fields are hidden by default for specific class which we assigned initially.
.checkbox-needed .jet-form-builder__field-wrap:nth-of-type(n+6) { // You can adjust "6" as per your requirements.
@redifmail
redifmail / Collapse checkbox field.txt.txt
Last active November 4, 2026 08:20
Collapse option for JetFormBuilder single checkbox field
Add below CSS via plugin or custom CSS. This will ensure extra checkbox fields are hidden by default.
.jet-form-builder__field-wrap:nth-of-type(n+6) {
display: none;
}
-------------------------------------------------
Add below HTML in JetForm to add button
<div class="checkbox-controls">
@redifmail
redifmail / gist:2173645ffe3cd9da2db1067e47758e1d
Created August 31, 2024 07:42
Jetform Builder Duplicate file error
// Get all the upload fields
const uploadFields = [
document.getElementById('form_field_name_1'), // change 'form_field_name_1' and other with your field ids
document.getElementById('form_field_name_2'),
document.getElementById('form_field_name_3'),
document.getElementById('form_field_name_4')
];
// Function to check for duplicate files
function checkDuplicateFiles(currentField) {
@redifmail
redifmail / gist:35aafbde42642303d1dcabb40ee95ed7
Created February 6, 2024 18:29
Country List Glossary For JFB
🇦🇫 Afghanistan +93
🇦🇱 Albania +355
🇩🇿 Algeria +213
🇦🇸 American Samoa +1-684
🇦🇩 Andorra +376
🇦🇴 Angola +244
🇦🇮 Anguila +1-264
🇦🇬 Antigua and Barbuda +1-268
🇦🇷 Argentina +54
🇦🇲 Armenia +374