This file contains hidden or 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
add_filter("um_user_photos_allowed_image_types","um_user_photos_010223_allowed_webp_image_type", 10, 1); | |
function um_user_photos_010223_allowed_webp_image_type( $arr_types ){ | |
$arr_types[ ] = "image/webp"; | |
return $arr_types; | |
} |
This file contains hidden or 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
// Cover & Profile Photo | |
add_filter("um_get_field__cover_photo","um_010223_allowed_webp_image_type", 10, 1 ); | |
add_filter("um_get_field__profile_photo","um_010223_allowed_webp_image_type", 10, 1 ); | |
function um_010223_allowed_webp_image_type( $data ){ | |
$arr = explode( ",", $data['allowed_types'] ); | |
$arr[ ] = "webp"; | |
$data['allowed_types'] = implode(",", $arr); | |
return $data; |
This file contains hidden or 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
add_filter("um_allowed_image_types","um_010223_default_allowed_image_types"); | |
function um_010223_default_allowed_image_types( $types ){ | |
$types['webp'] = 'WEBP'; | |
return $types; | |
} |
This file contains hidden or 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
add_filter( 'send_retrieve_password_email', 'send_retrieve_password_email_custom', 10, 3 ); | |
function send_retrieve_password_email_custom( $true, $user_login, $user_data ) { | |
um_fetch_user( $user_data->ID ); | |
UM()->user()->password_reset(); | |
return false; | |
} |
This file contains hidden or 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
add_action( 'um_submit_form_errors_hook', 'check_customer_code', 100, 1 ); | |
function check_customer_code( $args ){ | |
if ( isset( $args['customer_code'] ) && $args['customer_code'] != 'ABCDE' ) { | |
UM()->form()->add_error( 'customer_code', 'Please put in the correcct passcode' ); | |
} | |
} |
This file contains hidden or 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_after_user_updated',function( $user_id, $args, $to_update ){ | |
ob_start(); | |
?> | |
<table> | |
<tbody> | |
<?php foreach( $to_update as $metakey => $metavalue ): ?> | |
<tr> | |
<th><?php echo $metakey; ?>:</th> | |
<td><?php echo $metavalue; ?></td> |
This file contains hidden or 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
add_action( 'um_registration_complete', 'um_registration_complete_custom', 10, 2 ); | |
function um_registration_complete_custom( $user_id, $args ) { | |
$url = UM()->permalinks()->get_current_url(); | |
exit( wp_redirect( $url ) ); | |
} |
This file contains hidden or 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
function um_080822_email_notifications( $notifications ){ | |
$notifications['um_greet_todays_birthdays'] = array( | |
'key' => 'um_greet_todays_birthdays', | |
'title' => __( 'Happy Birthday!','um-groups' ), | |
'subject' => 'Happy Birthday from {site_name}', | |
'body' => 'Hi {display_name},<br /><br />'. | |
'"We wish you a happy birthday!', | |
'description' => __('Whether to send the user an email when someone\'s todays birthday.','ultimate-member'), | |
'recipient' => 'member', |
This file contains hidden or 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
add_action( 'um_before_email_notification_sending', function( $email, $template, $args ) { | |
if ( 'custom-role-id' === um_user( 'role' ) && 'welcome_email' === $template ) { | |
add_filter( 'pre_wp_mail', '__return_true' ); | |
} | |
}, 10, 3 ); | |
add_action( 'um_after_email_notification_sending', function( $email, $template, $args ) { | |
if ( 'custom-role-id' === um_user( 'role' ) && 'welcome_email' === $template ) { | |
remove_filter( 'pre_wp_mail', '__return_true' ); | |
} | |
}, 10, 3 ); |
NewerOlder