buddyverified_save_metabox

Buddyverified_save_metabox function.

Description

buddyverified_save_metabox( $array ); 

Parameters (1)

0. $array
The array.

Usage

  1. if ( !function_exists( 'buddyverified_save_metabox' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddyverified/includes/class-admin.php'; 
  3.  
  4. // The array. 
  5. $array = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = buddyverified_save_metabox($array); 
  9.  

Defined (1)

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

/includes/class-admin.php  
  1. function buddyverified_save_metabox( $array ) { 
  2.  
  3. if ( isset( $_POST['save'] ) && 'Update Profile' === $_POST['save'] ) { 
  4.  
  5. if ( ! empty( $_GET['user_id'] ) && is_numeric( $_GET['user_id'] ) ) { 
  6. $user_id = $_GET['user_id']; 
  7. } else { 
  8. $user_id = get_current_user_id(); 
  9.  
  10. $text = isset( $_POST['verified_text'] ) ? $_POST['verified_text'] : ''; 
  11. $profile = isset( $_POST['verified_profile'] ) ? $_POST['verified_profile'] : ''; 
  12. $member = isset( $_POST['verified_member'] ) ? $_POST['verified_member'] : ''; 
  13. $activity = isset( $_POST['verified_activity'] ) ? $_POST['verified_activity'] : ''; 
  14. $image = isset( $_POST['verified_image'] ) ? $_POST['verified_image'] : '1'; 
  15. $verify = isset( $_POST['verified'] ) ? $_POST['verified'] : ''; 
  16.  
  17. $bp_verified_arr = array( 
  18. 'profile' => sanitize_text_field( $profile ),  
  19. 'member' => sanitize_text_field( $member ),  
  20. 'activity' => sanitize_text_field( $activity ),  
  21. 'text' => sanitize_text_field( $text ),  
  22. 'image' => sanitize_text_field( $image ),  
  23. ); 
  24.  
  25. update_user_meta( $user_id, 'bp-verified', $bp_verified_arr ); 
  26. update_user_meta( $user_id, 'bp-profile-verified', sanitize_text_field( $verify ) );