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_import_attachments_uploads_dir.php
More file actions
24 lines (21 loc) · 997 Bytes
/
wp_all_import_attachments_uploads_dir.php
File metadata and controls
24 lines (21 loc) · 997 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
<?php
/**
* =========================================
* Filter: wp_all_import_attachments_uploads_dir
* =========================================
*
* Can be used to set a custom path in which attachments (uploaded by the "Download & Import Attachments" field) are uploaded. Only applies to attachments uploaded via WP All Import.
*
* @since 4.4.9
*
* @param $uploads array - Contains information related to the WordPress uploads path & URL
* @param $articleData array - Contains a list of data related to the post/user/taxonomy being imported
* @param $current_xml_node array - Contains a list of nodes within the current import record
* @param $import_id int - Contains the ID of the import
*
* @return string
*/
add_filter('wp_all_import_attachments_uploads_dir', 'wpai_wp_all_import_attachments_uploads_dir', 10, 4);
function wpai_wp_all_import_attachments_uploads_dir($uploads, $articleData, $current_xml_node, $import_id){
return $uploads;
}