Opened 10 years ago
Closed 10 years ago
#39207 closed enhancement (fixed)
Replace is_super_admin() check with current_user_can( 'manage_options' ) in wp-admin/options-general.php
| Reported by: | Dhaval Parekh | Owned by: | flixos90 |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.8 |
| Component: | Options, Meta APIs | Version: | |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | Focuses: | multisite |
Description
This is part of the https://core.trac.wordpress.org/ticket/37616#comment:28 task. There is 1 is_super_admin() checks in wp-admin/options-general.php that should be replaced with current_user_can( 'manage_options' ).
Attachments (2)
Change History (8)
#1
@
10 years ago
- Keywords has-patch added
- Milestone Awaiting Review → 4.8
- Owner set to
- Status new → reviewing
- Type defect (bug) → enhancement
Hi @Dhaval Parekh, and thanks for the patch - looks good!
#2
@
10 years ago
- Component Role/Capability → Options, Meta APIs
- Keywords needs-patch added; has-patch removed
The intention of this line of code is to only show the WPLANG warning to super admins on a multisite installation. A regular administrator on multisite should not see this message, but an administrator on a single site installation should.
I'm not sure which cap would be more appropriate to check for here. Maybe:
if ( ! is_multisite() || current_user_can( 'manage_network_options )`
#3
@
10 years ago
I wouldn't mind if we just remove this warning. It was introduced 2 years ago in [29630].
#4
@
10 years ago
+1 on removing the warning. I think the regular _deprecated_argument() call can remain, it should really be sufficient as a warning for a developer.
Let's open a new ticket if we agree on this - this here would then become invalid. :)
#5
@
10 years ago
- Keywords has-patch commit added; needs-patch removed
39207.diff makes the check available to network administrators on multisite and regular administrators on non-multisite.
Generally using a new meta capability would be more elegant, but since it is only about a simple notice that might possibly removed soon, let's use the check from the new patch.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Replaced is_super_admin() check with current_user_can( 'manage_options' )