Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save iamrealfarhanbd/21cd53c8d791a3709a614ad6bdbf11cf to your computer and use it in GitHub Desktop.
Save iamrealfarhanbd/21cd53c8d791a3709a614ad6bdbf11cf to your computer and use it in GitHub Desktop.
add_filter('ninja_tables_before_update_settings', function ($columns, $tableId) {
function modifyData($columns) {
if (isset($_REQUEST['columns'])) {
return $_REQUEST['columns'];
} else {
return $columns;
}
}
// If you want to modify all tables just set $modifyForAllTables to true
// If you want to modify only for specific tables set $modifyForAllTables to false and add set your desired table id to $yourTableId
$yourTableId = YOUR_TABLE_ID;
$modifyForAllTables = false;
if ($modifyForAllTables || $tableId == $yourTableId) {
return modifyData($columns);
} else {
return $columns;
}
}, 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment