| @@ -10,24 +10,9 @@ | ||
| 10 | 10 | $(this).width(liw-s); |
| 11 | 11 | }); |
| 12 | 12 | }); |
| 13 | 13 | }; |
| 14 | - $.fn.extend({ | |
| 15 | - /** | |
| 16 | - * Custom jQuery serialize wrapper. | |
| 17 | - * | |
| 18 | - * When WordPress 5.6 increased the jQuery version to 3.5.1, the serialize function changed. Instead of | |
| 19 | - * sending spaces as "+", they are sent as "%20". This wrapper is for backwards compatibility. | |
| 20 | - * | |
| 21 | - * @todo This function is duplicated in both the frontend and backend. Need to have the code live in | |
| 22 | - * just one location. | |
| 23 | - * | |
| 24 | - * @since 1.6.7 | |
| 25 | - */ | |
| 26 | - weSerialize: function() { | |
| 27 | - return $( this ).serialize().replaceAll( '%20', '+' ); | |
| 28 | - }, | |
| 29 | - }); | |
| 14 | + | |
| 30 | 15 | window.WP_User_Frontend = { |
| 31 | 16 | |
| 32 | 17 | init: function() { |
| 33 | 18 | |
| @@ -322,9 +307,9 @@ | ||
| 322 | 307 | e.preventDefault(); |
| 323 | 308 | |
| 324 | 309 | var self = $(this), |
| 325 | 310 | form = $(this).closest('form'), |
| 326 | - form_data = form.weSerialize() + '&action=wpuf_draft_post', | |
| 311 | + form_data = form.serialize() + '&action=wpuf_draft_post', | |
| 327 | 312 | post_id = form.find('input[type="hidden"][name="post_id"]').val(); |
| 328 | 313 | |
| 329 | 314 | var rich_texts = [], |
| 330 | 315 | val; |
| @@ -368,9 +353,9 @@ | ||
| 368 | 353 | account_update_profile: function (e) { |
| 369 | 354 | e.preventDefault(); |
| 370 | 355 | var form = $(this).closest('form'); |
| 371 | 356 | |
| 372 | - $.post(wpuf_frontend.ajaxurl, form.weSerialize(), function (res) { | |
| 357 | + $.post(wpuf_frontend.ajaxurl, form.serialize(), function (res) { | |
| 373 | 358 | if (res.success) { |
| 374 | 359 | form.find('.wpuf-error').hide(); |
| 375 | 360 | form.find('.wpuf-success').show(); |
| 376 | 361 | } else { |
| @@ -660,9 +645,9 @@ | ||
| 660 | 645 | |
| 661 | 646 | return false; |
| 662 | 647 | } |
| 663 | 648 | |
| 664 | - var form_data = self.weSerialize(), | |
| 649 | + var form_data = self.serialize(), | |
| 665 | 650 | rich_texts = []; |
| 666 | 651 | |
| 667 | 652 | // grab rich texts from tinyMCE |
| 668 | 653 | $('.wpuf-rich-validation', self).each(function (index, item) { |