Support

Account

Home Forums Backend Issues (wp-admin) update_field if field is empty else continue Reply To: update_field if field is empty else continue

  • Must of the time the field vale will be false or NULL if it is empty. You need to check for empty

    
    if(empty(get_field($term_id)) {
    

    this might also work

    
    if (!get_field($term_id)) {
    

    However, this could be a problem if the actual value of the field is something that evaluates to empty but is a valid value, for example an empty string, 0, false, etc. So depending on the type of field you might need to check for different things.