This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Total Donation Count | |
*/ | |
add_filter('fluentform_editor_shortcodes', function ($smartCodes) { | |
$smartCodes[0]['shortcodes']['{total_donation_count}'] = 'Total Donation Count'; | |
return $smartCodes; | |
}); | |
add_filter('fluentform_editor_shortcode_callback_total_donation_count', function ($value, $form) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let user_input = $form.find("input[name='custom_payment_input']")[0]; | |
let user_label = $form.find(`label[for='${user_input.id}']`)[0]; | |
// Remove extra stuff in user_label | |
user_label.textContent = "Inscription à prix libre"; | |
// Create new hidden input | |
let hidden_input = document.createElement("input"); | |
hidden_input.type = "hidden"; | |
hidden_input.classList.add("wpf_payment_item"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*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(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use FluentForm\Framework\Helpers\ArrayHelper; | |
add_filter('fluentform_validate_input_item_input_number', function ($errorMessage, $field, $formData, $fields, $form) { | |
$fieldName = 'numeric-field'; | |
$target_form_id = 7; | |
if($target_form_id != $form->id){ return $errorMessage; } | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('fluentform_filter_insert_data', 'change_ff_submitted_timezone', 10, 1); | |
function change_ff_submitted_timezone($response) | |
{ | |
// Set the timezone that you want to display | |
$userTimezone = new DateTimeZone('Asia/Dhaka'); | |
$gmtTimezone = new DateTimeZone('GMT'); | |
$myDateTime = new DateTime($response['created_at'], $gmtTimezone); | |
$offset = $userTimezone->getOffset($myDateTime); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Add the smartcode to the list | |
*/ | |
add_filter('fluentform_editor_shortcodes', function ($smartCodes) { | |
$smartCodes[0]['shortcodes']['{current_time}'] = 'Current Time'; | |
return $smartCodes; | |
}); | |
/* | |
* Transform the smartcode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Snippet: A smart shortcodes will be generated that can be added to any field on the form and it will be displayed in front-end */ | |
add_filter('fluentform_editor_shortcodes', function ($smartCodes) { | |
$smartCodes[0]['shortcodes']['{remaining_entries}'] = 'Remaining Entries'; | |
return $smartCodes; | |
}); | |
add_filter('fluentform_editor_shortcode_callback_remaining_entries', function ($value, $form) { | |
$max_entries = $form->settings['restrictions']['limitNumberOfEntries']['numberOfEntries']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Insert this codes in your functions.php file | |
add_filter('fluentform_insert_response_data', 'update_url_and_chaturbate_username', 10, 3); | |
function update_url_and_chaturbate_username($formData, $formid, $inputConfigs) | |
{ | |
if($formid != 17) { | |
return $formData; | |
} |
NewerOlder