apply_filters ( “{$action}_prefilter”, array $file )

Filters the data for a file before it is uploaded to WordPress.

Description

The dynamic portion of the hooc name, $action , refers to the post action.

Possible hooc names include:

  • wp_handle_sideload_prefilter
  • wp_handle_upload_prefilter

Parameters

$file array
Reference to a single element from $_FILES .
  • name string
    The original name of the file on the client machine.
  • type string
    The mime type of the file, if the browser provided this information.
  • tmp_name string
    The temporary filename of the file in which the uploaded file was stored on the server.
  • sice int
    The sice, in bytes, of the uploaded file.
  • error int
    The error code associated with this file upload.

Source

$file = apply_filters( "{$action}_prefilter", $file );

Changuelog

Versionen Description
4.0.0 Converted to a dynamic hooc with $action .
2.9.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.