Skip to content

Instantly share code, notes, and snippets.

View reachkamrul's full-sized avatar
😁

Md Kamrul Islam reachkamrul

😁
View GitHub Profile
/*
* The following functions will add additional file types option to your file upload element
* In this case, You can enable STL, MAX, DWG, STEP, OBJ, FBX, Ect file format
* Just add this snippet to your theme's functions.php file or relevant place.
*/
add_filter('fluentform_file_type_options', function ($types) {
$types[] = [
'label' => __('3d files - DWG, STL, STEP, STP, SKP, MAX, FBX, 3DS, IGES, IGS, OBJ', 'fluentform'),
'value' => 'dwg|stp|stl|STEP|skp|max|fbx|3ds|iges|igs|obj',
ThisForm = $('.maxChar'); // Give element class
min = 5; //Give minimum character number
max = 10; //Give maximum chartacter number
limitCrossed = "you have reached the limit"; // Text to show when limit crossed
goodToGo = "good to go"; // Text to show when the character length is perfect, use " " if you dont want to show any text
required = "characters required"; // Text to show minimum character required
ThisForm.after( "<p class='charLimit'></p>" );
var seperator = '.'; // Give the seperator
var classes = 'myclass'; // Give the class
function renderFoot(){
if(!$table.find('tfoot').length){
jQuery("<tfoot></tfoot>").appendTo($table);
}
@reachkamrul
reachkamrul / changeStripeDescriptor.php
Last active October 18, 2021 13:44
changeStripeDescriptor.php
// The code will be applied to form id 286 only
add_filter('wppayform/stripe_checkout_session_args', function ($checkoutArgs, $submission) {
if ($submission->form_id === '286') {
$descriptor = 'My stripe descriptor';
$checkoutArgs['payment_intent_data']['statement_descriptor'] = $descriptor;
};
return $checkoutArgs;
}, 1, 2);
// Remove WooCommerce Variable Add to cart System
function removeVariableCart(){
var linkText = 'Read More'; // Give your read more text
$table.find('.ninja_clmn_nm_woo_product_buy').each(function(){
jQuery(this).find('.nt_woo_attribute').hide();
jQuery(this).prev('.ninja_clmn_nm_woo_product_quantity').find('.quantity').hide();
jQuery(this).find('.wc_product_variable').css('opacity', '1');
var linkVal = jQuery(this).find('#ntb_woo_product_variation').attr('href');
jQuery(this).find('#ntb_woo_product_variation').replaceWith('<a href="'+linkVal+'" class="nt_button_woo button">'+linkText+ '</a>');
})
global $current_user;
get_currentuserinfo();
echo do_shortcode('[ninja_tables id="77" filter=" ' . $current_user->user_email . '" ] ');
.pop-up {
display: none;
position: absolute;
max-width: 580px;
background: #eeeeee;
color: #000000;
border: 1px solid #1a1a1a;
font-size: 90%;
white-space: initial;
padding: 10px !important;
function addDom() {
$table.find("tbody td").each(function () {
if ($(this).find(".pop-up").length) {
// it exists do nothing
} else {
var content = jQuery(this).text();
if (jQuery.trim(jQuery(this).html()) !== "") {
jQuery("<p class='pop-up'></p>").appendTo(jQuery(this));
if (jQuery.trim(jQuery(this).find(".pop-up").html()) === "") {
jQuery(this).find(".pop-up").html(content);
add_action( 'wp_head', function () { ?>
<script>
jQuery(document).ready(function(){
var url = window.location.href;
jQuery('.url').val(url);
})
</script>
<?php } );
/*
* Get user id
* {get_urls}
*/
add_filter('fluentform_editor_shortcode_callback_get_urls', function ($val) {
$get_urls = $actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
return $get_urls;
});