Add extra field into post that contain value from other filter

I want to add extra field that has details about uploaded item – $file , that comes from another filter wp_handle_upload_prefilter

Code as such :

add_filter(‘wp_handle_upload_prefilter’, ‘functionA’);
function functionA( $file ) {
return $file;
}

add_filter( ‘plupload_default_params’, function( $params ) : array {
// $params[‘fileDetails’] = ‘filename.jpg’; // this works but hardcoded
$params[‘fileDetails’] = $file;
return $params;
});

Is this possible?

Read more here:: Add extra field into post that contain value from other filter

Leave a Reply

Your email address will not be published. Required fields are marked *