Skip to content

Instantly share code, notes, and snippets.

@techjewel
Created September 10, 2019 12:54
Show Gist options
  • Save techjewel/97f60eb44c1b132b645a95cd6b6acffb to your computer and use it in GitHub Desktop.
Save techjewel/97f60eb44c1b132b645a95cd6b6acffb to your computer and use it in GitHub Desktop.
Dynamic Data Manipulation in Ninja Tables
<?php
/*
* Say we want to change data of table id 1477 then you can write the following
* code.
* $data is the array of frontend data
*/
add_filter('ninja_tables_get_public_data', function ($data, $tableId) {
if ($tableId == 1477) {
$data[] = [
'name' => 'Dynaic Name',
'email' => 'my@dyne.com',
'phone' => '983129123123'
];
}
return $data;
}, 15, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment