Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_handle_upload

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
939       * @param array  $upload {
940       *     Array of upload data.
941       *
942       *     @type string $file Filename of the newly-uploaded file.
943       *     @type string $url  URL of the newly-uploaded file.
944       *     @type string $type Mime type of the newly-uploaded file.
945       * }
946       * @param string $context The type of upload action. Values include 'upload' or 'sideload'.
947       */
948      return apply_filters(
949           'wp_handle_upload',
950           array(
951                'file' => $new_file,
952                'url'  => $url,
953                'type' => $type,
954           ),
955           'wp_handle_sideload' === $action ? 'sideload' : 'upload'
956      );
957 }