fix #19
This commit is contained in:
parent
09ab9fd0e6
commit
93b4a263c3
@ -158,17 +158,20 @@ function amp_admin_sublinks( $links ) {
|
|||||||
|
|
||||||
global $amp_allowed_plugin_pages;
|
global $amp_allowed_plugin_pages;
|
||||||
|
|
||||||
|
if( empty( $links['plugins'] ) ) {
|
||||||
|
|
||||||
|
unset($links['plugins']);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
if ( amp_have_capability( ampCap::ManagePlugins ) !== true) {
|
if ( amp_have_capability( ampCap::ManagePlugins ) !== true) {
|
||||||
foreach( $links['plugins'] as $link => $ar ) {
|
foreach( $links['plugins'] as $link => $ar ) {
|
||||||
if(!in_array($link, $amp_allowed_plugin_pages) )
|
if(!in_array($link, $amp_allowed_plugin_pages) )
|
||||||
unset($links['plugins'][$link]);
|
unset($links['plugins'][$link]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( empty( $links['plugins'] ) )
|
|
||||||
unset($links['plugins']);
|
|
||||||
else
|
|
||||||
sort($links['plugins']);
|
sort($links['plugins']);
|
||||||
|
}
|
||||||
return $links;
|
return $links;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user