Support

Account

Home Forums General Issues Default values for sub field: Post Object Reply To: Default values for sub field: Post Object

  • I’m not sure if this is helpful to you, but I just got a similar filter to work when the Post Object sub-field of the Repeater has the Return Format set to “Post ID”. With this setting, I just passed in the appropriate post_id as the value in the filter. So with your code above it’d be something like:

    if ($value === false) {
    
        $value = array();
        $post_id_1 = 28;
        $post_id_2 = 24;
      
        $value[] = array(
          'field_5e23ef3a22ea6' => $post_id_1, // post_id of the 1st Gas post that you want to choose
          'field_5e23f00922ea7' => '0'
        );
        $value[] = array(
          'field_5e23ef3a22ea6' => $post_id_2, // post_id of the 2nd Gas post that you want to choose
          'field_5e23f00922ea7' => '0'
        );
      }
    
      return $value;