A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

I guess you are using Gutenberg in which case this is non-trivial problem. Gutenberg saves post data in two steps (two separate http requests, just use developer tools in your browser to check). First, using REST API it saves Gutenberg-ready fields including title, content and slug. Problem is, REST API uses JSON and $_POST is empty array during this save ...


So, we figured out what it was. In the options table (wp_options for some, we chose to do away with the wp prefix), there's a user_roles (or wp_user_roles value). One of the plugins we used (Yoast SEO in this case) had an update that zapped the value of that option, removing the Administrator role from that list. As a result, no admin could log into the ...


The problem is that, you have added extra white space before wp_ajax action. remove space from actions ' wp_ajax_my_action' and ' wp_ajax_nopriv_my_action'. because of extra space before ajax request, showing the 400 bad request error. You should use : add_action('wp_ajax_my_action', 'my_action'); add_action('wp_ajax_nopriv_my_action', 'my_action');

Only top voted, non community-wiki answers of a minimum length are eligible