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
/** | |
* Function to prevent users mark more than expected items. | |
* This code must need to be placed in custom JS of your form | |
* @param: containerClass String - The contaner class of the target checkbox block. | |
* You can add a custom container class in the form settings | |
* | |
* @param: maxChecked Integer - Max Number of items user can mark | |
* @return: void | |
* | |
*/ |
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('recaptcha_custom_function', 'recaptcha_custom_function_callback', 10, 1 ); | |
function recaptcha_custom_function_callback( $form) { | |
echo ' | |
<script type="text/javascript"> | |
jQuery( document ).ready(function() { | |
jQuery(".ff-btn-submit").attr("disabled", "true"); | |
}); | |
function enableBtn(){ | |
jQuery(".ff-btn-submit").removeAttr("disabled"); | |
} |
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('ninja_table_raw_sql_placeholders', function ($value) { | |
$value['{name}'] = 'kamrul'; | |
return $value; | |
}); |
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
/* | |
* The following functions will add additional file types option to your file upload element | |
* In this case, You can enable .dwg file format | |
* Just add this snippet to your theme's functions.php file or relevant place. | |
*/ | |
add_filter('fluentform_file_type_options', function ($types) { | |
$types[] = [ | |
'label' => __('Autocad Files (dwg)', 'fluentform'), | |
'value' => 'dwg', |
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
<?php | |
/* | |
* Say we want to change data of table id 1477 then you can write the following | |
* code. | |
* $data is the array of frontend data | |
*/ | |
add_filter('ninja_tables_get_public_data', function ($data, $tableId) { | |
if ($tableId == 1477) { | |
$data[] = [ | |
'name' => 'Dynaic Name', |
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
<?php | |
function distance($lat1, $lng1, $lat2, $lng2) | |
{ | |
// convert latitude/longitude degrees for both coordinates | |
// to radians: radian = degree * π / 180 | |
$lat1 = deg2rad($lat1); | |
$lng1 = deg2rad($lng1); | |
$lat2 = deg2rad($lat2); | |
$lng2 = deg2rad($lng2); |
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
<?php | |
add_filter('fluenform_rendering_field_data_select', function ($data, $form) { | |
if ($form->id != 91) { | |
return $data; | |
} | |
// do the dynamic part if and only the name attriibute is 'dynamic_dropdown' | |
// Please use the corresponding field name for your case. | |
if (\FluentForm\Framework\Helpers\ArrayHelper::get($data, 'attributes.name') != 'dynamic_dropdown') { | |
return $data; |