um_add_custom_user_profile_fields

The Ultimate Member um add custom user profile fields function.

Description

um_add_custom_user_profile_fields( $footer_text ); 

Parameters (1)

0. $footer_text
The footer text.

Usage

  1. if ( !function_exists( 'um_add_custom_user_profile_fields' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ultimate-member/admin/core/um-admin-actions.php'; 
  3.  
  4. // The footer text. 
  5. $footer_text = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = um_add_custom_user_profile_fields($footer_text); 
  9.  

Defined (1)

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

/admin/core/um-admin-actions.php  
  1. function um_add_custom_user_profile_fields($footer_text) { 
  2. global $ultimatemember, $pagenow; 
  3.  
  4. if( $pagenow !== 'user-new.php' ) 
  5. return $footer_text; 
  6.  
  7. if( !current_user_can('manage_options') ) 
  8. return $footer_text; 
  9.  
  10. ?> 
  11. <table id="table_my_custom_field" style="display:none;"> 
  12. <tr> 
  13. <th><label for="um_role"><?php _e( 'Community Role', 'ultimatemember' ); ?></label></th> 
  14. <td> 
  15. <select name="um_role" id="um_role"> 
  16. <?php foreach( $ultimatemember->query->get_roles() as $key => $value ) { ?> 
  17. <option value="<?php echo $key; ?>" <?php selected( um_get_option('default_role'), $key ); ?> ><?php echo $value; ?></option> 
  18. <?php } ?> 
  19. </select> 
  20. </td> 
  21. </tr> 
  22. </table> 
  23. <script> 
  24. jQuery(function($) { 
  25. $('#table_my_custom_field tr').insertAfter($('#role').parentsUntil('tr').parent()); 
  26. }); 
  27. </script> 
  28. <?php