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 you answer.
Related Posts:
- Why does save_post action fire when creating a new post?
- Unable to prevent function using save_post firing twice
- Exclude trash from save_post
- Call add_action() in function wordpress
- Write automatic title at save_post (infinite loop)
- Add meta field after post has been published
- Create post revision on slug change
- Can’t Get Metabox Data Saved Assistance Needed
- Run a function on all posts
- save_post not triggered when a post is updated
- Add Tag to post after publishing
- save_post action not firing when save
- save post running twice and creating two database entries – how do I disable this?
- A way to see real changes of posts inside an action?
- remove_action or remove_filter with external classes?
- How to know what priority to use with add_action()?
- Return $post_id when DOING_AUTOSAVE?
- Difference between do_action_ref_array() and do_action()
- Can my “add_action” function know the name of the hook calling it?
- Why is there both a save_post and wp_insert_post action?
- Can an action callback prevent the parent from continuing execution?
- remove_action in a theme
- add_action ‘manage_posts_custom_column’ in a class [closed]
- Cron jobs in a class
- Add something to beginning of the content
- Custom post type save_post action not firing
- When and Where to use wp_insert_post()
- Why can’t I hook into save_posts after admin_init?
- WP Schedule Event – Every Day When First Visitor Comes
- wp_logout action not working
- What would cause the ‘wp’ action to fire twice per page (but only once per post) in Firefox only?
- I don’t understand why I need a lower priority to remove an action with a higher priority to make it work
- WordPress admin WP_table_list show incorrectly
- Manually add admin bar
- Is there a way to expose additional fields to the Bulk Action > Edit functionality?
- do_action pass array argument as reference not copy [duplicate]
- How to check if an action is already fired?
- add_action and wp_head not display content in head section
- Scheduled event won’t fire
- When should I call add_settings_section and add_settings_field?
- use add_action(‘wp_head’) in a widget
- Usage of do_action and add_adction
- WP action is not triggering a do_action() call within?
- Mustn’t do_action be accompanied with a function?
- How to set a different value in the generator meta tag?
- Set default Custom Post Meta Value
- remove_action returns FALSE
- Remove action from shortcode
- How to get $tag to fill into add_action() or add_filter()?
- Adding the hook ‘vc_before_init’ inside a object
- Action hook for editing post
- remove_action returns false regardless of priority
- Is there way to run a code every time when any cron is run?
- How to make an action run in the background?
- Remove Action from Plugin within extended class and no assigned variable
- WP cron doesn’t pass through my arguments
- Action when sidebars updated
- Payment before publishing post
- Why does my wp_safe_redirect output the ERR_TOO_MANY_REDIRECTS error?
- How to access author data from header action
- Content won’t load when using action the_content
- How can I unhook this action that was added via $this?
- add_action on a specific page
- save_post action doesn’t passing post id to my function as argument
- Update media library image shown in “attachment details” when using wp_insert_attachment to add item to the media library
- How to find where an action is triggered? [closed]
- Form action unfamiliar
- Why does my delete_post hook get called twice
- Which hook to add action on specific page?
- What do the numbers mean at the end of add_action(‘save_post’)…?
- Action Scheduler not running
- Adding php to form action breaks code [closed]
- call custom action after delete account
- Dynamic name of cron event
- How can I edit comment meta value before it is saved?
- remove_action: Initial attempt failed while a later attempt worked
- register_post_type not working in wordpress 3.6
- action wp_set_comment_status never gets fired when i change the comment status [closed]
- What do I put in the form action attr on top of form wordpress
- Change or rewrite add to cart button functionality “
- Better use two dedicated methods hooked with add_action() to different actions, or can it be twice the same method?
- admin_notices is not working inside function
- do_action doesn’t trigger if it’s in a template that gets loaded via REST endpoint
- Best hook for when a user session ends?
- add_action where function has arguments
- Load actions and filters only for the admin CPT list
- How to override parent theme actions
- Add Action wp_update_post not Updating WYSWIAG editor
- remove action from woocommerce file
- Can I run a slow action in a seperate thread?
- Font Awesome not loaded on first page of website only – divi theme
- WP_LIST_TABLE bulk action
- Dealing with html forms [closed]
- Cannot Schedule Sending An Email
- OOP – add_action
- do_action in header, add action later?
- Add-action in function
- Plugin that generates a page of post content
- Using add action for class with construct
- Webhook: save_post action fires wp_remote_post twice