Support

Account

Home Forums General Issues search specific ACF field in admin/Posts Reply To: search specific ACF field in admin/Posts

  • Instead of doing the query to get a list of all avialble fields, construct an array with the field that you want to search.

    
    $fields = array(
      'field_1',
      'field_2',
      'field_3',
      'field_4',
      'etc...'
    );
    

    then alter the code used to display the field to use this new array

    
    foreach ($fields as $field) {
    	printf('<option value="%s"%s>%s</option>', $field, $field == $current? ' selected="selected"':'', $field);
    }