| 1 |
;(function($) { |
| 2 |
$.fn.extend({ |
| 3 |
/** |
| 4 |
* Custom jQuery serialize wrapper. |
| 5 |
* |
| 6 |
* When WordPress 5.6 increased the jQuery version to 3.5.1, the serialize function changed. Instead of |
| 7 |
* sending spaces as "+", they are sent as "%20". This wrapper is for backwards compatibility. |
| 8 |
* |
| 9 |
* @todo This function is duplicated in both the frontend and backend. Need to have the code live in |
| 10 |
* just one location. |
| 11 |
* |
| 12 |
* @since 1.6.7 |
| 13 |
*/ |
| 14 |
weSerialize: function() { |
| 15 |
return $( this ).serialize().replaceAll( '%20', '+' ); |
| 16 |
}, |
| 17 |
}); |
| 18 |
})(jQuery); |