Skip to content

u/shkico

In this archive from May 2016 to Feb 2023

151
posts
200
comments
11
media
658
score
1 saved before deletion

Top posts

How to use fetch to post data to WordPress?

I am trying to replace jQuery code with vanilla JS, how can I post data to Wordpress? For the following code I get error in console 400 (Bad Request) fetch('http://localhost/mywebsite/wp-admin/admin-ajax.php', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({...

8 points9 comments
Open on Reddit

Top comments

Subreddits

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.