title: How to uncheck an acf checkbox with delete_post_meta
body: <p>I'm working on a wp plugin where people can join/unjoin an event. </p>
  
  <p><strong>What I've done so far:</strong></p>
  
  <p>I've made a custom post type 'tickets' with a ACF checkbox that is dynamically populated with post titles of 'Event' posts. On a single Event people can click a button which will create a ticket post with the checked value of the ACF checkbox. If the user already has a ticket, it will update the ticket post. This all works great. </p>
  
  <p><strong>What I want:</strong></p>
  
  <p>When the user wants to unjoin the event, the acf value must be unchecked. I've tried several things like <code>delete_post_meta($RegisterTicket, 'my_custom_field', $eventname );</code></p>
  
  <p><strong>Part of the code:</strong></p>
  
  <p>Before this part of code I define if the ticketpost must be created or updated. Then the following:</p>
  
  <pre><code>/* Get the current field state */     
      $field_checked = get_field($field_key, $mypostid);             
  
              /* Check if the posttitle already is checked, if so delete_post_meta */
              if(is_array($field_checked) &amp;&amp; in_array($eventname, $field_checked)) { 
  
                delete_post_meta($RegisterTicket, 'my_custom_field', $eventname );
  
              }  else {
                /* if not already checked, add the title to the array so it will be checked and update_post_meta */
                $field_checked[] = $eventname;      
                update_post_meta($RegisterTicket, 'my_custom_field', $field_checked );
              }  
  
  
          update_post_meta($RegisterTicket, 'user', $TheUserID); 
  </code></pre>
  
  <p>The delete_post_meta is not working, the checked value is not getting unchecked. How to solve this? Thanks in advance.</p>