-
-
Save alex-authlab/226fd108365b9e94c1239040305a0824 to your computer and use it in GitHub Desktop.
Dynamic Data Manipulation in Ninja Tables
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 | |
/* | |
* 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' => '[email protected]', | |
'phone' => '983129123123' | |
]; | |
} | |
return $data; | |
}, 15, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment