Skip to content

Instantly share code, notes, and snippets.

View reachkamrul's full-sized avatar
😁

Md Kamrul Islam reachkamrul

😁
View GitHub Profile
function runAll (){
$table.find('.nt_image_type_thumb').each(function(){
jQuery(this).attr('src', 'https://sandbox.wpninjathemes.com/wp-content/uploads/2021/02/pdf-e1612433285834.png');
})
}
runAll();
$table.on('after.ft.filtering', function() {
runAll();
var columnKey = "number"; //Give your column key here
function runAll (){
$('.ninja_clmn_nm_'+columnKey).each(function(){
$(this).text( $(this).text().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,") );
});
}
runAll();
var firstNameKey = "first_name"; // give your first name fields Name attributes
var lastNameKey = "last_name"; // give your last name fields Name attributes
var phoneNummber = "5521997832127" // give your mobile number
var text = "Quero-Desenhar%0A%20"; //give your texts
$form.on('submit',function(){
var firstName = $(this).find("input[name='names["+firstNameKey+"]']").val();
var lastName = $(this).find("input[name='names["+lastNameKey+"]']").val();
window.location = 'http://api.whatsapp.com/send?phone='+phoneNummber+'&text='+text+''+firstName+'%20'+lastName;
});
add_filter('fluentform_insert_response_data', 'your_custom_response_data_filter_function', 10, 3);
function your_custom_response_data_filter_function($formData, $formId, $inputConfigs)
{
if($formId != 1) {
return $formData;
}
$formData[names] = array_map('ucwords', $formData[names]);
return $formData;
}
//CRM CONTACTS NOTES TYPE
add_filter('fluentcrm_contact_activity_types',function(){
return [
'my_post' => 'My Post',
'new_post' => 'New Post'
];
});
add_filter('fluentform_step_string', function($text){
$text = __('%activeStep% / %totalStep%', 'fluentform');
return $text;
});
add_filter('fluentform_itl_options', 'placeholder',10,3);
function placeholder($itlOptions, $data, $form){
$itlOptions =[
'autoPlaceholder' => 'off'
];
return $itlOptions;
};
//Change Upload text of file/image fluent form
add_filter('fluentform_global_form_vars','uploadText');
function uploadText(){
$text = array(
'ajaxUrl' => admin_url('admin-ajax.php'),
'upload_completed_txt' => ('100% Done', 'fluentform'),
'upload_start_txt' => ('0% Done', 'fluentform'),
'uploading_txt' => __('Doing', 'fluentform'),
//Add more contact type in CRM
add_filter( 'fluentcrm_contact_types', 'custom_contact_type' );
function custom_contact_type($array) {
return array_merge( $array, array( 'one', 'two' ) );
}
add_filter('ninja_tables_item_attributes', function ($attributes) {
$values = json_decode($attributes['value'], true);
if(isset($values['created_at']) && !$values['created_at']) {
$values['created_at'] = date('Y-m-d h:i A', current_time('timestamp'));
$attributes['value'] = json_encode($values, JSON_UNESCAPED_UNICODE);
}
if(isset($values['updated_at'])) {
$values['updated_at'] = date('Y-m-d h:i A', current_time('timestamp'));