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 | |
// Redirect users to a different URL the first time they log in. | |
add_action( 'um_on_login_before_redirect', 'my_on_login_before_redirect', 9, 1 ); | |
function my_on_login_before_redirect( $user_id ) { | |
$first_login = get_user_meta( $user_id, '_um_first_login', true ); | |
if ( empty( $first_login ) ) { | |
update_user_meta( $user_id, '_um_first_login', current_time( 'mysql', true ) ); | |
// Set a custom redirect URL for the first time login here. |
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 | |
// Save the page URL on registration. | |
add_action( 'um_registration_set_extra_data', 'um_registration_set_extra_data_custom', 10, 3 ); | |
function um_registration_set_extra_data_custom( $user_id, $args, $form_data ) { | |
if ( isset( $_SERVER['HTTP_REFERER'] ) ) { | |
$url = esc_url( wp_unslash( $_SERVER['HTTP_REFERER'] ) ); | |
update_user_meta( $user_id, 'um_registration_page_url', $url ); | |
} elseif ( isset( $_SERVER['REQUEST_URI'] ) ) { | |
$url = esc_url( wp_unslash( $_SERVER['REQUEST_URI'] ) ); |
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 | |
// Send the "New User Notification" email when profile is updated. | |
add_action( 'um_user_after_updating_profile', function( $to_update, $user_id, $args ) { | |
$GLOBALS['um_temp_submitted'] = isset( $args['submitted'] ) ? $args['submitted'] : $args; | |
function um_user_after_updating_profile_submitted( $value ) { | |
return $GLOBALS['um_temp_submitted']; | |
} | |
function um_user_after_updating_profile_timestamp( $value ) { |
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 all approved users whose Ultimate Member profiles are public to the sitemap. | |
*/ | |
add_filter( 'wpseo_sitemap_entry', 'um_wpseo_sitemap_entry', 10, 3 ); | |
add_filter( 'wpseo_sitemap_exclude_author', 'um_wpseo_sitemaps_users' ); | |
/** |
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 | |
/** | |
* Use Map ID to customize the user location map. | |
*/ | |
add_action( 'wp_footer', function () { | |
?><script type="text/javascript"> | |
function um_user_locations_customize_mapId( args, hash, directory ) { | |
args.mapId = 'YOUR_MAP_ID'; |
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 | |
/** | |
* Change the map marker title and image. | |
*/ | |
add_action( 'wp_footer', function () { | |
?><script type="text/javascript"> | |
wp.hooks.addFilter('um_user_locations_marker_data', 'um_user_locations', function (marker_data, hash, userdata) { | |
// Change the map marker title. |
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 | |
/** | |
* Disable Clustering | |
*/ | |
add_action( 'wp_footer', function () { | |
?><script type="text/javascript"> | |
wp.hooks.addFilter( 'um_member_directory_disable_clustering', 'um_user_locations', function ( disableClustering, directory ) { | |
disableClustering = true; | |
return disableClustering; |