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_handle_upload.php
More file actions
35 lines (29 loc) · 913 Bytes
/
wp_all_import_handle_upload.php
File metadata and controls
35 lines (29 loc) · 913 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_import_handle_upload
* ==================================
*
* Filters the data array for attachments & images uploaded through WP All Import
*
* @since 4.4.9-beta-2.6
*
* @param $file array - Contains the filepath, URL & filetype
*
* @return $file
*/
add_filter('wp_all_import_handle_upload', 'wpai_wp_all_import_handle_upload', 10, 1);
function wpai_wp_all_import_handle_upload( $file ){
// Handle & return $file here.
}
// ----------------------------
// Example uses below
// ----------------------------
/**
* Apply WordPress's 'wp_handle_upload' filter to $file, so that plugins like Imsanity can work their magic
*
*/
add_filter('wp_all_import_handle_upload', 'wpai_wp_all_import_handle_upload', 10, 1);
function wpai_wp_all_import_handle_upload( $file ){
return apply_filters( 'wp_handle_upload', $file, 'upload');
}