Opened 8 years ago
Closed 8 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 |
---|---|---|---|
Milestone: | 4.8 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Options, Meta APIs | Keywords: | has-patch commit |
Focuses: | multisite | Cc: |
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
@
8 years ago
- Keywords has-patch added
- Milestone changed from Awaiting Review to 4.8
- Owner set to flixos90
- Status changed from new to reviewing
- Type changed from defect (bug) to enhancement
Hi @Dhaval Parekh, and thanks for the patch - looks good!
#2
@
8 years ago
- Component changed from Role/Capability to 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
@
8 years ago
I wouldn't mind if we just remove this warning. It was introduced 2 years ago in [29630].
#4
@
8 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
@
8 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.
Replaced is_super_admin() check with current_user_can( 'manage_options' )