Skip to content

Instantly share code, notes, and snippets.

View techjewel's full-sized avatar
🎯
Focusing

Shahjahan Jewel techjewel

🎯
Focusing
View GitHub Profile
@techjewel
techjewel / add_own_custom_forms_demo.php
Created October 21, 2021 13:35
Fluent Forms add custom Demo Forms
<?php
add_filter('fluentform_predefined_forms', function ($demoForms) {
$demoForms['nicolas_form_1'] = array(
'screenshot' => '', // You may add your form screenshot here
'createable' => true,
'title' => 'Form 1 by Nicolas',
'tag' => ["nicolas form"],
<?php
/*
* If you want to return raw provided url without any sanitization and security check then you can use this snippet.
*/
add_filter('fluentform_submission_confirmation', function ($returnData, $form, $confirmation) {
if(empty($returnData['redirectUrl'])) {
return $returnData;
}
@techjewel
techjewel / fluentform-extra-form-settings.php
Created September 13, 2021 08:37
Extra Form Settings for Fluent Forms
<?php
// Inject Link Form Settings Menu
add_filter('fluentform_form_settings_menu', function ($items) {
$items['my_menu_slug'] = [
'title' => 'My Menu Title',
'slug' => 'my_settings_slug'
];
return $items;
@techjewel
techjewel / brpwser-smartcode-fluentform.php
Last active December 16, 2021 16:37
Add Browser Language smartcode on Fluent Forms Editor
<?php
/*
* Add Browser Language smartcode on Fluent Forms Editor
*/
add_filter('fluentform_editor_shortcodes', function ($groups) {
$groups[0]['shortcodes']['{browser_lang}'] = 'Browser Language';
return $groups;
});
add_filter('fluentform_editor_shortcode_callback_browser_lang', function ($val) {
@techjewel
techjewel / fluentform-bulk-option-hook.php
Created August 27, 2021 07:24
Add your own options group for Fluent Forms Editor for Bulk Options
<?php
add_filter('fluentform_editor_vars', function($vars) {
$bulkOptionsJson = $vars['bulk_options_json'];
$arrays = json_decode($bulkOptionsJson, true);
$arrays['New Option Group'] = ['Option 1', 'Option 2'];
$vars['bulk_options_json'] = json_encode($arrays);
return $vars;
});
// required css
<style>
span.ff_submitting {
display: none;
}
.ff-working span.ff_submitting {
display: block;
}
// required css
<style>
span.ff_submitting {
display: none;
}
.ff-working span.ff_submitting {
display: block;
}
<?php
function myFluentCrmTagIdBySlug($slug) {
$tag = \FluentCrm\App\Models\Tag::where('slug', $slug)->first();
if($tag) {
$tagId = $tag->id;
}
<?php
add_action('fluentcrm_confirmation_head', function ($subscriber) {
$redirectUrl = 'https://google.com'; // Change this url;
echo '<meta http-equiv="refresh" content="0; URL='.$redirectUrl.'" />';
});
<?php
/*
* Function to push a task for background processing
* @param: string $callbackName - Your classback acction name
* @param: mixed $payload - Your payload data that you will get when procssing on callback
*/
function my_custom_queue_on_background($callbackName, $payload)
{