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_profile_tabs", "um_072522_add_comment_count", 10 ); | |
| function um_072522_add_comment_count( $tabs ){ | |
| if( isset( $tabs['comments'] ) ){ | |
| $args = array( | |
| 'user_id' => um_profile_id(), // Use user_id. | |
| 'count' => true // Return only the count. | |
| ); | |
| $comments_count = get_comments( $args ); | |
| $tabs['comments']['notifier'] = $comments_count; |
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_action( 'um_registration_complete', 'um_072522_redirect_to_previous_after_register', 10, 2 ); | |
| function um_072522_redirect_to_previous_after_register( $user_id, $args ){ | |
| if( 5 == $args['form_id'] ){ | |
| $previous_page_url = $_COOKIE['um_previous_page']; | |
| if( ! empty( $previous_page_url ) ){ | |
| setcookie('um_previous_page', null, strtotime('-1 day')); | |
| wp_redirect( $previous_page_url ); exit; | |
| } | |
| } |
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_action("um_pre_users_query","um_061522_pre_users_query", 10, 3 ); | |
| function um_061522_pre_users_query( $obj, $directory_data, $sortby ){ | |
| if( $obj->is_search == true && ! empty( $_POST['search'] ) ){ | |
| if( ! empty( $obj->where_clauses ) ){ | |
| foreach( $obj->where_clauses as $k => $w ){ | |
| if( strpos( $w, 'umm_search' ) > -1 ){ | |
| $w = explode(" OR ", $w ); | |
| $obj->where_clauses[ $k ] = str_replace("( umm_search.um_value = ", "( umm_search.um_key = 'first_name' AND umm_search.um_value LIKE ", $w[0] . '%' ) . ')'; |
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_admin_bulk_user_actions_hook', function( $actions ){ | |
| $actions['custom_action_key'] = array( 'label' => 'Custom Action Name' ); | |
| return $actions; | |
| }); | |
| add_action( "um_admin_custom_hook_custom_action_key", function( $user_id){ | |
| um_fetch_user( $user_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( 'um_profile_field_filter_hook__date', 'um_061421_profile_field_filter_hook__date', 80, 2 ); | |
| function um_061421_profile_field_filter_hook__date( $value, $data ) { | |
| if ( ! $value ) { | |
| return ''; | |
| } | |
| if( $data['metakey'] !== 'birth_date' ){ | |
| return $value; | |
| } |
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_action('template_redirect',function(){ | |
| global $post; | |
| if ( um_is_core_page( 'login' ) && is_user_logged_in() ) { | |
| $restriction = get_post_meta( $post->ID, 'um_content_restriction', true ); | |
| if( $restriction ){ | |
| $access = $restriction['_um_custom_access_settings']; | |
| $accessable = $restriction['_um_accessible']; | |
| $is_redirect = $restriction['_um_access_redirect']; | |
| $url = $restriction['_um_access_redirect_url']; |
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_cover_area_content_dropdown_items',function( $items, $profile_id ){ | |
| unset( $items[1] ); | |
| unset( $items[2] ); | |
| return $items; | |
| },11,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
| add_filter( 'um_cover_area_content_dropdown_items',function( $items, $profile_id ){ | |
| unset( $items[0] ); | |
| unset( $items[1] ); | |
| return $items; | |
| },11,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
| add_action("um_user_before_query","um_052422_orderby_profile_photo", 999999999, 2 ); | |
| function um_052422_orderby_profile_photo( $query_args, $obj ) { | |
| $obj->query_args['meta_query'][ ] = array( | |
| 'relation' => 'OR', | |
| 'wxo_featured_clause' => array( | |
| 'key' => 'account_status', | |
| 'compare' => 'awaiting_admin_review' | |
| ), | |
| array( |