title: wp job manager custom filter
body: <p>I am using "wp job manager" and trying to filter/search by a custom field that I have added to the jobs on submission. 
     The plugin author offers a tutorial for adding a dropdown menu to filter an added 'salary' field, and I would like to modify this tutorial to use a text box instead of a dropdown.</p>
  
  <p>The tutorial is located here: <a href="https://wpjobmanager.com/document/tutorial-adding-a-salary-field-for-jobs/" rel="nofollow noreferrer">https://wpjobmanager.com/document/tutorial-adding-a-salary-field-for-jobs/</a></p>
  
  <p>Assuming the data is correctly submitted with the job (in my case it is), the following code allows you to filter the jobs with a dropdown menu, selecting between price ranges.</p>
  
  <pre><code>    add_action( 'job_manager_job_filters_search_jobs_end', 'filter_by_salary_field' );
  function filter_by_salary_field() {
      ?&gt;
      &lt;div class="search_categories"&gt;
          &lt;label for="search_categories"&gt;&lt;?php _e( 'Salary', 'wp-job-manager' ); ?&gt;&lt;/label&gt;
          &lt;select name="filter_by_salary" class="job-manager-filter"&gt;
              &lt;option value=""&gt;&lt;?php _e( 'Any Salary', 'wp-job-manager' ); ?&gt;&lt;/option&gt;
              &lt;option value="upto20"&gt;&lt;?php _e( 'Up to $20,000', 'wp-job-manager' ); ?&gt;&lt;/option&gt;
              &lt;option value="20000-40000"&gt;&lt;?php _e( '$20,000 to $40,000', 'wp-job-manager' ); ?&gt;&lt;/option&gt;
              &lt;option value="40000-60000"&gt;&lt;?php _e( '$40,000 to $60,000', 'wp-job-manager' ); ?&gt;&lt;/option&gt;
              &lt;option value="over60"&gt;&lt;?php _e( '$60,000+', 'wp-job-manager' ); ?&gt;&lt;/option&gt;
          &lt;/select&gt;
      &lt;/div&gt;
      &lt;?php
  }
  /**
   * This code gets your posted field and modifies the job search query
   */
  add_filter( 'job_manager_get_listings', 'filter_by_salary_field_query_args', 10, 2 );
  function filter_by_salary_field_query_args( $query_args, $args ) {
      if ( isset( $_POST['form_data'] ) ) {
          parse_str( $_POST['form_data'], $form_data );
          // If this is set, we are filtering by salary
          if ( ! empty( $form_data['filter_by_salary'] ) ) {
              $selected_range = sanitize_text_field( $form_data['filter_by_salary'] );
              switch ( $selected_range ) {
                  case 'upto20' :
                      $query_args['meta_query'][] = array(
                          'key'     =&gt; '_job_salary',
                          'value'   =&gt; '20000',
                          'compare' =&gt; '&lt;',
                          'type'    =&gt; 'NUMERIC'
                      );
                  break;
                  case 'over60' :
                      $query_args['meta_query'][] = array(
                          'key'     =&gt; '_job_salary',
                          'value'   =&gt; '60000',
                          'compare' =&gt; '&gt;=',
                          'type'    =&gt; 'NUMERIC'
                      );
                  break;
                  default :
                      $query_args['meta_query'][] = array(
                          'key'     =&gt; '_job_salary',
                          'value'   =&gt; array_map( 'absint', explode( '-', $selected_range ) ),
                          'compare' =&gt; 'BETWEEN',
                          'type'    =&gt; 'NUMERIC'
                      );
                  break;
              }
              // This will show the 'reset' link
              add_filter( 'job_manager_get_listings_custom_filter', '__return_true' );
          }
      }
      return $query_args;
  }
  </code></pre>
  
  <p>What I need to do, is change the dropdown menu to a textbox, and if I search "20000", to have only jobs with a saved 'salary' of 20000 to show. 
  (In the end this won't be a salary field, but the tutorial seemed like a good base to start from)</p>
  
  <p>I have made some attempts, but have failed to make this work properly. 
  By changing the input to a textbox, and deleting the options, I have a limited search capability eg. I can search for "over60" and the jobs with a value of 60000 or over are shown, but searching for 60000 (or any random selection of letters and numbers) brings up all the jobs without filtering.</p>