• Hi, I change code to move files

    class.add-from-server.php
    #lines 212

    if ( isset( $_POST['move'] ) ) {
        if ( false === @rename( $file, $new_file ) )
            return new WP_Error( 'upload_error', sprintf( __( 'The selected file could not be copied to %s.', 'add-from-server' ), $uploads['path'] ) );
    
    } else {
        if ( false === @copy( $file, $new_file ) )
            return new WP_Error( 'upload_error', sprintf( __( 'The selected file could not be copied to %s.', 'add-from-server' ), $uploads['path'] ) );
    }

    #lines 498

    <p><?php
    printf(
        __( '<strong>Move Files:</strong> %s', 'add-from-server' ),
        '<label><input type="checkbox" checked id="move" name="move" value="1"></label>'
    );
    ?></p>
    • This topic was modified 2 years, 3 months ago by Hrohh.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘PATCH – move instead copy’ is closed to new replies.