[wp-trac] [WordPress Trac] #42486: The Tools screen is blank for users who cannot manage categories or tags
WordPress Trac
noreply at wordpress.org
Fri Nov 24 08:05:38 UTC 2017
#42486: The Tools screen is blank for users who cannot manage categories or tags
----------------------------+--------------------
Reporter: johnbillion | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.9.2
Component: Administration | Version: 4.9
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
----------------------------+--------------------
Comment (by dd32):
A use-case to consider here is when a plugin has added something to the
tools page, such as the press this plugin.
I don't think we need to worry about blocking direct access to the page.
The attachments so far on this ticket don't really seem like good
solutions, consider these use-cases:
- User can't import, but can export
- User can't export, but can import
- Multisite network has Import/Export disabled, but can access Delete
Site
- Plugin has added submenus to the Tools menu
- A plugin is adding extra things on the tools page.
To fix this, it's going to need to be some code in `wp-
admin/includes/menu.php` around line 180 which checks that
- Tools.php doesn't have any sub child nodes
- ` !has_action( 'tool_box' )` (to detect custom output on that page)
and only then remove the menu from the menu.
[attachment:42486.diff] does just this, and I think this covers enough of
the edge cases here.
As mentioned in the patch, it's still possible to hit a blank page when
the user can import, but can't modify tags/cats, the menu will have
subpages of importers/etc in that case.
Maybe we could increase the amount of text on the page, showing a
description of the page & a "Sorry, nothing you can access right now"
message when no tools on offer?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42486#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list