Trouble trying to automatically save checklist items which clicked

Solved by using Content-Type: application/x-www-form-urlencode with new URLSearchParams(body).toString() instead of JSON.stringify(body). autosave-checklist.js details.addEventListener(‘change’, () => { fetch(autosaveChecklist.ajaxUrl + ‘?action=autosave_checklist’, { method: ‘POST’, body: new URLSearchParams({ action : ‘autosave_checklist’, option: ‘details-checkbox’, item: details.checked }).toString(), headers: { ‘Content-Type’: ‘application/x-www-form-urlencoded’, }, }) .then(res => console.log(res)) .catch(err => console.error(err));; }); socials.addEventListener(‘change’, () => { fetch(autosaveChecklist.ajaxUrl, { method: ‘POST’, body: … Read more

How to save custom form data in wp_options table

@Buttered_Toast’s solutions is what you are looking for, if you were in a position to use it. There are a bunch of problems with your code. Variables $confused_about_treatment_editor, $estimated_price_editor, and $satisfaction_guarantee_editor are never instantiated. The values of $option_name and $option_valueare changed three times, but only the last value is ever used. There is no closing … Read more

tech