- Installing WordPress
- Basic Usage of WordPress
- File Structure
- Database Schema
- Request Life-Cycle
This file contains 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
[ | |
{ | |
"country": "US", | |
"zip": 34034, | |
"city": "APO", | |
"FIELD4": "", | |
"state": "AA", | |
"state_name": "Dillon", | |
"code": 33, | |
"FIELD8": "", |
This file contains 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 | |
/* | |
* Stripe Supported Currencies | |
* - JCB, Discover, and Diners Club cards can only be charged in USD | |
* - Currencies marked with * are not supported by American Express | |
* - Most alternative payment methods can only be used with a single currency | |
* - Brazilian Stripe accounts (currently in Preview) can only charge in Brazilian Real | |
* - Mexican Stripe accounts (currently in Preview) can only charge in Mexican Peso | |
* - Data from https://stripe.com/docs/currencies#charge-currencies | |
* - Last Update: July 20, 2017 |
This file contains 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 | |
function ninjaSanitizeTextOrArray( $array_or_string ) { | |
if ( is_string( $array_or_string ) ) { | |
$array_or_string = sanitize_text_field( $array_or_string ); | |
} elseif ( is_array( $array_or_string ) ) { | |
foreach ( $array_or_string as $key => &$value ) { | |
if ( is_array( $value ) ) { | |
$value = ninjaSanitizeTextOrArray( $value ); | |
} else { |
This file contains 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 | |
function addInlineVars($vars, $table_id) { | |
if(function_exists('wp_add_inline_script')) { | |
wp_add_inline_script( 'script_handle', 'window.ninja_footables.tables["table_'.$table_id.'"] = '.$vars.';'); | |
} else { | |
add_action('wp_footer', function () use ($vars, $table_id) { | |
?> | |
<script type="text/javascript"> | |
window.ninja_footables.tables["table_<?php echo $table_id;?>"] = <?php echo $vars ?>; |
This file contains 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
/* | |
Change the offset value based on your theme. If you have fixed with header then you may need to increase the value | |
This code snippet only work on https://wordpress.org/plugins/ninja-tables/ | |
*/ | |
jQuery(document).ready(function() { | |
jQuery('table.ninja_footable').on('click', '.footable-page-link', function (e) { | |
var offset = 50; | |
jQuery('html, body').animate({ | |
scrollTop: jQuery(this).closest('table.ninja_footable').offset().top - offset |
This file contains 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
<div id="footable_parent_353" class="ninja_table_wrapper"> | |
<table class="ninja_table_pro"> | |
<thead> | |
<tr class="footable-filtering"> | |
<!-- Filtering Markup here --> | |
</tr> | |
<tr class="footable-header"> | |
<th class="ninja_column_0">Column 1</th> | |
<th class="ninja_column_1">Another Column</th> | |
</tr> |
This file contains 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 | |
// Add the following code snippet in your theme's function.php file to enable exact match for ninja table search | |
add_filter('ninja_table_attributes', function ($atts, $tableId) { | |
$targetTableId = 1; // change value "1" with your table id that you want to match exact | |
if($targetTableId == $tableId) { | |
$atts['data-filter-exact-match'] = "true"; | |
} | |
return $atts; |
This file contains 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 | |
/* | |
Plugin Name: Ninja Table Dynamic Data | |
Description: Dynamic Data Example For Ninja Tables | |
Version: 1.0.0 | |
Author: WPManageNinja | |
Author URI: https://wpmanageninja.com/ | |
Plugin URI: https://wpmanageninja.com/downloads/ninja-tables-pro-add-on/ | |
License: GPLv2 or later | |
Text Domain: ninja_table_dynamic_data |
This file contains 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 | |
/* | |
* Say you have table which table id is 101 and you want to filter some data | |
* Please disable caching for this table and load using ajax renderer | |
*/ | |
add_filter('ninja_tables_get_public_data', function ($data, $tableId) { | |
if($tableId != 101) { | |
return $data; // Return if this is not our target table | |
} |