Skip to content

Instantly share code, notes, and snippets.

@annuman97
annuman97 / clickable_entirer_row.js
Created June 25, 2025 09:47
If a column contains URLs and users want to enable redirection to that link when clicking anywhere on the row,
function runAll(){
$('.footable tbody tr').click( function() {
}).hover( function() {
$(this).toggleClass('hover');
$(this).css('cursor', 'pointer');
});
$(document).on('click', '.footable tbody tr', function(e){
e.preventDefault();
var url = $(this).find('a').attr('href');
window.open(url, '_blank');
@annuman97
annuman97 / hide_left_sidebar_bottom_icons.php
Created June 20, 2025 05:30
Hide Left bottom icons in Fluent Community
add_action('init', function () {
if (current_user_can('manage_options')) {
remove_all_actions('fluent_community/after_portal_sidebar');
//add your own custom content there
add_action('fluent_community/after_portal_sidebar', function () {
echo '<div class="fcom_side_footer"></div>'; // empty footer
});
}
@annuman97
annuman97 / bypassadminapprovalemail.php
Created June 18, 2025 07:37
Sending Email Notification when Fluent Forms Admin Approval is enabled using wp_mail functions
add_action('fluentform/submission_inserted', 'bypass_admin_approval_email', 20, 3);
function bypass_admin_approval_email($entryId, $formData, $form)
{
if($form->id != 7) {
return;
}
$email = isset($formData['email']) ? sanitize_email($formData['email']) : '';
if ($email && is_email($email)) {
@annuman97
annuman97 / autoserialnumber.php
Created May 7, 2024 11:27
Auto Serial Number column to a Table in NT
// Auto serial number
add_filter('ninja_table_rendering_table_vars', function($table_vars, $table_id, $tableArray){
$target_id = 1320;
if ($tableArray['table_id'] != $target_id) {
return $table_vars;
}
$counter_column = [
'name' => 'serial',
'key' => 'serial',
@annuman97
annuman97 / NTReadMoreLessButton.js
Created April 8, 2024 10:09
NTReadMoreLessButtonForMultipleColumns
/*Read More text on a table cell */
$(document).ready(function(){
var maxLength = 15; // give character length here
var colNames = ['title','citation', 'summary']; // give your column key here
var readMoreText = "read more..."; // give read more text here
var readLessText = "read less..."; //give read less text here
function limitChar(){
for(i = 0 ; i<colNames.length; i++){
@annuman97
annuman97 / Fluent Form File Upload extensions
Created April 7, 2024 09:02
Fluent Form File Upload extensions
add_filter('fluentform/file_type_options', function ($types) {
$types[] = [
'label' => __('3d files - DWG, STL, STEP, STP, SKP, MAX, FBX, 3DS, IGES, OBJ', 'fluentform'),
'value' => 'dwg|stp|stl|STEP|skp|max|fbx|3ds|iges|obj',
];
return $types;
});
add_filter('upload_mimes', function ($mime_types) {
$mime_types ['dwg'] = 'image/vnd.dwg';
@annuman97
annuman97 / ffAddressAutoCompleteRestrictFeilds.js
Created December 30, 2023 10:56
Fluent From address field with Geolocation enabled. Where when users enter the Address Line 1 field all the other field will be filled and disabled for editing.
$(".ff-name-address-wrapper.fluent-address.ff_map_autocomplete input").on('input', function() {
$(".fluent-address :input:not(:focus)").prop("disabled", this.value.length);
});
@annuman97
annuman97 / MakeAllLinksandMailAddressClickable.js
Created October 6, 2023 06:46
MakeAllLinksandMailAddressClickable
let desc = Array.from(document.querySelectorAll('td.link'));
desc.forEach((cell) => {
let cellVal = cell.innerText.split(' ');
cellVal.find((val)=>{
if(val.includes('@')){
let replaceText = cell.innerHTML.replace(val, `<a href="mailto:${val}">${val}</a>`);
cell.innerHTML = replaceText;
}else if(val.includes('http')){
let replaceText = cell.innerHTML.replace(val, `<a href="${val}">${val}</a>`);
@annuman97
annuman97 / ninjaTablesAutoSerialNumberforMultipleTables.php
Last active May 7, 2024 11:26
Auto Serial Number to multiple ninja tables
add_filter('ninja_table_rendering_table_vars',function($table_vars, $table_id, $tableArray){
$target_id = [2607,2608];//add all tables ID here
$tableId = 0;
foreach($target_id as $id){
if($table_id == $id){
$tableId = $id;
}
}
@annuman97
annuman97 / gist:c7f7e49068f52abfbe7693e2f79cf6fe
Created July 24, 2023 09:31
Randomize/shuffle the table rows each time after refresh the page
(function($){
//Shuffle all rows, while keeping the first column
//Requires: Shuffle
$.fn.shuffleRows = function(){
return this.each(function(){
var main = $(/table/i.test(this.tagName) ? this.tBodies[0] : this);
var firstElem = [], counter=0;
main.children().each(function(){
firstElem.push(this.firstChild);
});