#43743 closed defect (bug) (fixed)
Terms list table should be full width when user cannot edit terms
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.1 | Priority: | normal |
Severity: | minor | Version: | |
Component: | Taxonomy | Keywords: | has-screenshots good-first-bug ui-feedback has-patch dev-feedback |
Focuses: | administration | Cc: |
Description
The edit-tags.php
screen is split into two columns. On the left hand side is a form to create new terms, on the right hand side is the list of existing terms.
Now, the form is only visible if the user has the edit_terms
capability for the current taxonomy. If they don't, the left column is simply empty.
Instead of wasting this space, I'd suggest to make the list table take the full width of the screen instead of residing at the right side.
Unfortunately this can't be yet achieved using CSS alone because #col-left
isn't empty as it contains a .col-wrap
div.
If we'd move the current_user_can( $tax->cap->edit_terms )
check outside .col-wrap
or even #col-left
, we could use something like #col-left:empty #col-right { float: none; width: 100% }
Attachments (4)
Change History (14)
#2
@
7 years ago
I'd suggest hiding the div completely (not using CSS) if it's empty so it's not present in the DOM as it doesn't need to exist on the page if empty. What scenario allows you to access this page but not add new terms? What role do you need to have/setup to test this?
#3
@
7 years ago
What scenario allows you to access this page but not add new terms? What role do you need to have/setup to test this?
This happens when you have the manage_terms
capability for that taxonomy but not edit_terms
.
In my case, the custom taxonomy was registered with caps like these:
'capabilities' => [
'manage_terms' => 'manage_categories',
'edit_terms' => 'manage_business_areas',
'delete_terms' => 'manage_business_areas',
'assign_terms' => 'edit_posts',
],
Categories being a default taxonomy, I had the manage_categories
caps but since I haven't yet added the custom manage_business_areas
cap to my user / role, the demonstrated scenario happens.
You could easily test it by manually removing the edit_categories
capability using something like the Members plugin.
#4
@
7 years ago
- Keywords has-patch added; needs-patch removed
I've implemented a patch adding a variable $has_2_columns_layout
governing whether or not to add the col_left
col_right
markup.
#5
@
7 years ago
- Keywords dev-feedback added
I've tested the scenario.
On the built-in category, there's no possibility this could happen because manage_terms
, edit_terms
and delete_terms
maps to the same capability.
On a custom taxonomy, the scenario can happen when manage_terms
is set on the user and edit_terms
and delete_terms
is not set.
The Patch fixes the layout. It also works responsively.
Status quo