Support

Account

Home Forums ACF PRO Filter relationship field of post type Reply To: Filter relationship field of post type

  • @hube2

    In the above function, is it possible to get the post_type somehow?

    I am thinking to use this same field in more post_types, so it would be nice if I could do something like:

    if ('places' = $post_type) {
      $meta_query = array(
        array(
          'key' => 'place',
          'value' => $post_id,
          'compare' => 'LIKE'
        )
      );
      $args['meta_query'] = $meta_query;
    }

    I tried global $typenow but it didn’t do it.

    My other option is to create additional field groups…