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
[ultimatemember_account tab="general"] |
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 | |
function um_custom_review_adjust_rating( $post_id, $old_rating, $new_rating, $new_user_id, $new_reviewer_id ) { | |
update_post_meta( $post_id, '_rating', $new_rating ); | |
$old_user_id = get_post_meta( $post_id, '_user_id', true ); | |
$old_reviewer_id = get_post_meta( $post_id, '_reviewer_id', true ); | |
update_post_meta( $post_id, '_reviewer_id', $new_reviewer_id ); | |
update_post_meta( $post_id, '_user_id', $new_user_id ); |
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_user_pre_updating_profile_array','um_custom_user_pre_updating_profile_array'); | |
function um_custom_user_pre_updating_profile_array( $arr ){ | |
global $ultimatemember; | |
foreach ($arr as $key => $value) { | |
$field = $ultimatemember->fields->get_field( $key ); | |
if( $field['type'] == 'date' && ! empty( $value ) ){ | |
$arr[ $key ] = strtotime( $value ); | |
} |
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( 'option_date_format', 'translate_date_format', 10, 1 ); | |
function translate_date_format( $format ) { | |
do_action( 'wpml_register_single_string', 'Date Formats', 'date format', $format ); | |
$format = apply_filters( 'wpml_translate_single_string', $format, 'Date Formats', 'date format' ); | |
return $format; | |
} | |
// remove the existing filter on init | |
remove_filter( 'um_profile_field_filter_hook__user_registered', 'um_profile_field_filter_hook__user_registered', 99 ); |
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_register_allow_nonce_verification","um_custom_disable_register_nonce",10,1); | |
function um_custom_disable_register_nonce( $disable ){ | |
return false; | |
} | |
?> |
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("init","um_custom_remove_conflicting_actions", 999999 ); | |
function um_custom_remove_conflicting_actions(){ | |
remove_action( 'signup_header', 'thim_multisite_signup_redirect' ); | |
remove_action( 'user_register', 'thim_register_extra_fields', 1000 ); | |
remove_action( 'register_post', 'thim_check_extra_register_fields', 10 ); | |
remove_action( 'register_post', 'thim_register_failed', 99 ); | |
} | |
?> |
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
add_action("init","um_custom_init"); | |
function um_custom_init(){ | |
remove_action('wp_head', 'um_profile_dynamic_meta_desc', 9999999); | |
} | |
add_action('wp_head', 'um_custom_profile_dynamic_meta_desc', 9999999); | |
function um_custom_profile_dynamic_meta_desc() { | |
global $ultimatemember; | |
if ( um_is_core_page('user') && um_get_requested_user() ) { | |
um_fetch_user( um_get_requested_user() ); |
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
/** | |
* Ultimate Member - Customization | |
* Description: Allow everyone to upload profile and cover photos on front-end pages. | |
*/ | |
add_filter("um_user_pre_updating_files_array","um_custom_user_pre_updating_files_array", 10, 1); | |
function um_custom_user_pre_updating_files_array( $arr_files ){ | |
if( is_array( $arr_files ) ){ | |
foreach( $arr_files as $key => $details ){ | |
if( $key == "userphoto" ){ |
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 | |
/** | |
* Hides current user from search query in member directory | |
*/ | |
add_filter('um_prepare_user_query_args', 'um_remove_current_user_from_query', 10, 2); | |
function um_remove_current_user_from_query( $query_args, $args ){ | |
$query_args['exclude'] = array( get_current_user_id() ); | |
return $query_args; |
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 | |
// Requires Ultimate Member v1.3.68+ | |
// Change Displayname for Business category profiles | |
add_filter("um_user_display_name_filter","um_custom_businessname", 10, 2); | |
function um_custom_businessname( $name, $profile_id ){ | |
um_fetch_user( $profile_id ); | |
if( um_user('role') == 'business' ){ | |
$name = um_user("first_name"); | |
} |