Hi Linus,
Thanks for contacting us! For customizing the columns on the reports page and CSV file you can either change the code directly by editing the plugin’s files.
Or add your code to your theme’s functions.php file, or even better, use a functionality plugin such as Code Snippets, and create a function to append a new field to the reports section.
Using the second method the changes you make will be preserved on plugin updates.
Best,
Thank you! Is there a specific hook i should use when writing the code? I can’t seems to find a hook in the developers documentation which has to do with the report specifically.
Thank you once again. I have managed to add a column and populate it with data in the “Reports” view. I do still have a problem with exporting the data, as it seems i cannot get the user related to each of the Report table items. Is there a way to get the user related to each report table item by using another filter?
My thought right now is that i would need to get all report table items so that i could extract just the user ID from each item. Is this possible?
Current code:
function add_column($columns) {
$columns['company'] = "Företag";
apply_filters('sensei_analysis_overview_column_data', $columns);
return $columns;
}
function add_column_data($columns) {
$user = get_user_by('login', $columns['title']);
$company = $user->foretag;
$columns['company'] = $company;
return $columns;
}
add_filter('sensei_analysis_overview_users_columns', 'add_column');
add_filter('sensei_analysis_overview_column_data', 'add_column_data');
Hi again,
We aren’t able to help with custom code requests like this, so if you need assistance, you may want to look into one of these services:
https://jobs.wordpress.net/
Thanks!