• Resolved olafnekeman

    (@olafnekeman)


    Hi,

    I’m trying to set a category for different users. I’ve got two types of employers on my site. I’m using the following code to create two different forms. Can you show me how I can set a default category for the two types of users?

    switch ($key) {
    						case 'company_name':
    							// Modifications Scholieren spot 16-6-14
    							if (current_user_on_level($level_particulier)) {
    								$field['label']='Uw Naam';
    								} elseif(current_user_on_level($level_zakelijk)) {
    									$field['label']='Bedrijfsnaam';
    									} else {
    										$field['label']='Naam';
    									};

    https://wordpress.org/plugins/wp-job-manager/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mike Jolley

    (@mikejolley)

    If you set the [‘value’] for the particular field, it will be the default value used.

    Thread Starter olafnekeman

    (@olafnekeman)

    I tried this but it doesn’t work.
    `case ‘job_category’:
    if (current_user_on_level($level_particulier)) {
    $field[‘value’]=’Klussen’;
    } elseif(current_user_on_level($level_zakelijk)) {
    $field[‘value’]=’Vacatures’;
    } else {
    $field[‘value’]=’Vacatures’;
    };`
    Do you have other thoughts on this issue?

    Plugin Author Mike Jolley

    (@mikejolley)

    You need to use the category ID for the value.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘default category for different users’ is closed to new replies.