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
jQuery('.foo-table tr td').each(function(){ | |
// Get the content | |
var str = jQuery(this).html(); | |
// Set the regex string with the modified pattern | |
var regex = /(https?:\/\/([-\w\.]+)+(:\d+)?(\/([\w\/\-_\.]*(\?\S+)?)?)?)/ig; | |
// Replace plain text links by hyperlinks | |
var replaced_text = str.replace(regex, "<a href='$1' target='_blank'>$1</a>"); | |
// Echo link | |
jQuery(this).html(replaced_text); | |
}); |
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
//filter by current month | |
var myTimeout = setTimeout(myFilterFunction, 100); | |
var months = ("0" + (new Date().getMonth() + 1)).slice(-2)+"/"; | |
months = "/"+months; | |
function myFilterFunction() { | |
// jQuery('select').sumo.selectItem(months.toString()); | |
jQuery('option[value="'+months+'"]').prop("selected", true); | |
jQuery('.form-control').trigger("change"); |
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
//filter by current year | |
var myTimeout = setTimeout(myFilterFunction, 100); | |
function myFilterFunction() { | |
var years = new Date().getFullYear(); | |
jQuery('select')[0].sumo.selectItem(years.toString()); | |
} |
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 MSG 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' => __('MSG file - MSG', 'fluentform'), | |
'value' => 'msg', |
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_filter('fluentform_payment_receipt_pre_render_payment_info', function ($html, $entry) { | |
$orderItem = \FluentFormPro\Payments\Orders\OrderData::getOrderItems($this->entry); | |
$formId = $entry->form_id; | |
// replace $html with your own HTML and return | |
return $html; | |
}, 10, 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
<?php | |
global $current_user; | |
if ( is_user_logged_in() ) { | |
$getEmail = $current_user->user_email; | |
$getID = get_current_user_id(); | |
$column_key = "email"; | |
echo do_shortcode('[ninja_tables id="621" filter_column="' . $column_key . '" filter="' . $getID . '" ] '); | |
} |
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
$form.find('.address').on('change', function(){ | |
var address = jQuery(this).val().split(','); | |
$form.find('input[name="government"]').val(address[0]); | |
$form.find('input[name="address"]').val(address[1]); | |
$form.find('input[name="postal"]').val(address[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
// To hide before filter | |
//css | |
#footable_parent_NT_ID{ | |
opacity:0; | |
} | |
// js | |
$table.on("after.ft.filtering", function () { | |
jQuery(".ninja-custom-filter").each(function(){ | |
var m = jQuery(this).find(':input option:selected'); |
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
$urlValue = 'http://google.com/?url='; | |
$fieldName = 'url'; | |
$form.find('input[name="'+$fieldName+'"]').on('change, keyup', function($fieldValue){ | |
$fieldValue = jQuery(this).val(); | |
$url = $urlValue+$fieldValue; | |
$form.on('fluentform_submission_success', function(){ | |
window.open($url, 'name'); | |
}); |
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 shortcode | |
* In this case, you can use a shortcode to show a random data among your table cell | |
* You can use like this [ninja_table_random_cell id="Your Table ID" column="Your Colum Key"] | |
* Just add this snippet to your theme's functions.php file or relevant place. | |
*/ | |
add_shortcode('ninja_table_random_cell', function ($atts) { | |
$shortCodeDefaults = array( |
NewerOlder