Support

Account

Home Forums General Issues Relationship without link for draft pages Reply To: Relationship without link for draft pages

  • You need to test the status when looping over the fields in the relationship field

    
    $directors = get_field('directors');
    foreach ($directors as $director) {
      if ($director->post_status != 'publish') {
        // not published, skip it
        continue;
      }
    }