bb_ksd_configuration_page_process

The BuddyPress bb ksd configuration page process function.

Description

bb_ksd_configuration_page_process(); 

Usage

  1. if ( !function_exists( 'bb_ksd_configuration_page_process' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-plugins/akismet.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bb_ksd_configuration_page_process(); 
  7.  

Defined (1)

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

/bp-forums/bbpress/bb-plugins/akismet.php  
  1. function bb_ksd_configuration_page_process() 
  2. if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && $_POST['action'] == 'update-akismet-settings') { 
  3. bb_check_admin_referer( 'options-akismet-update' ); 
  4.  
  5. $goback = remove_query_arg( array( 'invalid-akismet', 'updated-akismet' ), wp_get_referer() ); 
  6.  
  7. if ( !isset( $_POST['akismet_stats'] ) ) { 
  8. $_POST['akismet_stats'] = false; 
  9.  
  10. if ( true === (bool) $_POST['akismet_stats'] ) { 
  11. bb_update_option( 'akismet_stats', 1 ); 
  12. } else { 
  13. bb_delete_option( 'akismet_stats' ); 
  14.  
  15. if ( $_POST['akismet_key'] ) { 
  16. $value = stripslashes_deep( trim( $_POST['akismet_key'] ) ); 
  17. if ( $value ) { 
  18. if ( bb_akismet_verify_key( $value ) ) { 
  19. bb_update_option( 'akismet_key', $value ); 
  20. } else { 
  21. $goback = add_query_arg( 'invalid-akismet', 'true', $goback ); 
  22. bb_safe_redirect( $goback ); 
  23. exit; 
  24. } else { 
  25. bb_delete_option( 'akismet_key' ); 
  26. } else { 
  27. bb_delete_option( 'akismet_key' ); 
  28.  
  29. $goback = add_query_arg( 'updated-akismet', 'true', $goback ); 
  30. bb_safe_redirect( $goback ); 
  31. exit; 
  32.  
  33. if ( !empty( $_GET['updated-akismet'] ) ) { 
  34. bb_admin_notice( __( '<strong>Settings saved.</strong>' ) ); 
  35.  
  36. if ( !empty( $_GET['invalid-akismet'] ) ) { 
  37. bb_admin_notice( __( '<strong>The key you attempted to enter is invalid. Reverting to previous setting.</strong>' ), error ); 
  38.  
  39. global $bb_admin_body_class; 
  40. $bb_admin_body_class = ' bb-admin-settings';