• mothmenace

    (@mothmenace)


    Hello, I am trying to update a post entry after it has been saved. I am trying:

    add_action("save_post", 'my_func');
    
    function my_func($id)
    {
    	if(wp_is_post_revision($id) || wp_is_post_autosave($id)) return;
    
    	wp_update_post( array('ID'=>$id, ... ) );
    }

    but this causes an infinite recursion loop. Is this possible with the action hooks architecture? Or do I need to use a query? Thanks.

  • The topic ‘call wp_update_post() from save_post action’ is closed to new replies.