Skip to content

Instantly share code, notes, and snippets.

View nkb-bd's full-sized avatar

Lukman Nakib nkb-bd

  • Authlab Limited
  • Bangladesh
View GitHub Profile
@nkb-bd
nkb-bd / Codeigniter smtp email server
Created May 3, 2019 08:21 — forked from as3eem/Codeigniter smtp email server
email from localhost via smtp server on codeigniter
//Load email library
$this->load->library('email');
//SMTP & mail configuration
$config = array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => 'user@gmail.com',
'smtp_pass' => 'gmail_password',
/*Change input border color when input is selected/focused */
.ff-el-form-control:focus {
border-color:red;
outline: none;
-webkit-box-shadow: 0 0 0 3px rgba(255, 0, 129, 0.25);
box-shadow: 0 0 0 3px rgba(255, 0, 129, 0.25);
}
<?php
/*
* Code snippet to make login form with Fluent Forms WordPress Plugins
* Steps:
* 1. make a form with email and password (Make sure the name attribute is 'email' and 'password' for corresponding field)
* 2. Paste the shorcode in a page
* 3. Change the form id in the bellow code (23) with your created fluentform's form id and paste in your theme's functions.php file
* 4. That's it
*
@nkb-bd
nkb-bd / ff-user-list-filter.php
Created September 4, 2020 10:35
fluent form users list in dropdown input
/*
* 1. Add this in function.php file
* 2. Change form ID
* 3. Change input attribute name
*/
add_filter('fluenform_rendering_field_data_select', function ($data, $form) {
if ($form->id != 91) {
return $data;
}
<?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)
{
<?php
add_filter('fluentform_form_settings_smartcodes', function ($groups) {
$groups[0]['shortcodes']['{adrian_all_data}'] = 'Custom All Data';
return $groups;
});
add_filter('fluentform_shortcode_parser_callback_adrian_all_data', function ($return, $instance) {
$form = $instance::getForm();
@nkb-bd
nkb-bd / ff-trigger-inte-feed.php
Created July 26, 2021 08:19
fluent form trigger integration feed
use FluentForm\App\Modules\Form\FormDataParser;
use FluentForm\App\Modules\Form\FormFieldsParser;
if (isset($_GET['test'])) {
function getEntry($id, $form)
{
$submission = wpFluent()->table('fluentform_submissions')->find($id);
$formInputs = FormFieldsParser::getEntryInputs($form, ['admin_label', 'raw']);
@nkb-bd
nkb-bd / fluent-form-randomize-inputs
Last active September 8, 2021 05:10
Randomize the form Inputs of FluentForms
<?php
// Add this function to function.php and change target form ID
add_filter('fluentform_rendering_form', function ($form) {
// change form ID
$targetFormId = 108;
if ($form->id != $targetFormId) {
return $form;
@nkb-bd
nkb-bd / fluentf-form-repeater-validation.php
Last active November 10, 2022 03:51
Fluent Form Repeater Field Unique validation
add_filter('fluentform_validate_input_item_repeater_field', function ($errorMessage, $field, $formData, $fields, $form) {
$name = 'repeater_field';
$data = $formData[$name];
$col_index = 0;
$values= array_column($data,$col_index);
$unique_count = count(array_unique($values));
$count = count($values);
@nkb-bd
nkb-bd / FluentForm_Checkbox_value_from_url.php
Created October 5, 2021 16:15
Preselect chekbox/radio from get parameter in WP FLuent Forms
<?php
add_filter('fluentform_rendering_field_data_input_checkbox', function ($data, $form) {
{
//change form ID
if ($form->id != 5) {
return $data;
}
//set get param value & match with checkbox value
if (isset($_GET['my_value'])) {