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
add_filter( 'um_user_cover_photo_html__filter', 'um_cover_image_add_srcset' ); | |
function um_cover_image_add_srcset( $cover_html, $cover_uri, $alt, $is_default, $attrs ) { | |
$cover_min_width = UM()->options()->get( 'cover_min_width' ); | |
$base_dir = realpath( UM()->uploader()->get_upload_base_dir() ) . DIRECTORY_SEPARATOR; | |
$base_url = UM()->uploader()->get_upload_base_url(); | |
//multisite fix for old customers | |
if ( is_multisite() ) { |
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
/** | |
* Find pages that contain old link to the Members page. Search by "um_search=1" | |
* @global wpdb $wpdb | |
* @return array An array of posts IDs | |
*/ | |
function um_find_pages_with_old_static_link_to_the_members_page() { | |
global $wpdb; | |
$pages = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} WHERE post_content LIKE '%um_search=1%' AND post_status = 'publish'" ); |
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
add_filter( 'um_members_directory_sort_fields', 'my_custom_sorting', 10, 1 ); | |
function my_custom_sorting( $sort_fields ) { | |
$sort_fields['last_first_name'] = __( 'Last & First name', 'ultimate-member' ); | |
return $sort_fields; | |
} | |
add_filter( 'um_modify_sortby_parameter', 'my_custom_sorting_handler', 10, 2 ); | |
function my_custom_sorting_handler( $query_args, $sortby ) { | |
if ( $sortby != 'last_first_name' ) { | |
return $query_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
/* For this snippet | |
members2.php - custom Member Directory template filename in "wp-content/themes/your-theme/ultimate-member/templates/" path. | |
members-grid2.php - custom Grid template, customized only for members2.php template, its path is "wp-content/themes/your-theme/ultimate-member/members-grid2.php" | |
*/ | |
add_filter( 'um_get_template', 'my_member_directory_templates', 10, 4 ); | |
function my_member_directory_templates( $located, $template_name, $path, $t_args ) { | |
if ( $template_name == 'members-grid.php' ) { | |
if ( ! empty( $t_args['template'] ) && $t_args['template'] == 'members2' ) { |
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
function um_submit_form_register_remove_conflict() { | |
remove_action( 'user_register', 'bbp_user_register', 10 ); | |
} | |
add_action( 'um_submit_form_register', 'um_submit_form_register_remove_conflict', 9 ); | |
remove_action( 'bbp_profile_update', 'bbp_profile_update_role' ); |
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
remove_action( 'um_members_directory_before_head', [ UM()->User_Locations()->member_directory(), 'header_add_map' ] ); | |
add_action( 'um_members_directory_footer', [ UM()->User_Locations()->member_directory(), 'header_add_map' ], 10, 3 ); |
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
global $wpdb; | |
$min_max = $wpdb->get_col( | |
"SELECT u.ID | |
FROM {$wpdb->users} as u | |
LEFT JOIN {$wpdb->usermeta} um ON ( um.user_id = u.ID AND um.meta_key = 'um_member_directory_data' ) | |
WHERE um.meta_value = 'a:0:{}' | |
ORDER BY u.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
add_filter( 'jb_email_notifications', 'add_my_own_notifications', 10, 1 ); | |
/** | |
* Note: Please insert the email notification's template to your theme | |
* wp-content/themes/{your-theme-folder}/jobboardwp/emails/job_submitted_author.php | |
* | |
* 'job_submitted_author' is a email notification key. Please rename to your own unique key | |
*/ | |
function add_my_own_notifications( $notifications ) { | |
$notifications['job_submitted_author'] = [ | |
'key' => 'job_submitted_author', |
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
function um_account_add_phone_number( $args, $shortcode_args ) { | |
$args .= ',phone_number'; | |
return $args; | |
} | |
$args = add_filter( 'um_account_tab_general_fields', 'um_account_add_phone_number', 10, 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
function um_user_tags_field_oprions_order( $args ) { | |
if ( $args['child_of'] == '{your_tag_source_key}' ) { | |
$args['orderby'] = 'name'; | |
$args['order'] = 'ASC'; | |
} | |
return $args; | |
} | |
add_filter( 'um_user_tags_get_terms_args', 'um_user_tags_field_oprions_order', 10, 1 ); |