- Timestamp:
- 08/08/2020 08:22:34 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/plugin.php
r48574 r48762 2114 2114 return false; 2115 2115 } 2116 2116 2117 foreach ( array_keys( $_wp_submenu_nopriv ) as $key ) { 2117 2118 if ( isset( $_wp_submenu_nopriv[ $key ][ $pagenow ] ) ) { … … 2122 2123 } 2123 2124 } 2125 2124 2126 return true; 2125 2127 } … … 2132 2134 foreach ( $submenu[ $parent ] as $submenu_array ) { 2133 2135 if ( isset( $plugin_page ) && ( $submenu_array[2] == $plugin_page ) ) { 2134 if ( current_user_can( $submenu_array[1] ) ) { 2135 return true; 2136 } else { 2137 return false; 2138 } 2136 return current_user_can( $submenu_array[1] ); 2139 2137 } elseif ( $submenu_array[2] == $pagenow ) { 2140 if ( current_user_can( $submenu_array[1] ) ) { 2141 return true; 2142 } else { 2143 return false; 2144 } 2138 return current_user_can( $submenu_array[1] ); 2145 2139 } 2146 2140 } … … 2149 2143 foreach ( $menu as $menu_array ) { 2150 2144 if ( $menu_array[2] == $parent ) { 2151 if ( current_user_can( $menu_array[1] ) ) { 2152 return true; 2153 } else { 2154 return false; 2155 } 2145 return current_user_can( $menu_array[1] ); 2156 2146 } 2157 2147 }
Note: See TracChangeset
for help on using the changeset viewer.