[wp-trac] [WordPress Trac] #43848: Function "user_can_access_admin_page" refactor.
WordPress Trac
noreply at wordpress.org
Sat Aug 8 20:21:27 UTC 2020
#43848: Function "user_can_access_admin_page" refactor.
-------------------------------------+-------------------------------
Reporter: rnaby | Owner: valentinbora
Type: enhancement | Status: reopened
Priority: lowest | Milestone: 5.6
Component: Administration | Version:
Severity: normal | Resolution:
Keywords: has-patch needs-refresh | Focuses: coding-standards
-------------------------------------+-------------------------------
Changes (by SergeyBiryukov):
* keywords: has-patch needs-refresh close => has-patch needs-refresh
* status: closed => reopened
* focuses: => coding-standards
* resolution: wontfix =>
* milestone: => 5.6
Comment:
While I mostly agree with comment:3, I think there is some benefit in
replacing these parts:
{{{
if ( current_user_can( $submenu_array[1] ) ) {
return true;
} else {
return false;
}
}}}
with:
{{{
return current_user_can( $submenu_array[1] );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43848#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list