Title: Error Using taxonomy_select?
Last modified: August 30, 2016

---

# Error Using taxonomy_select?

 *  Resolved [Dave Mackey](https://wordpress.org/support/users/davidshq/)
 * (@davidshq)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/error-using-taxonomy_select/)
 * I added a taxonomy_select field like so:
 *     ```
       $cmb_lqd_sermons->add_field( array(
                   'name'              => __( 'Speaker', 'lqd_smp' ),
                   'desc'              => __( 'Choose the speaker.' ),
                   'id'                => $prefix . 'sermon_speaker1',
                   'taxonomy_select'   => 'speakers', // TODO: Add support for multiple speakers?
                   'type'              => 'taxonomy_select',
                   ) );
       ```
   
 * Similar code works fine:
 *     ```
       $cmb_lqd_sermons->add_field( array(
                   'name'          => __( 'Speaker', 'lqd_smp' ),
                   'desc'          => __( 'Choose the speaker.' ),
                   'id'            => $prefix . 'sermon_speaker',
                   'type'          => 'select',
                   'show_option_none'  => true,
                   'options'       => array(
                           'need_to_pull' => __( 'Need to Pull', 'lqd_smp' ),
                       ),
                   ) );
       ```
   
 * But the taxonomy_select causes the following error:
 * Notice: Trying to get property of non-object in /home/ubuntu/workspace/wp-content/
   plugins/sermon-manager-plus/includes/cmb2/includes/CMB2_Types.php on line 682
 * Any thoughts?
 * Thanks!
 * Dave
 * [https://wordpress.org/plugins/cmb2/](https://wordpress.org/plugins/cmb2/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Justin Sternberg](https://wordpress.org/support/users/jtsternberg/)
 * (@jtsternberg)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/error-using-taxonomy_select/#post-6410189)
 * What does it look like when you print_r `$terms` right after
 *     ```
       $terms = get_terms( $this->field->args( 'taxonomy' ), 'hide_empty=0' );
       ```
   
 * (in cmb2/includes/CMB2_Types.php)
 *  Thread Starter [Dave Mackey](https://wordpress.org/support/users/davidshq/)
 * (@davidshq)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/error-using-taxonomy_select/#post-6410196)
 * Weird. Error is:
 * > P_Error Object ( [errors] => Array ( [invalid_taxonomy] => Array ( [0] => Invalid
   > taxonomy ) ) [error_data] => Array ( ) )
 * But I definitely register a custom taxonomy named speakers and have two records
   in it.
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [10 years, 8 months ago](https://wordpress.org/support/topic/error-using-taxonomy_select/#post-6410210)
 * I’d double check the taxonomy slug on them, just to be certain. May have rewrites
   going on for the frontend permalinks.
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [10 years, 4 months ago](https://wordpress.org/support/topic/error-using-taxonomy_select/#post-6410505)
 * Any resolution found for this David?

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Error Using taxonomy_select?’ is closed to new replies.

 * ![](https://ps.w.org/cmb2/assets/icon.svg?rev=2866672)
 * [CMB2](https://wordpress.org/plugins/cmb2/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cmb2/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cmb2/)
 * [Active Topics](https://wordpress.org/support/plugin/cmb2/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cmb2/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cmb2/reviews/)

## Tags

 * [cmb2 plugin](https://wordpress.org/support/topic-tag/cmb2-plugin/)

 * 4 replies
 * 3 participants
 * Last reply from: [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/error-using-taxonomy_select/#post-6410505)
 * Status: resolved