aksin
Forum Replies Created
-
Or is there simple way to display user meta in specific page based on ID, https://domain.com/print/ID
Thank for Advance
Hi,
I just follow @gelieys suggestion ( Limit the Search in Member Directory with UM Custom Meta Data table )
and in existing my data for user meta “um_user_profile_url_slug_user_id” like this (e.g user id 900):
array ( 0 => '900', )
What we need to achieve is to search user using User ID only.
Thank
Hi,
The point is,
When I’m logged as administrator, How to View a page (e.g https://domain.com/print) as specific logged single user (e.g user id 900)?
What we found in existing UM option is “Login as this user”, but we will be forced to logout as administratior.
Thank for advance
I have tried using following code, but still not working. The idea is only search for the user ID with meta table for meta key “um_user_profile_url_slug_user_id”.
Is there any idea?
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 = ‘um_user_profile_url_slug_user_id’ AND umm_search.um_value LIKE “, $w[0] . ‘%’ ) . ‘)’;
}
}
}
}
}Thank for advance