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( 'wp_ajax_um_member_directory_default_filter_settings', 'um_04292024_show_ajax_member_directory', 1 ); | |
function um_04292024_show_ajax_member_directory() { | |
add_filter( 'um_member_directory_filter_select_options', 'um_04292024_show_all_select_options', 999999, 3 ); | |
} | |
function um_04292024_show_all_select_options( $options, $options_arr, $data ) { | |
$key = $data['metakey']; | |
$options = UM()->builtin()->get_a_field( $key )['options']; | |
$data['options'] = $options; |
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_ajax_get_members_response', function( $data ) { | |
$pagination_range = 6; | |
$max_value = max( $data['pagination']['pages_to_show'] ) + $pagination_range; | |
$min_value = min( $data['pagination']['pages_to_show'] ) - $pagination_range; | |
if( $max_value >= $data['pagination']['total_pages'] ) { | |
$max_value = $data['pagination']['total_pages']; | |
} |
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_filter('um_user_shortcode_filter__country', 'um_091223_user_shortcode_country' ); | |
function um_091223_user_shortcode_country( $value ) { | |
$current_logged_user_id = get_current_user_id(); | |
um_fetch_user( $current_logged_user_id ); | |
if( um_user('country') ) { | |
return $value; // returns the country of the current viewing profile when the current logged-in user's country is not empty | |
} |
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
function um_020123_submit_form_errors_hook__exclude_blockedemails( $args ) { | |
$emails = UM()->options()->get( 'blocked_emails' ); | |
if ( ! $emails ) { | |
return; | |
} | |
$arr_excluded_emails = array( | |
"[email protected]", | |
"[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
add_filter("um_member_directory_filter_select_options_sorted","um_011723_sort_languages",10,2); | |
function um_011723_sort_languages( $options, $atts ){ | |
if( "languages" == $atts['metakey'] ){ | |
$key = 'en'; | |
$value = $options[$key]; | |
unset($options[$key]); | |
array_unshift($options, $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 | |
// Cover & Profile Photo | |
add_filter("um_get_field__cover_photo","um_010223_allowed_webp_image_type", 10, 1 ); | |
add_filter("um_get_field__profile_photo","um_010223_allowed_webp_image_type", 10, 1 ); | |
function um_010223_allowed_webp_image_type( $data ){ | |
$arr = explode( ",", $data['allowed_types'] ); | |
$arr[ ] = "webp"; | |
$data['allowed_types'] = implode(",", $arr); |
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( 'um_submit_form_errors_hook_login', 'um_071621_login_for_specific_role', 10 ); | |
function um_071621_login_for_specific_role( $args ){ | |
if ( isset( $args['username'] ) && $args['username'] == '' ) { | |
return; | |
} | |
if ( isset( $args['user_login'] ) && $args['user_login'] == '' ) { | |
return; | |
} |
NewerOlder