title: Add posts category in CMB2 options
body: <p>I need to add a specific type of posts in a dropdown option to my CMB2 WordPress plugin. I have found where in my code my fields are generated; however, I see <code>taxonomies</code> being used as filters, but I would need a post <code>post_type</code>.</p>
  
  <p><strong>Working, with taxonomies</strong></p>
  
  <pre><code>$cmb_events-&gt;add_field( array (
      'name'      =&gt; __('Catégorie d\'événement','aqmat'),
      'id'        =&gt; $prefix . 'categorie',
      'type'      =&gt; 'taxonomy_select',
      'taxonomy'  =&gt; 'aqmat_categorie_evenement'
  ));
  </code></pre>
  
  <p>I figured I'd query my posts to get only those I want and add them to the dropdown using the logic as the <code>taxonomy</code> field</p>
  
  <p><strong>My attempt at getting my post type</strong></p>
  
  <pre><code>// Get posts in desired category
  $posts = array();
  $args = array(
              'post_type'      =&gt; 'post_type_i_want',
              'orderby'        =&gt; 'id',
              'posts_per_page' =&gt; -1
          );
  $getPosts = get_posts($args);
  foreach($getPosts as $post) {
      setup_postdata($post);
      // Yes, I am aware I would *technically* have several times the same value
      // Not getting there yet, so not an issue for me right now
      // Besides, my category currently has but 1 post
      array_push($getPosts, array(
          'standard' =&gt; __( 'Option value', 'cmb2' )
      ));
  }
  // Add field
  $cmb_events-&gt;add_field( array (
      'name'      =&gt; __('Label','cmb2'),
      'id'        =&gt; $prefix . 'enseignant',
      'type'      =&gt; 'taxonomy_select',
      'options'   =&gt; $teamMembers
  ));
  </code></pre>
  
  <p>However, I am getting no errors, and no values in my dropdown. I can't seem to get much for querying posts in the official <a href="https://github.com/webdevstudios/CMB2/wiki" rel="nofollow noreferrer">Documentation</a>, so I am coming up pretty empty on the subject. Any suggestions?</p>
  
  <hr>
  
  <h2>EDIT</h2>
  
  <p><a href="https://stackoverflow.com/a/39794244/2748327">I have posted an answer</a> which uses <a href="https://wordpress.org/plugins/advanced-custom-fields/" rel="nofollow noreferrer">Advanced Custom Fields</a>.</p>
  
  <hr>
  
  <h2>EDIT #2</h2>
  
  <p><a href="https://stackoverflow.com/a/39813536/2748327">Another answer</a> providing a link to the proper page has been provided.</p>