Save post action is called twice

I noticed there was a 302 redirect in my network tab while saving. Save_post was being triggered twice, once from Inside my call, I simply included: $referrer = wp_get_referer(); if (strpos($referrer, ‘http:’) !== false) { error_log(“not the right referrer, aborting”); return; } Issue solved.

Use value from ACF to populate other fields

Untested, but if I understand you correctly, try something like this: $results = new WP_Query( array ( ‘post_id’ => ‘<id-here>’, ‘post_type’ => ‘acf-field’, //not necessary, but insurance ‘post_excerpt’ => ‘<custom-field-name>’, //not necessary, but insurance ‘meta_query’ => array ( ‘key’ => ‘<custom-field-name>’, ) ) );

WordPress sent multiple requests on update

I found a solution: function myAction() { if(defined(“REST_REQUEST”) && REST_REQUEST) { return; } // Do action stuff } The request to /wp-json/wp/v2/pages/1373 is a request to the API which defines the constant REST_REQUEST and sets it to true. If anyone’s got an idea why an extra API request is sent, please feel free to add … Read more