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 | |
/** | |
* Hide unapproved members in the members directory for everybody. | |
*/ | |
add_action( 'um_member_directory_before_query', function() { | |
add_filter( 'um_user_permissions_filter', 'custom_disable_permission_can_edit_everyone' ); | |
} ); | |
function custom_disable_permission_can_edit_everyone( $permissions ) { | |
$permissions['can_edit_everyone'] = 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
<?php | |
/** | |
* Allow to upload vCard files via the "File Upload" field type. | |
* Add this code to the file functions.php in the active theme directory. | |
*/ | |
function um_add_vcard_file_types( $allowed_types ) { | |
if( is_array( $allowed_types ) ) { | |
$vcard_types = array( |
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 | |
/** | |
* Allow to upload video files via the "File Upload" field type. | |
* Add this code to the file functions.php in the active theme directory. | |
*/ | |
add_filter( 'um_allowed_file_types', 'um_add_video_file_types' ); | |
add_filter( 'um_profile_field_filter_hook__file', 'um_profile_field_filter_hook__file_video', 101, 2 ); | |
/** |
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 | |
/** | |
* Restricting Map Bounds and Zoom. | |
*/ | |
add_action( 'wp_footer', function () { | |
?><script type="text/javascript"> | |
function um_user_locations_customize_03 ( args, hash, directory ) { | |
args.center = { |
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 | |
/** | |
* Restrict registration for under 18 years old. | |
* | |
* @param array $args Form Arguments. | |
*/ | |
function um_custom_validate_birth_date( $args ) { | |
if ( ! empty( $args['birth_date'] ) ) { | |
// Birth date as a Unix timestamp. |
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 | |
/** | |
* Display default value if the field value is empty in the profile view mode. | |
* | |
* @param string $value Field Value. | |
* @param string $default Field Default Value. | |
* @param string $key Field Key. | |
* @param string $type Field Type. | |
* @param array $data Field 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
/* member directory grid with 4 columns */ | |
.um-directory:not(.uimob340):not(.uimob500):not(.uimob800):not(.uimob960) .um-members-wrapper .um-members.um-members-grid .um-member { | |
width: 21%; | |
} |
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 | |
/** | |
* When users register on the main site they will be added to all subsites. | |
* | |
* @param int $user_id User ID. | |
* @param array $args Form data. | |
*/ | |
function um_add_user_to_all_blogs( $user_id, $args ) { |
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 "Minimum Number" and "Maximum Number" options as the range filter limits. | |
* Add this code to the file functions.php in the active theme directory. | |
*/ | |
add_filter( 'um_member_directory_filter_slider_common', function( $range, $directory_data, $filter ) { | |
$field_data = UM()->fields()->get_field( $filter ); | |
if ( is_array( $field_data ) && isset( $field_data['min'] ) && isset( $field_data['max'] ) ) { |