I'm trying to display $_FILES in wp-admin, and I've been using add_filter and apply_filter, but it does not seem to show the $_FILES array values. My goal is to show the values in $_FILES so I can upload it to a specified directory (But this is going to be in the future).

Upload Screen Meta Box

function upload_screen() { 
  echo "<br>";
  echo 'Upload Files<input type="file" name="" /><br>';

The next function should return the file array (this is where the problem lies). So I tried using add_filter, but does not seem to work.

File Upload Function but return $file array for now.

function demo_fileupload($file) {
  return $file;

Add Filter


1 Answer 1


In order to show $_FILES or $_POST, you will need to create a sumbenu_page under the post_type. Then, you will be able to manipulate $_FILES and $_POST in whichever way you want.

This means that upload_screen() function should be a submenu page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.