Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Shahjahan Jewel techjewel

🎯
Focusing
View GitHub Profile
@techjewel
techjewel / add_own_custom_forms_demo.php
Created Oct 21, 2021
Fluent Forms add custom Demo Forms
View add_own_custom_forms_demo.php
<?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"],
View return-raw-url-fluentform.php
<?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 Sep 13, 2021
Extra Form Settings for Fluent Forms
View fluentform-extra-form-settings.php
<?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
Created Sep 7, 2021
Add Browser Language smartcode on Fluent Forms Editor
View brpwser-smartcode-fluentform.php
<?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 Aug 27, 2021
Add your own options group for Fluent Forms Editor for Bulk Options
View fluentform-bulk-option-hook.php
<?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;
});
View ff-submit-btn-state-content.php
// required css
<style>
span.ff_submitting {
display: none;
}
.ff-working span.ff_submitting {
display: block;
}
View ff-submit-btn-state-content.php
// required css
<style>
span.ff_submitting {
display: none;
}
.ff-working span.ff_submitting {
display: block;
}
View get_tag_id_from_slug_fluentcrm.php
<?php
function myFluentCrmTagIdBySlug($slug) {
$tag = \FluentCrm\App\Models\Tag::where('slug', $slug)->first();
if($tag) {
$tagId = $tag->id;
}
View fluentcrm-redirect-after-confirmation.php
<?php
add_action('fluentcrm_confirmation_head', function ($subscriber) {
$redirectUrl = 'https://google.com'; // Change this url;
echo '<meta http-equiv="refresh" content="0; URL='.$redirectUrl.'" />';
});
View custom_background_queue_process.php
<?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)
{