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('fluentform/conversational_frame_footer', function() { | |
printf("<script type='text/javascript' id='%s-js-extra'>\n", esc_attr($handle)); | |
$data = " | |
let name = document.querySelector(\"[name=\'input_text\']\"); | |
name.value = \"Ibrahim Mahdi\"; | |
console.log(name.value)"; | |
echo "$data\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $data is hardcoded localized data and escaped before being passed in. |
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/editor_countries', function ($country_names) { | |
foreach ($country_names as $key => $value) { | |
if (preg_match("/\([^)]+\)/", $value)) { | |
$replacedValWithSpaceInBetween = preg_replace("/\s+\([^)]+\)/", "", $value); | |
$country_names[$replacedValWithSpaceInBetween] = $replacedValWithSpaceInBetween; | |
} else { | |
$country_names[$value] = $value; | |
} | |
unset($country_names[$key]); | |
} |
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/response_render_tabular_grid', function ($response, $field, $form_id, $isHtml = false) { | |
$field['raw']['settings']['grid_columns'] = ['Ashik'=>'Ashik', 'Ruman'=>'Ruman']; | |
$field['raw']['settings']['grid_rows'] = ['Ibrahim'=>'Ibrahim', 'Nadim'=>'Nadim', 'Tahmid'=>'Tahmid', 'Mahdi'=>'Mahdi']; | |
return \FluentForm\App\Modules\Form\FormDataParser::formatTabularGridFieldValue($response, $field, $form_id, $isHtml); | |
}, 9, 4); |
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 ($default, $field, $formData, $fields, $form) { | |
// You may change the following 3 lines | |
$targetFormId = 101; //change the form id with your own. | |
$errorMessage = 'Looks like email is not correct, please use a valid email'; // You may change/modify the meessage | |
$apiKey = 'lYlSwj3Uxt5iGecFTHYdqKC4xBQYaClfsss'; //reoon API key, you should use your own api key | |
if ($form->id != $targetFormId) { | |
return $default; | |
} |
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( 'woocommerce_review_order_before_submit', 'custom_content_before_order_submit_button' ); | |
function custom_content_before_order_submit_button() { | |
(new \FluentCampaign\App\Services\Integrations\WooCommerce\WooInit())->addSubscribeBox(); | |
} |
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 | |
}); |
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
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
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/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; |