Advertisement
vapvarun

BuddyPress profile pro values

Mar 12th, 2018
581
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. // echo BuddyPress profile pro values
  2.  
  3. $filed_values = wbbpp_get_field_values( $field_name = '1519033789');
  4.  
  5.  
  6. // Code added in plugin to function the process.
  7. /*
  8. *
  9. * Function to return field values with respect to field name.
  10. */
  11. function wbbpp_get_field_values( $field_name ){
  12. $field_values = array();
  13. $user_id = get_current_user_id();
  14. $bprm_rs_data = array();
  15. $bprm_rs_data = get_user_meta( $user_id, 'wbbpp_userdata', true );
  16. if ( ! empty( $bprm_rs_data ) && is_array( $bprm_rs_data ) ) {
  17. foreach ($bprm_rs_data as $grp_key => $grp_value) {
  18. foreach ($grp_value as $_key => $_value) {
  19. if( isset( $_value[$field_name] ) ){
  20. $field_values[] = $_value[$field_name];
  21. }
  22. }
  23. }
  24. }
  25. return $field_values;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement