| @@ -178,8 +178,12 @@ | ||
| 178 | 178 | if ( ! $attachment->id ) { |
| 179 | 179 | wp_send_json_error( 'Something went wrong!', 500 ); |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | + // Record who uploaded it so that only they can later bind it | |
| 183 | + // to a ticket. | |
| 184 | + WPSC_Attachment::set_uploader( $attachment ); | |
| 185 | + | |
| 182 | 186 | return new WP_REST_Response( |
| 183 | 187 | array( |
| 184 | 188 | 'id' => intval( $attachment->id ), |
| 185 | 189 | 'name' => $attachment->name, |