This file contains hidden or 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/validate_input_item_input_email', function ($errorMessage, $field, $formData, $fields, $form) { | |
$targetFormId = 15; | |
if ($form->id != $targetFormId) { | |
return $errorMessage; | |
} |
This file contains hidden or 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_action('custom_message', 'custom_message_callback', 10, 1); | |
function custom_message_callback($form) { | |
echo '<div class="custom-field-container">'; | |
echo '<button type="button" onclick="alert(\'Custom message sent!\')">Send Message</button>'; | |
echo '</div>'; | |
} |
This file contains hidden or 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
window.onload = function() { | |
// Only 10 characters can be added. Change this value to apply more characters. | |
let textAreaCharsLimit = 10; | |
//find the specific text area field using the classname | |
let textAreaField = document.querySelector('.haslimit'); | |
// Create a new div to display the remaining characters | |
let newDiv = document.createElement("div"); |
This file contains hidden or 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_action('rest_api_init', function () { | |
register_rest_route('fluentform/v1', '/approved-entries/(?P<form_id>\d+)', array( | |
'methods' => 'GET', | |
'callback' => 'get_fluent_form_approved_entries', | |
'permission_callback' => '__return_true' | |
)); | |
}); | |
function get_fluent_form_approved_entries($request) { | |
This file contains hidden or 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/shortcode_defaults', function($data, $atts) { | |
$formId = \FluentForm\Framework\Helpers\ArrayHelper::get($atts, 'id'); | |
if ($formId) { | |
$form = \FluentForm\App\Models\Form::find($formId); | |
// check form and do your work and return null; | |
return null; | |
} | |
return $data; |
This file contains hidden or 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
window.onload = function(){ | |
//First Group | |
var select = document.getElementById("ff_136_dropdown"); //change the dropdown id | |
var optgroup = document.createElement("optgroup"); | |
optgroup.label = "Foyla Title"; | |
var option1 = select.querySelector('option[value="Option 1"]'); //change the value of the option | |
var option2 = select.querySelector('option[value="Option 2"]'); //change the value of the option |
This file contains hidden or 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/rendering_field_data_custom_html', function ($data, $form) | |
{ | |
if($form->id != 50) { //change the form id with your own form id | |
return $data; | |
} | |
global $post; | |
$thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true ); // Get the thumbnail ID |
This file contains hidden or 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
private function pushScripts($data, $form) | |
{ | |
add_action('wp_footer', function () use ($data, $form) { | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function($) { | |
if (typeof $.fn.fileupload !== 'undefined') { | |
delete $.fn.fileupload; | |
console.log("jQuery.fn.fileupload function removed"); | |
} |
This file contains hidden or 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
$form.on('ff_to_next_page', function(activeStep, form) { | |
console.log(activeStep); | |
// You can run your own JS on step change | |
}); | |
$form.on('ff_to_prev_page', function(activeStep, form) { | |
console.log(activeStep); | |
// You can run your own JS on step change | |
}); |
NewerOlder