`in_category` relies on a global post - it should _only_ be used within the loop. Instead, use the arguments that are passed to your callback to query the categories assigned _to the post being edited_ and check if one of them is `video`: $cats = get_the_category( $post['ID'] ); if ( in_array( 'video', wp_list_pluck( $cats, 'slug' ) ) { // In "video" category }