Код: Выделить всё
fetch(ajax_object.ajax_url, {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
body: new URLSearchParams({
action: "uipp_get_button_content",
button_id: button_id,
}),
})
.then(response => response.json())
.then(data => {
if (data.success) {
revealContentWrapper.innerHTML = data.data.content;
console.log("Loaded content:", data.data.content);
reinitializeScripts(revealContentWrapper); // Ensures scripts run properly
} else {
revealContentWrapper.innerHTML = `
Error: ${data.message}
`;
}
})Обратите внимание, что я настроил этот пользовательский пост для редактируемого в Гутенберге, так как мне нужно, чтобы он мог держать блоки.>
Подробнее здесь: https://stackoverflow.com/questions/795 ... ay-scripts
Мобильная версия