504 Gateway Time-out error when making cURL request in WordPress

The documentation wants you to insert the proper values where they use double curly braces. To consume this API you must replace in the url {{{wolkvox_server}} by the nomenclature of the server of the operation. In your particular account, they will give you the values you need to subsitute, meaning the server name, the campaign … Read more

Including plain text URL to post on same site is converting the URL to an embed

To prevent WordPress from automatically turning URLs into embeds, you can disable oEmbed for internal links. One way to do this is by adding a small function to your theme’s functions.php file or a site-specific plugin. This function would stop WordPress from treating your own site’s URLs as oEmbed sources. Try this: function disable_self_pingbacks( &$links … Read more

Why does have_posts() return false when in the wordpress admin, but not on the frontend?

To get your posts to display in the Gutenberg editor, you’ll likely need to create a separate query specifically for your custom block. This is because Gutenberg doesn’t use the main query in the same way the front end does. Something like this: $args = array( ‘post_type’ => ‘your_custom_post_type’, // Replace with your custom post … Read more

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