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 | |
// Set a role admin email address for the "Account Needs Review Notification" email. | |
add_action( 'um_before_email_notification_sending', function( $email, $template ) { | |
if ( 'notification_review' === $template ) { | |
$role = um_user( 'role' ); | |
// role admins. | |
$role_admins = array( | |
'subscriber' => '[email protected]', |
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 | |
// Redirect from the empty profile to Account. | |
add_filter( 'um_ultimatemember_shortcode_disable_singleton', function( $disable, $args ) { | |
if ( ! empty( $args['form_id'] ) ) { | |
$post_data = UM()->query()->post_data( $args['form_id'] ); | |
$form_data = array_map( 'maybe_unserialize', $post_data ); | |
$args = array_merge( $args, $form_data ); | |
} | |
if ( 'profile' === $args['mode'] && ! empty( $args['use_custom_settings'] ) && ! empty( $args['role'] ) ) { |
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 | |
// Automatically follow the brand profile on registration. | |
add_action( 'um_registration_set_extra_data', function( $user_id, $args ) { | |
if ( defined( 'um_followers_version' ) ) { | |
// all new members will "follow" this brand profile. | |
$brand_user_id = 1; | |
if ( UM()->Followers_API()->api()->can_follow( $brand_user_id, $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 | |
// Apply the role's auto-verify feature when the role is changed manually. | |
if ( function_exists( 'um_after_user_role_is_updated' ) ) { | |
add_action( 'add_user_role', 'um_after_user_role_is_updated', 20, 2 ); | |
add_action( 'set_user_role', 'um_after_user_role_is_updated', 20, 2 ); | |
} |
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 | |
/** | |
* Plugin Name: Ultimate Member - Conflicts Fix | |
* Description: Disable conflicting plugins on UM pages. | |
* Author: Ultimate Member support team | |
* Author URI: https://ultimatemember.com/support/ | |
* Version: 1.0.0 | |
* | |
* Add this code to the file /wp-content/mu-plugins/um_conflicts_fix.php | |
*/ |
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 image field into the variable "user" used to build member directory cards. | |
*/ | |
add_filter( 'um_ajax_get_members_data', 'custom_um_ajax_get_members_data', 10, 3 ); | |
function custom_um_ajax_get_members_data( $data_array, $user_id, $directory_data ) { | |
// Enter the field meta_key you need. | |
$key = 'um_image_upload'; |
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 | |
/** | |
* Display custom images in the member directory grid. | |
*/ | |
add_filter( 'um_ajax_get_members_data', function( $data_array, $user_id, $directory_data ) { | |
// List needed fields here. | |
$fields = array( | |
'um_image_upload', |
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 | |
// Continent field. | |
function custom_continent_choices_callback() { | |
// choices array. | |
$options = array( | |
"africa" => "Africa", | |
"america" => "America", | |
"eurasia" => "Eurasia", |
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 | |
/** | |
* Display all form errors in the popup. | |
*/ | |
add_action( 'um_after_form', function () { | |
if ( ! empty( UM()->form()->errors ) ) { | |
$error_text = implode( '<br>', UM()->form()->errors ); | |
?> | |
<div id="um_form_errors" style="display:none;"> |