Support

Account

Home Forums Front-end Issues Querying user connected to a custom post type via relationship field Reply To: Querying user connected to a custom post type via relationship field

  • 
    $args = array(
      'role' => 'Attorneys',
      'meta_query' => array(
        array(
          'key' => 'service_areas', // name of custom field
          'value' => '"' . $post->ID . '"', // matches exactly "123", not just 123. This prevents a match for "1234"
          'compare' => 'LIKE'
        )
      )
    );