pre_move_uploaded_file

pre_move_uploaded_file

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.7.2

apply_filters('pre_move_uploaded_file') is found 1 times:

  • /wp-admin/includes/file.php line 1010
    1006
    1007
    1008
    1009
    1010
    1011
    1012
    1013
    1014
    1015
    1016
    * }
     * @param string   $new_file      Filename of the newly-uploaded file.
     * @param string   $type          Mime type of the newly-uploaded file.
     */
    $move_new_file = apply_filters( 'pre_move_uploaded_file', null, $file, $new_file, $type );
     
    if ( null === $move_new_file ) {
        if ( 'wp_handle_upload' === $action ) {
            $move_new_file = @move_uploaded_file( $file['tmp_name'], $new_file );
        } else {
            // Use copy and unlink because rename breaks streams.