um_add_edit_icon

The Ultimate Member um add edit icon function.

Description

um_add_edit_icon( $args ); 

Parameters (1)

0. $args
The args.

Usage

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

Defined (1)

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

/core/um-actions-profile.php  
  1. function um_add_edit_icon( $args ) { 
  2. global $ultimatemember; 
  3. $output = ''; 
  4.  
  5. if ( !is_user_logged_in() ) return; // not allowed for guests 
  6.  
  7. if ( isset( $ultimatemember->user->cannot_edit ) && $ultimatemember->user->cannot_edit == 1 ) return; // do not proceed if user cannot edit 
  8.  
  9. if ( $ultimatemember->fields->editing == true ) { 
  10.  
  11. ?> 
  12.  
  13. <div class="um-profile-edit um-profile-headericon"> 
  14.  
  15. <a href="#" class="um-profile-edit-a um-profile-save"><i class="um-faicon-check"></i></a> 
  16.  
  17. </div> 
  18.  
  19. <?php } else { ?> 
  20.  
  21. <div class="um-profile-edit um-profile-headericon"> 
  22.  
  23. <a href="#" class="um-profile-edit-a"><i class="um-faicon-cog"></i></a> 
  24.  
  25. <?php 
  26.  
  27. $items = array( 
  28. 'editprofile' => '<a href="'.um_edit_profile_url().'" class="real_url">'.__('Edit Profile', 'ultimatemember').'</a>',  
  29. 'myaccount' => '<a href="'.um_get_core_page('account').'" class="real_url">'.__('My Account', 'ultimatemember').'</a>',  
  30. 'logout' => '<a href="'.um_get_core_page('logout').'" class="real_url">'.__('Logout', 'ultimatemember').'</a>',  
  31. 'cancel' => '<a href="#" class="um-dropdown-hide">'.__('Cancel', 'ultimatemember').'</a>',  
  32. ); 
  33.  
  34. $cancel = $items['cancel']; 
  35.  
  36. if ( !um_is_myprofile() ) { 
  37.  
  38. $actions = $ultimatemember->user->get_admin_actions(); 
  39.  
  40. unset( $items['myaccount'] ); 
  41. unset( $items['logout'] ); 
  42. unset( $items['cancel'] ); 
  43.  
  44. if ( is_array( $actions ) ) { 
  45. $items = array_merge( $items, $actions ); 
  46.  
  47. $items = apply_filters('um_profile_edit_menu_items', $items, um_profile_id() ); 
  48.  
  49. $items['cancel'] = $cancel; 
  50.  
  51. } else { 
  52.  
  53. $items = apply_filters('um_myprofile_edit_menu_items', $items ); 
  54.  
  55.  
  56. echo $ultimatemember->menu->new_ui( $args['header_menu'], 'div.um-profile-edit', 'click', $items ); 
  57.  
  58. ?> 
  59.  
  60. </div> 
  61.  
  62. <?php 
  63.