In my plugin I want to update sitemap every time page or post is created/modified. To achieve this I use
add_action( 'save_post', 'update_sitemap', 10, 3);
Upon creating/saving/updating/deleting any page my callback method
update_sitemap is fired but when i create/save/update/delete any post it doesn't seem to fire callback
I tested this for custom post types and it works immediately like for pages.
When I add 2 new regular posts, callback method is called once. Only after any further modification callback for 2nd post is fired.
Is this expected behaviour for