Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the community forum?
All Topics
mikashv

Export data

Hi.
Is there a way to hook the exported data and export them to a new format like xls or PDF via custom code ?
I would like to manipulate the data before expoeting them.

Thanks !

11 months ago
Stefan
Developer

At this moment there is not a hook available for this.
You can alter the value of columns with the following hook though:

acp/export/value

It’s also possible to misuse the filter ac/export/exporter_csv/delimiter for your solution as it contains the object that has both the data and the headers. Please notice that this filter is not meant for changing the export format, but you can use it to do some custom stuff with the data, I guess.

/**
 * @param string $delimiter
 * @param \ACP\Export\Exporter\CSV $csv
 */
function acp_export_to_another_format( $delimiter , $csv ){
	$header = $csv->get_column_labels();
	$data = $csv->get_data();
}
add_filter( 'ac/export/exporter_csv/delimiter', 'acp_export_to_another_format', 10, 2  );
10 months, 4 weeks ago
mikashv

Thanks for your answer.

In this filter i can manage my data as i want, nice !
Do you think there is a way for me to create an ACP addon to change the export format or do you think it’s possible to add an action or a filter to do this in a future release ?

Thanks !

10 months, 4 weeks ago
Stefan
Developer

You’re welcome.
I think the best approach would be some changes in our code that allows you to extend the Export behavior.
But I want to have our architect to have a look at this.
I created a ticket for this on our issue board on Github.
https://github.com/codepress/admin-columns-issues/issues/1157

10 months, 3 weeks ago

You must be logged in to reply to this topic.