WordPress Developer Ukraine, Kyiv
Replace jQuery AJAX with the Fetch API and AbortController in WordPress Themes

Replace jQuery AJAX with the Fetch API and AbortController in WordPress ...

Replace jQuery AJAX with fetch() and AbortController in WordPress themes WordPress AJAX handlers still run through admin-ajax.php on the server, but the client code can drop $.ajax() for the native fetch() with async/await. Two details are specific to WordPress. The wp_send_json_*() functions report success or failure in the success field of the JSON, so checking…
Customize and Style a Google Form on Your WordPress Site

Customize and Style a Google Form on Your WordPress Site

Customize a Google Form for your WordPress site Usually a contact form on WordPress is Contact Form 7 plus a plugin that saves the entries to the database, such as CFDB7. Sometimes a client prefers Google Forms, because the answers land in Google Sheets. Embedding the form as an <iframe> takes a minute, but the…
How to Handle AJAX Requests in WordPress with wp_ajax

How to Handle AJAX Requests in WordPress with wp_ajax

Handle AJAX requests in WordPress with wp_ajax WordPress has its own AJAX entry point: every request goes to wp-admin/admin-ajax.php with an action parameter, and WordPress calls the PHP function registered for that action. All of WordPress is loaded, so in the handler you can use any function, check the user and work with the database.