php - Hide Categories from WordPress Dashboard by ID and Custom Post Type -
i went searching solution hide specific categories id on wordpress dashboard individual custom post types. stumbled upon following code , able half way there hiding categories logged in user.
add_action( 'admin_init', 'wpse_55202_do_terms_exclusion' ); function wpse_55202_do_terms_exclusion() { if( current_user_can('administrator') ) add_filter( 'list_terms_exclusions', 'wpse_55202_list_terms_exclusions', 10, 2 ); } function wpse_55202_list_terms_exclusions($exclusions,$args) { return $exclusions . " , ( t.term_id <> 43 ) , ( t.term_id <> 42 )"; } now want alter code hide id specified categories taking custom post type account. know, can pass argument current_user_can i'm not sure how phrase it. unfortunately custom taxonomy have implemented in other aspects of site not going work in instance.
i thought had swap if statement conditional get_post_type did not work. ideas?
'andytoday' == get_post_type()
Comments
Post a Comment