Support

Account

Home Forums Front-end Issues Unable to detect new_post on acf_form Reply To: Unable to detect new_post on acf_form

  • Thanks for the reply!

    Here is the filter function.

    function sl_acf_pre_new_startup( $post_id ) {
    
    	if( $post_id != 'new' ) :
    
    		write_log('not new'); 
    		return $post_id; 
    
    	else: 
    
    		write_log($post_id); 
    		return $post_id; 
    
    	endif; 
    
    }
    add_filter( 'acf/pre_save_post' , 'sl_acf_pre_new_startup', 10, 2 );

    Using the above, it only ever returns “not new” even though it’s creating (successfully) a new post.