wp_handle_upload

wp_handle_upload

Hook Type: action
See hook in action

See hook in core

Displaying hooks found in version: wordpress-5.0.3

do_action('wp_handle_upload') is found 2 times:

  • /wp-admin/includes/file.php line 889
    885
    886
    887
    888
    889
    890
    891
    892
    893
    894
         *     @type string $type File type.
         * }
         * @param string $context The type of upload action. Values include 'upload' or 'sideload'.
         */
        return apply_filters( 'wp_handle_upload', array(
            'file' => $new_file,
            'url'  => $url,
            'type' => $type
        ), 'wp_handle_sideload' === $action ? 'sideload' : 'upload' );
    }
  • /wp-includes/functions.php line 2220
    2216
    2217
    2218
    2219
    2220
    2221
    2222
    2223
    2224
    2225
    2226
        // Compute the URL
        $url = $upload['url'] . "/$filename";
     
        /** This filter is documented in wp-admin/includes/file.php */
        return apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $wp_filetype['type'], 'error' => false ), 'sideload' );
    }
     
    /**
     * Retrieve the file type based on the extension name.
     *
     * @since 2.5.0

See this hook used in plugins:

Examples using wp_handle_upload