-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
trim() is deprecated in the forthcoming jQuery 4 #1527
Comments
This is the list of deprecated functions in jQuery 4: https://blog.jquery.com/2024/02/06/jquery-4-0-0-beta/ It would be wise to replace them with equivalent vanilla JS functions as soon as possible. |
WordPress 6.8 will ship jQuery 4.0: https://make.wordpress.org/core/2024/08/23/updating-jquery-shipped-with-wordpress-to-version-4-0/ |
+1 |
Hello @mrleemon, See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim However, thanks to point it to us. We opened a task about jQuery 4.0. |
@mrleemon FYI all of our plugins aren't concerned by deprecated jQuery APIs removed in its future 4.0 release. With jQuery 3, a conversion (any data passed as an object is converted to string) is done before |
The breaking changes introduced in jQuery 4 ➡ jquery/jquery#5197 |
As jQuery will be introduced in WordPress 6.8, we decided not to fix the issue in our next release. What?The difference between jQuery ajax code in jQuery 3.x and 4.x is that Ajax request data are converted to a string before applying prefilters.
Note:
How?We have 2 options to fix it:
|
I tried your plugin with the Test jQuery Updates plugin which ships with jQuery 4.0 beta, and Polylang throws a
trim() is not a function
error here:https://github.com/polylang/polylang/blob/bcc11ff89075b8d483aa17f44458714f8999f890/admin/admin-base.php#L335C74-L335C78
The text was updated successfully, but these errors were encountered: