Home Forums General Issues acf/save_post on specific form Reply To: acf/save_post on specific form

  • Perfect, thank you for that.

    Would this also be suitable to do if I want to differ from posts that are new or updated?

    Or is there a better solution for identifying if the post already exists or if it is new with acf/save_post? Because I want to send an email to the author when they create the post but not when they update it.

    I send an url query that identifies if the form should update an existing post or create a new one (by sending post=79 for example). I also use some checks to identify if it is the correct author.

    if(isset($_GET['post'])) {
    		$post_id = $_GET['post'];
    	$correct_author = true;
    	if(empty($post_id)) {
    		$post_id = 'new_post';
    		$submit_value = 'create';
    	} else {
    		$submit_value = 'update';
    		$post_author = get_post_field('post_author', $post_id);
    		$current_user = get_current_user_id();
    		if( $post_author == $current_user ) {
    			$correct_author = true;
    		} else {
    			$correct_author = false;
        'html_after_fields' => '<input type="hidden" name="acf[' . $submit_value .']" value="true"/>',