This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>" ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var seperator = '.'; // Give the seperator | |
var classes = 'myclass'; // Give the class | |
function renderFoot(){ | |
if(!$table.find('tfoot').length){ | |
jQuery("<tfoot></tfoot>").appendTo($table); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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>'); | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global $current_user; | |
get_currentuserinfo(); | |
echo do_shortcode('[ninja_tables id="77" filter=" ' . $current_user->user_email . '" ] '); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'wp_head', function () { ?> | |
<script> | |
jQuery(document).ready(function(){ | |
var url = window.location.href; | |
jQuery('.url').val(url); | |
}) | |
</script> | |
<?php } ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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; | |
}); |