- $sendback = admin_url( 'edit.php' );
- $sendback .= ( ! empty( $post_type ) ) ? '?post_type=' . $post_type : '';
+ if ( 'attachment' == $post_type ) {
+ $sendback = admin_url( 'upload.php' );
+ } else {
+ $sendback = admin_url( 'edit.php' );
+ $sendback .= ( ! empty( $post_type ) ) ? '?post_type=' . $post_type : '';
+ }