bp_admin_repair_handler

Handle the processing and feedback of the admin tools page.

Description

bp_admin_repair_handler(); 

Usage

  1. if ( !function_exists( 'bp_admin_repair_handler' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/admin/bp-core-admin-tools.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_admin_repair_handler(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp-core/admin/bp-core-admin-tools.php  
  1. function bp_admin_repair_handler() { 
  2. if ( ! bp_is_post_request() || empty( $_POST['bp-tools-submit'] ) ) { 
  3. return; 
  4.  
  5. check_admin_referer( 'bp-do-counts' ); 
  6.  
  7. // Bail if user cannot moderate. 
  8. $capability = bp_core_do_network_admin() ? 'manage_network_options' : 'manage_options'; 
  9. if ( ! bp_current_user_can( $capability ) ) { 
  10. return; 
  11.  
  12. $messages = array(); 
  13.  
  14. foreach ( (array) bp_admin_repair_list() as $item ) { 
  15. if ( isset( $item[2] ) && isset( $_POST[$item[0]] ) && 1 === absint( $_POST[$item[0]] ) && is_callable( $item[2] ) ) { 
  16. $messages[] = call_user_func( $item[2] ); 
  17.  
  18. if ( count( $messages ) ) { 
  19. foreach ( $messages as $message ) { 
  20. bp_admin_tools_feedback( $message[1] );