This commit is contained in:
joshp 2021-03-12 01:18:42 -05:00
parent 09ab9fd0e6
commit 93b4a263c3
No known key found for this signature in database
GPG Key ID: 59903022E9AC64FC

View File

@ -158,17 +158,20 @@ function amp_admin_sublinks( $links ) {
global $amp_allowed_plugin_pages;
if( empty( $links['plugins'] ) ) {
unset($links['plugins']);
} else {
if ( amp_have_capability( ampCap::ManagePlugins ) !== true) {
foreach( $links['plugins'] as $link => $ar ) {
if(!in_array($link, $amp_allowed_plugin_pages) )
unset($links['plugins'][$link]);
}
}
if( empty( $links['plugins'] ) )
unset($links['plugins']);
else
sort($links['plugins']);
}
return $links;
}