Skip to content
This repository was archived by the owner on Aug 22, 2025. It is now read-only.

Commit 9e8de97

Browse files
Merge pull request #136 from dharmin/fix/activity-replacement
Fix file replacement on activity
2 parents aee8ba0 + a5d0e12 commit 9e8de97

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

admin/rt-transcoder-handler.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,6 @@ public function usage_widget() {
672672
* @return url
673673
*/
674674
public function add_media_thumbnails( $post_array ) {
675-
676675
$defaults = array(
677676
'post_id' => '',
678677
'job_for' => '',
@@ -836,6 +835,7 @@ public function add_transcoded_files( $file_post_array, $attachment_id, $job_for
836835
$download_url = urldecode( urldecode( $file ) );
837836
$new_wp_attached_file_pathinfo = pathinfo( $download_url );
838837
$post_mime_type = 'mp4' === $new_wp_attached_file_pathinfo['extension'] ? 'video/mp4' : 'audio/mp3';
838+
$attachemnt_url = wp_get_attachment_url( $attachment_id );
839839
try {
840840
$response = function_exists( 'vip_safe_wp_remote_get' ) ? vip_safe_wp_remote_get( $download_url ) : wp_remote_get( $download_url ); // @codingStandardsIgnoreLine
841841
} catch ( Exception $e ) {
@@ -907,7 +907,6 @@ public function add_transcoded_files( $file_post_array, $attachment_id, $job_for
907907
if ( 'rtmedia' === $job_for ) {
908908
$activity_id = $media[0]->activity_id;
909909
if ( $activity_id ) {
910-
$attachemnt_url = wp_get_attachment_url( $attachment_id );
911910
$content = $wpdb->get_var( $wpdb->prepare( "SELECT content FROM {$wpdb->base_prefix}bp_activity WHERE id = %d", $activity_id ) );
912911

913912
/* for WordPress backward compatibility */

0 commit comments

Comments
 (0)