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 the code below to the functions.php file, reproduce the redirect you want to investigate then remove this code. | |
* Look at the debug.log file. You will see detailed information about the redirect. | |
* | |
* Note: Enable debug logging first. See https://docs.ultimatemember.com/article/1751-enable-debug-logging | |
*/ | |
add_filter( 'wp_redirect', function( $location, $status ) { |
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 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 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 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 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; |
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 | |
// Remove all old roles on subscription status change. | |
function um_woocommerce_subscription_status_changed_remove_old_roles( $subscription_id, $old_status, $new_status ) { | |
global $wpdb; | |
if ( ! UM()->WooCommerce_API()->api()->is_wc_subscription_plugin_active() ) { | |
return; | |
} |
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 custom tabs. | |
* | |
* @param array $tabs Account tabs. | |
* @return array | |
*/ | |
function um_account_custom_tabs( $tabs ) { | |
$tabs[ 150 ][ 'custom_tab_01' ] = array( |
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 | |
/** | |
* Shortcode that displays the profile header. | |
* Example: [um_profile_header form_id="7" user_id="1"] | |
* | |
* @global \wpdb $wpdb | |
* | |
* @param array $atts Shortcode attributes: | |
* - (int) form_id - profile form ID. The first profile form if blank. |
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 | |
if ( ! function_exists( 'um_email_locate_template' ) ) { | |
/** | |
* Locate a template and return the path for inclusion. | |
*/ | |
function um_email_locate_template( $template_name ) { | |
$blog_id = is_multisite() ? '/' . get_current_blog_id() : ''; | |
$template = locate_template( |
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 | |
/** | |
* Custom validation and error message for the E-mail Address field. | |
*/ | |
add_action( 'um_custom_field_validation_user_email_details', 'um_custom_validate_user_email_details', 999, 3 ); | |
function um_custom_validate_user_email_details( $key, $array, $args ) { | |
if ( $key == 'user_email' && isset( $args['user_email'] ) ) { | |
if ( isset( UM()->form()->errors['user_email'] ) ) { | |
unset( UM()->form()->errors['user_email'] ); |