From da52a821d5c5f711abfc651140c1d066a70771fe Mon Sep 17 00:00:00 2001 From: krishana7911 Date: Thu, 5 Jun 2025 10:09:11 +0530 Subject: [PATCH 1/4] Remove inline annotation --- app/main/RTMedia.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/main/RTMedia.php b/app/main/RTMedia.php index 2efc61ff6..f5018232c 100755 --- a/app/main/RTMedia.php +++ b/app/main/RTMedia.php @@ -1267,7 +1267,7 @@ public function enqueue_scripts_styles() { 'rtmedia-emoji-picker', ), RTMEDIA_VERSION, - args: true + true ); } else { wp_enqueue_script( From 3091670bb07f70e06dac5a4c3a1fdfb73211d4e5 Mon Sep 17 00:00:00 2001 From: krishana7911 Date: Thu, 5 Jun 2025 10:52:48 +0530 Subject: [PATCH 2/4] Update rtmedia functions --- .../template/rtmedia-functions.php | 302 ++++++++++-------- 1 file changed, 163 insertions(+), 139 deletions(-) diff --git a/app/main/controllers/template/rtmedia-functions.php b/app/main/controllers/template/rtmedia-functions.php index a2c53b6b7..f919646c9 100644 --- a/app/main/controllers/template/rtmedia-functions.php +++ b/app/main/controllers/template/rtmedia-functions.php @@ -593,23 +593,20 @@ function rtmedia_media( $size_flag = true, $echo = true, $media_size = 'rt_media // Check if Godam plugin is active. if ( defined( 'RTMEDIA_GODAM_ACTIVE' ) && RTMEDIA_GODAM_ACTIVE ) { $html .= do_shortcode( '[godam_video id="' . esc_attr( $rtmedia_media->media_id ) . '"]' ); + } elseif ( empty( $youtube_url ) ) { + $html .= sprintf( + '', + esc_url( ! empty( $rtmedia_media->cover_art ) ? $rtmedia_media->cover_art : '' ), + esc_url( wp_get_attachment_url( $rtmedia_media->media_id ) ), + $size_attr, + esc_attr( $rtmedia_media->id ) + ); } else { - // Fallback to native or YouTube player. - if ( empty( $youtube_url ) ) { - $html .= sprintf( - '', - esc_url( $rtmedia_media->cover_art ?: '' ), - esc_url( wp_get_attachment_url( $rtmedia_media->media_id ) ), - $size_attr, - esc_attr( $rtmedia_media->id ) - ); - } else { - $html .= sprintf( - '', - esc_attr( $rtmedia_media->id ), - esc_url( $youtube_url ) - ); - } + $html .= sprintf( + '', + esc_attr( $rtmedia_media->id ), + esc_url( $youtube_url ) + ); } $html .= ''; @@ -997,7 +994,7 @@ function rtmedia_delete_allowed() { global $rtmedia_media; $flag = false; - if ( $rtmedia_media !== null && isset( $rtmedia_media->media_author ) ) { + if ( null !== $rtmedia_media && isset( $rtmedia_media->media_author ) ) { $flag = intval( $rtmedia_media->media_author ) === get_current_user_id(); } if ( ! $flag && isset( $rtmedia_media->context ) && 'group' === $rtmedia_media->context && function_exists( 'bp_group_is_admin' ) ) { @@ -1025,7 +1022,7 @@ function rtmedia_edit_allowed() { global $rtmedia_media; $flag = false; - if ( $rtmedia_media !== null && isset( $rtmedia_media->media_author ) ) { + if ( null !== $rtmedia_media && isset( $rtmedia_media->media_author ) ) { $flag = intval( $rtmedia_media->media_author ) === get_current_user_id(); } if ( ! $flag ) { @@ -1482,13 +1479,13 @@ function rmedia_single_comment( $comment, $count = false, $i = false ) { if ( defined( 'RTMEDIA_GODAM_ACTIVE' ) && RTMEDIA_GODAM_ACTIVE ) { global $wpdb; - // Replace all