Home Forums Backend Issues (wp-admin) Why isn't acf/save_post firing? Reply To: Why isn't acf/save_post firing?

  • Yes, of course. Here is the function code:

    	function send_checklist_publish( $new_status, $old_status, $post )
    	    if ( 'publish' !== $new_status
    	        or 'checklist' !== get_post_type( $post ) )
    				$post_type = get_post_type( $post ); //get post type
    				$titles = new WP_Query(array('post_type' => $post_type, 'p' => $post->ID));
    				$categories = get_the_category();
    				$category = $categories[0]->name;
    				$response = get_the_terms( $post->ID, 'Response_Category' );
    				$problematic = get_field('would_you_consider_this_film_problematic');
                    $subject_line = $_POST['fields']['subject_line'];
    				if($problematic == 'Yes'):
    					$problematic_response = "*Be advised upon ingest, it was recognized that this title is problematic.* <br/><br/>";
    				//Get Author's Name
    				$userID =  get_the_author_id();
    				$user_info = get_userdata( $userID );
    				$first_name = $user_info->first_name;
    				$last_name = $user_info->last_name;
    				if($response[0]->slug == "send-check-list-email"){ //Send email if checked
    			        $lists = array(...); // This is an array of all of our email addresses. Pulled to avoid spam, and already verified this is not the code causing the issue.
    				$email = array();
    				$terms = get_the_terms( $post->ID, 'Distro_Category' );
    				foreach ( $terms as $term ) {
    				if (array_key_exists($term->name,$lists))
    				  	$term_name = $term->name;
    					$i = 0;
    					foreach($lists[$term_name] as $list){ //Loop through users on the Distro List
    					$getUser = get_user_by( 'email', $list );
    					$networks = get_user_meta( $getUser->ID, 'networks', true );
    						$emails[] = $list;
    				   	 }  //End foreach
    				$postid = get_the_ID();
    				//$postid = 30104;
    				$body =  'Hello:
    				'.get_the_title().' has been ingested and placed in ISIS. You can view the checklist here:
    				<a href='.get_permalink($post->ID).'>'.get_permalink($post->ID).'</a>
    				Thank You, <br/>
    				'.$first_name.' '.$last_name.' <br/>
    				Ingest Ops';
    				//Email Headers
    				$headers = "From:  Network Database <>";
                    wp_mail( $emails, $subject_line . ': '.get_the_title().'', $body, $headers );

    Also, I don’t mind adding the update_field function in to test, but since both add_actions are calling the same function (send_checklist_publish), wouldn’t it be correct to believe that the acf/save_post hook isn’t getting fired since it doesn’t send out an email when the transition_post_status does send out an email? Or is there something I’m missing.