title: Unlimited posts_per_page for a custom post type only
body: <p>I need to show all existing posts in the archive loop for a custom post type of 'vehicle'.  </p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>function get_all_vehicle_posts( $query ) {
      $query-&gt;set( 'posts_per_page', '-1' );
  }
  add_action( 'pre_get_posts', 'get_all_vehicle_posts' );
  </code></pre>
  
  <p>And I see the unlimited posts I wanted.  However I need to limit this change to my custom post type. </p>
  
  <p>I tried:</p>
  
  <pre><code>    if ( 'vehicle' == $query-&gt;post_type ) {
          $query-&gt;set( 'posts_per_page', '-1' );
      }
  </code></pre>
  
  <p>but that doesn't seem to work. I guess we don't know the post type before the query is run unless it's a specific argument for the query?</p>
  
  <p>How can I limit this function to a particular post type?</p>