You use add_action!
Like this:
function save_id_to_file($post_id){
//use your file creation/save function here
return $post_id;
}
add_action('wp_insert_post','save_id_to_file');
You use add_action!
Like this:
function save_id_to_file($post_id){
//use your file creation/save function here
return $post_id;
}
add_action('wp_insert_post','save_id_to_file');