Opened 9 years ago
Closed 8 years ago
#37447 closed defect (bug) (fixed)
Remove redundant `is_multisite()` checks in network admin templates
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.7 | Priority: | normal |
Severity: | normal | Version: | 3.1 |
Component: | Administration | Keywords: | has-patch |
Focuses: | multisite | Cc: |
Description
Most of the templates for the network admin have a check for is_multisite()
in the beginning of the file. However there's already such a check happening in the admin.php
file for the network admin, making these additional checks redundant. Let's remove them.
Attachments (2)
Change History (13)
This ticket was mentioned in Slack in #core by flixos90. View the logs.
9 years ago
#4
in reply to:
↑ 3
;
follow-up:
↓ 5
@
9 years ago
Replying to SergeyBiryukov:
Looking at [16272], I guess the checks are there just in case the one in
network/admin.php
gets removed at some pount (it might be an oversight as well, but seems unlikely).
Why would that file be removed? Solely for that purpose, (so that we don't need duplicate code) I think it would make sense to keep it.
#5
in reply to:
↑ 4
@
9 years ago
Replying to flixos90:
Replying to SergeyBiryukov:
Looking at [16272], I guess the checks are there just in case the one in
network/admin.php
gets removed at some pount (it might be an oversight as well, but seems unlikely).
Why would that file be removed? Solely for that purpose, (so that we don't need duplicate code) I think it would make sense to keep it.
Not the file could be removed, but the checks in it.
This ticket was mentioned in Slack in #core-multisite by flixos90. View the logs.
9 years ago
#8
follow-up:
↓ 9
@
9 years ago
- Keywords commit removed
I think we're okay to remove these. It seems (IMO) like part of [16272] was about applying some consistency to network admin files that didn't have both the is_multisite()
check and the bootstrap documentation. It doesn't really hurt to to have the 2 checks, but the opportunity to reduce code is nice. :)
Is there a way we can work in a one line comment above the check in wp-admin/network/admin.php
to clarify its importance?
#9
in reply to:
↑ 8
@
9 years ago
Replying to jeremyfelt:
Is there a way we can work in a one line comment above the check in
wp-admin/network/admin.php
to clarify its importance?
I added such a note in 37447.2.diff.
37447.diff removes all the unnecessary
is_multisite()
checks.