The only way to remove the notice is to ensure all your plugins/theme code don’t rely on any old jQuery functionality, and then remove the migrate script:
add_action( 'wp_default_scripts', function( $scripts ) { if ( ! empty( $scripts->registered['jquery'] ) ) { $jquery_dependencies = $scripts->registered['jquery']->deps; $scripts->registered['jquery']->deps = array_diff( $jquery_dependencies, array( 'jquery-migrate' ) ); } } );
移除通知的唯一方法是确保所有插件/主题代码不依赖于任何旧jQuery功能,然后删除迁移脚本: