if ( ! in_array( $taxonomy, get_taxonomies( array( 'show_ui' => true ) ), true ) || ! current_user_can( 'edit_term', $tag->term_id ) ) { wp_die( '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . '<p>' . __( 'Sorry, you are not allowed to edit this item.' ) . '</p>', 403 ); }
$post_type = get_current_screen()->post_type;
// Default to the first object_type associated with the taxonomy if no post type was passed. if ( empty( $post_type ) ) { $post_type = reset( $tax->object_type ); }