Have a question
-
Hello.
I have 2 user roles.
Teachers and Agents.When user Register as Teacher I have a logical questions.
Do u offer also Agent service? – and user can select yes or no.Now, I have a 2 member directory created, teachers and agents
and in Agent directory I want to show also teachers, who has selected agent service.how can I do it?
Can I do it with php custom code?
Thanks
-
Hi @shara94
Have you tried selecting the roles in the “User Roles to Display” options? Please go to WP Admin > Ultimate Member > User Roles > Edit a Role > see “General Options” > see Roles in the “User Roles to Display”.
Regards,
@champsupertramp
Thanks for reply.I dont understand really what u mean.
Where is General Option? see screenshots –
http://prntscr.com/1zzcqh6
http://prntscr.com/1zzctu6
http://prntscr.com/1zzcur6
http://prntscr.com/1zzcur6
http://prntscr.com/1zzcvqmMaybe you don’t understand what I want.
So, I can explain more better.
I have 2 register form, first one is for teachers and second one is for agents.
In teacher’s register form I have a question: Are you offer Agent Service?
and Answers is yes or no.So, I have created 2 directory, for Teachers and for Agents.
I would like in Agents directory to show also teachers, who has selected YES I OFFER AGENT SERVICE.
I hope you understand.
Thanks
-
This reply was modified 4 years, 6 months ago by
shara94.
Hi @shara94
Sorry for the mixup. I gave you the wrong path. Please see the General Options in the WP Admin > Ultimate Member > Member Directories > edit a directory.
You can set the admin filtering there to display users based on the filter value e.g. Offer Agency Service. You can also show the “Offer Agency Service” as a member directory search filter, see “Search Options” when you edit the Member Directory.
Regards,
@champsupertramp
I know what u mean, but no I don’t want it..
in directory, if I select also teachers. Than shows all teachers. here is not any filter. to show only teachers, who has selected agent offer.I have found your code
/** * Show users with a Job Title "'WP Plugin developer " only **/ add_filter('um_prepare_user_query_args', 'um_my_custom_query_args', 99, 2); function um_my_custom_query_args( $query_args, $args ) { if( $args["form_id"] == "1" ) { // you can validate the current member directory form ID $query_args['meta_query'][] = array( "relation" => "OR", array( 'key' => 'job_title', 'value' => serialize( 'WP Plugin developer' ), 'compare' => 'LIKE' ), array( 'key' => 'job_title', 'value' => 'WP Plugin developer', 'compare' => '=' ) ); } // endif return $query_args; }This is what I want. but dont understand what is “relation” ?
or ‘compare’ ?
Hi @shara94
Relation relates to how the data in one table is related to the data in another table. Compare is Operator to test the ‘value’. Try changing the “WP Plugin developer” to your preferred search keyword and see if it works for you.
Regards,
Look, http://prntscr.com/1zztugx
this is Field.This is code – http://prntscr.com/1zztwrq
Result is nothing is found but on the website is a teacher who has Selected agent service ja.
Screenshots: http://prntscr.com/1zztwrqand this is user profile – http://prntscr.com/1zzu3zn
When I write code, all registred Agents also removed from Agent directory and nothing is show. but usually, some agents are registred.
Hi @shara94
Could you please provide screenshots of the Member Directory settings? Please go to WP Admin > Ultimate Member > Member Directories > Edit a directory.
Regards,
Thanks for letting us know.
Regards,
@champsupertramp
Do u know why does not work condition logical in popups?
For example as u know, I have register form with Conditional logic.if is selected something show other field.
this function does not work when I insert register shortcode in popups. I have tried many plugin but its same to all.
any Idea?
Thanks
Hi @shara94
The register form has to be visible on page load for the conditional logic to work. When the register form is hidden, the javascript cannot find the hidden form to process the conditional logic fields.
Regards,
-
This reply was modified 4 years, 6 months ago by
The topic ‘Have a question’ is closed to new replies.