Update user counts in admin interface

After searching I created a hook for that and that hook is: add_filter(“views_users”, ‘custom_editor_counts’, 10, 1); function custom_editor_counts($views) { $view=$views; if ( current_user_can( ‘contributor’ ) ) { unset($views[‘all’]); unset($views[‘administrator’]); unset($views[‘subscriber’]); unset($views[‘customer’]); unset($views[‘contributor’]); unset($views[‘shop_manager’]); return $views; }else{ $views=$view; return $views; } } This works for me.

Query for post term that matches user ID

Try this code it will surely work, before testing this code make sure you have added the categories title as numbers. $terms = get_terms( array( ‘taxonomy’ => ‘list’, ‘hide_empty’ => false )); $user = wp_get_current_user(); if(!empty($terms)){ foreach ( $terms as $term ) { if($term->name == $user->ID){ // Do something } } } This code will … Read more