Title: wp_get_object_terms returns array
Last modified: August 24, 2016

---

# wp_get_object_terms returns array

 *  Resolved [Luke](https://wordpress.org/support/users/danceyrselfclean_admin/)
 * (@danceyrselfclean_admin)
 * [11 years ago](https://wordpress.org/support/topic/wp_get_object_terms-returns-array/)
 * Hi I have added a new column to the WordPress user list page using the following
   code:
 *     ```
       function test_modify_user_table( $column ) {
           $column['count'] = 'Count';
   
           return $column;
       }
   
       add_filter( 'manage_users_columns', 'test_modify_user_table' );
   
       function test_modify_user_table_row( $val, $column_name, $user_id ) {
           $user = get_userdata( $user_id );
   
           switch ($column_name) {
               case 'count' :
                   return $terms = wp_get_object_terms( $user_id, 'visitor_count' );
                   break;
   
               default:
           }
   
           return $return;
       }
   
       add_filter( 'manage_users_custom_column', 'test_modify_user_table_row', 10, 3 );
       ```
   
 * Using this plugin my custom taxonomy is called visitor_count.
 * For some reason the output from this code simply returns Array and not the taxonomy
   as I was hoping.
 * Is there anything you can spot wrong with my code?
 * Any assistance would be appreciated.
 * [https://wordpress.org/plugins/user-tags/](https://wordpress.org/plugins/user-tags/)

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

 *  Plugin Author [Umesh Kumar](https://wordpress.org/support/users/umeshsingla/)
 * (@umeshsingla)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/wp_get_object_terms-returns-array/#post-6175982)
 * Hi,
 * Return value for `wp_get_object_terms` is supposed to be an array, you can check
   it here [https://codex.wordpress.org/Function_Reference/wp_get_object_terms](https://codex.wordpress.org/Function_Reference/wp_get_object_terms)
 * In case you are trying to display the term count assigned to that user, you can
   use
 *     ```
       case 'count' :
                   $terms = wp_get_object_terms( $user_id, 'visitor_count' );
                   if( !is_wp_error($terms ) ) {
                       return count( $terms);
                   }
                   break;
       ```
   
 *  Plugin Author [Umesh Kumar](https://wordpress.org/support/users/umeshsingla/)
 * (@umeshsingla)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/wp_get_object_terms-returns-array/#post-6176013)
 * Hey @LSB Web Design,
 * Do you still need help, or I already answered your question.
 * I’d love to resolve the issue for you.
 * Cheers

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

The topic ‘wp_get_object_terms returns array’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/user-tags_fdfdfd.svg)
 * [User Taxonomy & Directory](https://wordpress.org/plugins/user-tags/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-tags/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-tags/)
 * [Active Topics](https://wordpress.org/support/plugin/user-tags/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-tags/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-tags/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Umesh Kumar](https://wordpress.org/support/users/umeshsingla/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/wp_get_object_terms-returns-array/#post-6176013)
 * Status: resolved