Changeset 6274 for trunk/src/includes/admin/admin.php
- Timestamp:
- 02/02/2017 11:08:01 PM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/includes/admin/admin.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/admin/admin.php
r6250 r6274 202 202 $hooks = array(); 203 203 204 // These are later removed in admin_head 205 if ( current_user_can( 'bbp_tools_page' ) ) { 206 if ( current_user_can( 'bbp_tools_repair_page' ) ) { 207 $hooks[] = add_management_page( 208 __( 'Repair Forums', 'bbpress' ), 209 __( 'Forum Repair', 'bbpress' ), 210 $this->minimum_capability, 211 'bbp-repair', 212 'bbp_admin_repair' 213 ); 204 // Get the tools pages 205 $tools = bbp_get_tools_admin_pages(); 206 207 // Loop through tools and check 208 foreach ( $tools as $tool ) { 209 210 // Try to add the admin page 211 $page = add_management_page( 212 $tool['name'], 213 $tool['name'], 214 $tool['cap'], 215 $tool['page'], 216 $tool['func'] 217 ); 218 219 // Add page to hook if user can view it 220 if ( false !== $page ) { 221 $hooks[] = $page; 214 222 } 215 216 if ( current_user_can( 'bbp_tools_import_page' ) ) { 217 $hooks[] = add_management_page( 218 __( 'Import Forums', 'bbpress' ), 219 __( 'Forum Import', 'bbpress' ), 220 $this->minimum_capability, 221 'bbp-converter', 222 'bbp_converter_settings' 223 ); 224 } 225 226 if ( current_user_can( 'bbp_tools_reset_page' ) ) { 227 $hooks[] = add_management_page( 228 __( 'Reset Forums', 'bbpress' ), 229 __( 'Forum Reset', 'bbpress' ), 230 $this->minimum_capability, 231 'bbp-reset', 232 'bbp_admin_reset' 233 ); 234 } 235 236 // Fudge the highlighted subnav item when on a bbPress admin page 237 foreach ( $hooks as $hook ) { 238 add_action( "admin_head-$hook", 'bbp_tools_modify_menu_highlight' ); 239 } 240 241 // Forums Tools Root 242 add_management_page( 243 __( 'Forums', 'bbpress' ), 244 __( 'Forums', 'bbpress' ), 245 $this->minimum_capability, 246 'bbp-repair', 247 'bbp_admin_repair' 248 ); 249 } 223 } 224 225 // Fudge the highlighted subnav item when on a bbPress admin page 226 foreach ( $hooks as $hook ) { 227 add_action( "admin_head-{$hook}", 'bbp_tools_modify_menu_highlight' ); 228 } 229 230 // Forums Tools Root 231 add_management_page( 232 __( 'Forums', 'bbpress' ), 233 __( 'Forums', 'bbpress' ), 234 'bbp_tools_page', 235 'bbp-repair', 236 'bbp_admin_repair' 237 ); 250 238 251 239 // Are settings enabled? 252 if ( ! bbp_settings_integration() && current_user_can( 'bbp_settings_page' )) {240 if ( ! bbp_settings_integration() ) { 253 241 add_options_page( 254 242 __( 'Forums', 'bbpress' ), 255 243 __( 'Forums', 'bbpress' ), 256 $this->minimum_capability,244 'bbp_settings_page', 257 245 'bbpress', 258 246 'bbp_admin_settings' … … 267 255 __( 'Welcome to bbPress', 'bbpress' ), 268 256 __( 'Welcome to bbPress', 'bbpress' ), 269 $this->minimum_capability,257 'bbp_about_page', 270 258 'bbp-about', 271 259 array( $this, 'about_screen' ) … … 276 264 __( 'Welcome to bbPress', 'bbpress' ), 277 265 __( 'Welcome to bbPress', 'bbpress' ), 278 $this->minimum_capability,266 'bbp_about_page', 279 267 'bbp-credits', 280 268 array( $this, 'credits_screen' )
Note: See TracChangeset
for help on using the changeset viewer.