Skip to content

Instantly share code, notes, and snippets.

@alex-authlab
Forked from techjewel/dynamic_data.php
Created December 5, 2020 10:14
Show Gist options
  • Save alex-authlab/226fd108365b9e94c1239040305a0824 to your computer and use it in GitHub Desktop.
Save alex-authlab/226fd108365b9e94c1239040305a0824 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