This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Author: Champ | |
* Site: www.champ.ninja | |
*/ | |
/** | |
* 1. Set the recipient email with the variable $member_address | |
* 2. Ensure that this new email template is turned on in WP Admin > Ultimate Member > Settings > Emails | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Subscribe to my newsletter: www.champ.ninja | |
*/ | |
add_filter("um_locate_user_profile_not_loggedin__redirect",""um_custom_deleted_profile_redirect", 99 ); | |
function um_custom_deleted_profile_redirect( $url ){ | |
$url = '/my-404-page/'; | |
return $url; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action("um_before_form","um_custom_error_message_before_form", 9, 1 ); | |
function um_custom_error_message_before_form( $args ){ | |
if( $args['form_id'] != 123 ) return; // apply to form ID 123 | |
if ( UM()->form()->count_errors() > 0 ) { | |
_e("There are field errors below","ultimate-member"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter("um_upload_image_process__profile_photo","um_custom_profile_photo_size", 1, 7 ); | |
function um_custom_profile_photo_size( $response, $image_path, $src, $key, $user_id, $coord, $crop ){ | |
$quality = UM()->options()->get( 'image_compression' ); | |
$image = wp_get_image_editor( $image_path ); // Return an implementation that extends WP_Image_Editor | |
$temp_image_path = $image_path; | |
//refresh image_path to make temporary image permanently after upload, generates file name e.g. profile_photo-custom.jpeg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Current logged in user | |
$user_id = get_current_user_id(); | |
if( class_exists("UM_Verified_Users_API") && class_exists("UM_Profile_Completeness_API") ){ // check if extensions exist and active | |
if( is_user_logged_in() && ! is_page("custom-page-slug") ){ // If user is logged in / don't redirect when in the dashboard or custom page. | |
$get_progress = UM()->Profile_Completeness_API()->get_progress( $user_id ); | |
if ( $get_progress['progress'] == 100 ) { // Check if progress is 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This code sample shows you how to use the API to create | |
and add custom notifications (for real-time notifications) | |
plugin. | |
STEP 1: You need to extend the filter: um_notifications_core_log_types with your | |
new notification type as follows for example | |
*/ |