Refactor unsupported currency notice to show only on payment pages and under the PayPal plugin.

This commit is contained in:
Pedro Silva 2023-08-11 10:35:50 +01:00
parent 402b87face
commit 1b87257fdb
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
10 changed files with 131 additions and 22 deletions

View file

@ -0,0 +1,14 @@
// This function is needed because WordPress moves our custom notices to the global placeholder.
function moveWrappedElements() {
(($) => {
$('*[data-ppcp-wrapper]').each(function() {
let $wrapper = $('.' + $(this).data('ppcpWrapper'));
if ($wrapper.length) {
$wrapper.append(this);
}
});
})(jQuery)
}
export default moveWrappedElements;