forked from soflyy/wp-all-import-action-reference
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwp_all_export_additional_data.php
More file actions
35 lines (32 loc) · 952 Bytes
/
wp_all_export_additional_data.php
File metadata and controls
35 lines (32 loc) · 952 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
/**
* ======================================
* Filter: wp_all_export_additional_data
* ======================================
* Create additional fields for export.
* NOTE: Works with XML exports only, not CSV*
*
* @param $add_data array - any additional data to export to this array
* @param $options ??
*
* @return array
*/
function wpae_additional_data($add_data, $options)
{
// $add_data['my_field'] = 'value';
return $add_data;
}
add_filter('wp_all_export_additional_data', 'wpae_additional_data', 10, 2);
// ----------------------------
// Example uses below
// ----------------------------
/**
* Example: adds a "created_at" element to the export
* Example result: http://d.pr/i/BYOAs/4LARjuPi
*/
function wpae_additional_data_field($add_data, $options)
{
$add_data['created_at'] = date("Y-m-d H:i:s");
return $add_data;
}
add_filter('wp_all_export_additional_data', 'wpae_additional_data_field', 10, 2);