When I publish a post on WordPress from ADMIN area, the hook "wp_insert_post" works fine:
function testing( $post_id, $post, $update ) {
error_log('testing');
}
add_action('wp_insert_post', 'testing', 10, 3);
But when I publish from PUBLIC area (and there are no errors here), even using wp_insert_post to publish the post, the function above isn't called.
Why does it happen? And is it possible to solve that?