I trying to hook a function into save_post like this:
function my_function($post_ID) {
    var_dump($post_ID);
}
add_action('save_post', 'my_function');
The problem is that it's not doing anything, I'm using the var_dump as example but it should at least print the $post_ID variable when I edit/publish a post.
Am I missing something? Thanks in adv开发者_StackOverflow中文版ance!
Where are you using this? As far as I know, the "save_post" hook is only executed in the admin section, so you won't see anything if you are trying to run this outside of it.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论