diff --git a/README.md b/README.md index 3e562adee..c609d50f1 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,11 @@ https://www.youtube.com/watch?v=dJrykKQGDcs ## Changelog ## +### 4.7.3 + +* FIXED + * Resolved jQuery Migrate dependency to prevent JS errors. + ### 4.7.2 * FIXED diff --git a/app/main/RTMedia.php b/app/main/RTMedia.php index 9469e0d64..8a16b3e59 100755 --- a/app/main/RTMedia.php +++ b/app/main/RTMedia.php @@ -1216,12 +1216,12 @@ public function create_table_error_notice() { /** * Ensure WordPress 6.7 compatibility by handling jQuery Migrate dependency. * WordPress 6.7 removed jQuery Migrate by default, which can break plugins using deprecated jQuery methods. - * + * * @since 4.6.23 */ public function ensure_wp67_compatibility() { global $wp_version; - + // Check if we're running WordPress 6.7 or higher if ( version_compare( $wp_version, '6.7', '>=' ) ) { // Enqueue jQuery Migrate if not already enqueued to maintain backward compatibility @@ -1234,15 +1234,15 @@ public function ensure_wp67_compatibility() { /** * WordPress 6.7 compatibility scripts enqueue. * Ensures jQuery Migrate is available early in the loading process. - * + * * @since 4.6.23 */ public function wp67_compatibility_scripts() { - global $wp_version; - + global $wp_version; + // Enqueue jQuery Migrate for WordPress 6.7+ compatibility if ( version_compare( $wp_version, '6.7', '>=' ) ) { - if ( ! wp_script_is( 'jquery-migrate', 'enqueued' ) ) { + if ( wp_script_is( 'jquery', 'enqueued' ) && ! wp_script_is( 'jquery-migrate', 'enqueued' ) ) { wp_enqueue_script( 'jquery-migrate' ); } } @@ -1251,12 +1251,12 @@ public function wp67_compatibility_scripts() { /** * WordPress 6.7 MediaElement.js compatibility initialization. * Ensures MediaElement is properly initialized in WordPress 6.7+ - * + * * @since 4.6.23 */ public function wp67_media_element_init() { global $wp_version; - + if ( version_compare( $wp_version, '6.7', '>=' ) ) { ?>