UPME Filters for Developers
Documentation for using UPME Filters for customizing existing profile content, features and adding new contents, features.
Documentation for UPME Filters
– upme_init_options
– Customize the default UPME settings on loading. Default options are passed as an array.
– Default upme options as an array
function upme_init_options($defaults){ $defaults['label_for_registration_user_role'] = 'Custom Label'; return $defaults; } add_filter('upme_init_options','upme_init_options');
– upme_replace_avatar
– Customize the default UPME settings on loading. Default options are passed as an array.
– Avatar image, User ID
function upme_replace_avatar($avatar,$user_id){ $avatar = '<img class="avatar avatar-64 photo my-avatar" alt="" src="https://0.gravatar.com/avatar/c6efe1b8f6c2f0654a25980de950?s=64&d=&r=G" width="64" height="64" />'; return $avatar; } add_filter('upme_replace_avatar','upme_replace_avatar',10,2);
– upme_custom_js_strings
– Customize strings used inside Javascipt files for profiles.
– Array of strings used as Javascript Messages
function upme_custom_js_strings($custom_js_strings){ $custom_js_strings['EditProfile'] = 'Update Profile'; return $custom_js_strings; } add_filter('upme_custom_js_strings','upme_custom_js_strings');
– upme_profile_modal_shortcode
– Customize the shortcode used in modal for specific users.
– Shortcode assigned in admin section, User ID
function upme_profile_modal_shortcode($profile_shortcode,$user_id){ if($user_id == 'SPECIFIC ID'){ $profile_shortcode = '[upme show_stats=yes]'; } return $profile_shortcode; } add_filter('upme_profile_modal_shortcode','upme_profile_modal_shortcode',10,2);
– upme_datepicker_settings
– Customize the default settings used for datepicker field.
– Datepicker settings array
function upme_datepicker_settings($date_picker_array){ $date_picker_array['yearRange'] = '2000:2020'; $date_picker_array['prevText'] = 'Past'; $date_picker_array['nextText'] = 'Future'; return $date_picker_array; } add_filter('upme_datepicker_settings', 'upme_datepicker_settings' );
– upme_reset_pass_subject
– Customize the subject of reset password email.
– Default subject
function upme_reset_pass_subject($title){ $title = "Custom Reset Password"; return $title ; } add_filter('upme_reset_pass_subject', 'upme_reset_pass_subject' );
– upme_reset_pass_content
– Customize the contents of reset password email.
– Default message, username, email, reset page URL
function upme_reset_pass_content($message,$user_login,$user_email,$reset_page_url){ $message = "Custom Reset Pass Content $user_email $user_login $reset_page_url" return $message; } add_filter('upme_reset_pass_content','upme_reset_pass_content',10,4);
– upme_new_user_act_subject
– Customize the subject of email sent to users when Email Confirmation is enabled.
– Default subject
function upme_new_user_act_subject($subject){ $subject = "Custom User Activation"; return $subject; } add_filter('upme_new_user_act_subject','upme_new_user_act_subject');
– upme_new_user_act_content
– Customize the content of email sent to users when Email Confirmation is enabled.
– Default message, username, email, activation link
function upme_new_user_act_content($message,$user_login,$user_email,$activation_link){ $message = "Custom User Activation Content $user_email $user_login $activation_link" return $message; } add_filter('upme_new_user_act_content','upme_new_user_act_content',10,4);
– upme_new_user_act_admin_subject
– Customize the subject of email sent to admin when Email Confirmation is enabled.
– Default subject
function upme_new_user_act_admin_subject($subject){ $subject = "Custom User Activation - Admin"; return $subject; } add_filter('upme_new_user_act_admin_subject','upme_new_user_act_admin_subject');
– upme_new_user_act_admin_content
– Customize the contents of email sent to admin when Email Confirmation is enabled.
– Default message, username, email
function upme_new_user_act_admin_content($message,$user_login,$user_email){ $message = "Custom User Activation Admin Content $user_email $user_login"; return $message; } add_filter('upme_new_user_act_admin_content','upme_new_user_act_admin_content',10,3);
– upme_profile_before_head
– Display dynamic content before the profile head section. Useful for displaying custom data or messages.
– Empty content, ID of the user profile
function upme_profile_before_head($content,$user_id){ $content = "Custom HTML Block with Data"; return $content; } add_filter('upme_profile_before_head','upme_profile_before_head',10,2);
– upme_compact_profile_before_head
– Display dynamic content before the profile head section in compact view mode. Useful for displaying custom data or messages.
– Empty content, ID of the user profile
function upme_compact_profile_before_head($content,$user_id){ $content = "Custom HTML Block with Data"; return $content; } add_filter('upme_compact_profile_before_head','upme_compact_profile_before_head',10,2);
– upme_full_profile_before_head
– Display dynamic content before the profile head section in full view mode. Useful for displaying custom data or messages.
– Empty content, ID of the user profile
function upme_full_profile_before_head($content,$user_id){ $content = "Custom HTML Block with Data"; return $content; } add_filter('upme_full_profile_before_head','upme_full_profile_before_head',10,2);
– upme_profile_after_head
– Display dynamic content after the profile head section. Useful for displaying custom data or messages.
– Empty content, ID of the user profile
function upme_profile_after_head($content,$user_id){ $content = "Custom HTML Block with Data"; return $content; } add_filter('upme_profile_after_head','upme_profile_after_head',10,2);
– upme_compact_profile_after_head
– Display dynamic content after the profile head section in compact view mode. Useful for displaying custom data or messages.
– Empty content, ID of the user profile
function upme_compact_profile_after_head($content,$user_id){ $content = "Custom HTML Block with Data"; return $content; } add_filter('upme_compact_profile_after_head','upme_compact_profile_after_head',10,2);
– upme_full_profile_after_head
– Display dynamic content after the profile head section in full view mode. Useful for displaying custom data or messages.
– Empty content, ID of the user profile
function upme_full_profile_after_head($content,$user_id){ $content = "Custom HTML Block with Data"; return $content; } add_filter('upme_full_profile_after_head','upme_full_profile_after_head',10,2);
– upme_profile_after_fields
– Display dynamic content after the profile fields section. Useful for displaying custom data or messages.
– Empty content, ID of the user profile
function upme_profile_after_fields($content,$user_id){ $content = "Custom HTML Block with Data"; return $content; } add_filter('upme_profile_after_fields','upme_profile_after_fields',10,2);
– upme_compact_profile_after_fields
– Display dynamic content after the profile fields section in compact view mode. Useful for displaying custom data or messages.
– Empty content, ID of the user profile
function upme_compact_profile_after_fields($content,$user_id){ $content = "Custom HTML Block with Data"; return $content; } add_filter('upme_compact_profile_after_fields','upme_compact_profile_after_fields',10,2);
– upme_full_profile_after_fields
– Display dynamic content after the profile fields section in full view mode. Useful for displaying custom data or messages.
– Empty content, ID of the user profile
function upme_full_profile_after_fields($content,$user_id){ $content = "Custom HTML Block with Data"; return $content; } add_filter('upme_full_profile_after_fields','upme_full_profile_after_fields',10,2);
– upme_profile_role_label
– Customize the lable used to display the user roles of profile inside profile fields(Defaults to User Role).
– Default label
function upme_profile_role_label($label){ $label = "Memebrship Type"; return $label; } add_filter('upme_profile_role_label','upme_profile_role_label');
– upme_profile_id_label
– Customize the lable used to display the user ID of profile inside profile fields(Defaults to User ID).
– Default label
function upme_profile_id_label($label){ $label = "Employee No"; return $label; } add_filter('upme_profile_id_label','upme_profile_id_label');
– upme_custom_profile_url
– Link UPME profile title to a custom link overriding the default link.
– Profile Link, Params array(User Id, view, modal, group, use_in_sidebar, context)
function upme_custom_profile_url($profile_link,$params){ $custom_link = 'http://url_here/'. $params['id']; return $custom_link; } add_filter('upme_custom_profile_url','upme_custom_profile_url',10,2);
– upme_custom_profile_pic
– Customize the default profile pic, styles or disable the profile pic.
– Profile picture with link, Params array(User Id, view, modal, use_in_sidebar, context)
function upme_custom_profile_pic($profile_pic_display,$params){ // Disable profile pic return ''; } add_filter('upme_custom_profile_pic','upme_custom_profile_pic',10,2);
– upme_profile_edit_bar
– Customize the buttons used in the Edit/View profile section inside the profile head.
– HTML for exisitng buttons, User ID, Array of paremeters(logout_url,group,use_in_sidebar,type)
function upme_profile_edit_bar($edit_buttons , $id, $params){ //$logout_url = 'Execute upme_logout shortcode here; $edit_buttons = '<a class="upme-button-alt upme-fire-editor" >Save Profile</a>'; $edit_buttons .= '<a class="upme-button-alt upme-fire-editor" href="#edit">Update Profile</a>'; $edit_buttons .= $logout_url; $edit_buttons = '<a class="upme-button-alt upme-fire-editor" >Custom Button</a>'; return $edit_buttons; } add_filter( 'upme_profile_edit_bar','upme_profile_edit_bar',10,3);
– upme_stats_items
– Customize the items in profile stats section.
– Default stats section items, User ID
function upme_stats_items($upme_stats_items,$user_id){ unset($upme_stats_items['posts']); $upme_stats_items['sites'] = '<div class="upme-stats-i upme-stats-comments"><i class="upme-icon-comments-alt"></i><span class="upme-comments-link">'.$user_id.' Sites</span></div>'; return $upme_stats_items; } add_filter('upme_stats_items','upme_stats_items',10,2);
– upme_register_before_head
– Display dynamic content before the head section of registration form. Useful for displaying custom data or messages.
– Empty content
function upme_register_before_head($content){ $content = "Custom HTML Block with Data"; return $content; } add_filter('upme_register_before_head','upme_register_before_head');
– upme_register_after_head
– Display dynamic content after the head section of registration form. Useful for displaying custom data or messages.
– Empty content
function upme_register_after_head($content){ $content = "Custom HTML Block with Data"; return $content; } add_filter('upme_register_after_head','upme_register_after_head');
– upme_register_after_fields
– Display dynamic content after the fields section of registration form. Useful for displaying custom data or messages.
– Empty content
function upme_register_after_fields($content){ $content = "Custom HTML Block with Data"; return $content; } add_filter('upme_register_after_fields','upme_register_after_fields');
– upme_login_before_head
– Display dynamic content before the head section of login form. Useful for displaying custom data or messages.
– Empty content
function upme_login_before_head($content){ $content = "Custom HTML Block with Data"; return $content; } add_filter('upme_login_before_head','upme_login_before_head');
– upme_login_after_head
– Display dynamic content after the head section of login form. Useful for displaying custom data or messages.
– Empty content
function upme_login_after_head($content){ $content = "Custom HTML Block with Data"; return $content; } add_filter('upme_login_after_head','upme_login_after_head');
– upme_login_after_fields
– Display dynamic content after the fields section of login form. Useful for displaying custom data or messages.
– Empty content
function upme_login_after_fields($content){ $content = "Custom HTML Block with Data"; return $content; } add_filter('upme_login_after_fields','upme_login_after_fields');
– upme_new_user_act_admin_content
– Customize the email sent to admin on new user registration, when email confirmation is enabled. Modified email content should be returned.
– Email message, username, email address
function upme_new_user_act_admin_content($message,$user_login,$user_email){ return "Custom User Activation Admin Content $user_email $user_login"; } add_filter('upme_new_user_act_admin_content','upme_new_user_act_admin_content',10,3);
– upme_new_user_act_admin_subject
– Customize the email subject to admin on new user registration, when email confirmation is enabled. Modified email subject should be returned.
– Email subject
function upme_new_user_act_admin_subject($subject){ $subject = "Custom User Activation Admin Subject"; return $subject; } add_filter('upme_new_user_act_admin_subject','upme_new_user_act_admin_subject');
– upme_new_user_act_content
– Customize the email sent to user on new user registration, when email confirmation is enabled. Modified email content should be returned.
– Email message, username, email address, activation link
function upme_new_user_act_content($message,$user_login,$user_email,$activation_link){ $message = "Custom User Activation Message"; return $message; } add_filter('upme_new_user_act_content','upme_new_user_act_content',10,4);
– upme_new_user_act_subject
– Customize the email subject to user on new user registration, when email confirmation is enabled. Modified email subject should be returned.
– Email subject
function upme_new_user_act_subject($subject){ $subject = "Custom Subject for User Activation"; return $subject; } add_filter('upme_new_user_act_subject','upme_new_user_act_subject');
– upme_reset_pass_content
– Customize the email sent to user on password reset. Modified email content should be returned.
– Email message, username, email address, reset page link
function upme_reset_pass_content($message,$user_login,$user_email,$reset_page_url){ $message = "Custom Reset Pass Email Content"; return $message; } add_filter('upme_reset_pass_content','upme_reset_pass_content',10,4);
– upme_reset_pass_subject
– Customize the email subject to user on password reset. Modified subject should be returned.
– Email subject
function upme_reset_pass_subject($subject){ $subject = "Custom Reset Password Email Subject"; return $subject; } add_filter('upme_reset_pass_subject','upme_reset_pass_subject');