Close

Account

Documentation

Forum

Menu

something wrong in job-nav-detail.php

  • Post count: 67
    huwcole
    July 15, 2016 at 10:19 pm #21265

    hi guys
    following is wrong in: wp-content\themes\jobplanet-child\fragment\job-nav-detail.php

    if i log in as an employer I get the following buttons:

    Edit Job Detail => correct
    Apply For This Job => wrong, that should not be there, i am the employer
    Bookmark This Job => wrong, that should not be there, i am the employer
    Office Location => correct

    looking at the code:
    line 15

    this is not working because current_user_can( ‘applicant’ ) is always true, no matter if i am logged in as an applicant or employer.

    if you change current_user_can( ‘applicant’ ) to current_user_can( ’employer’ ) and log in as applicant than it picks up that I am an applicant

    and displays only the Office Location button

    so somehow current_user_can( ‘applicant’ ) is not picking up a logged-in user as an applicant and just defaults to true.

    are you able to fix this??? otherwise i rewrite the code myself by checking for employer (as this works).

    thanks

    Post count: 67
    huwcole
    July 15, 2016 at 10:45 pm #21267

    a quick fix to get it working right for the time being is this:

    and all works fine

    but that fix does not fix the underlying issue with the function current_user_can(), namely that it does not pick up applicant

    Post count: 2247
    Jegbagus
    July 16, 2016 at 4:02 am #21276

    hi huwcole, i don’t know what happen with your site. but its working fine on my side. i try to use both employer & applicant to login. and both having right status. i even do debug about it. and don’t have issues. can you check if you you trying to login using admin account?

    Post count: 67
    huwcole
    July 16, 2016 at 8:30 am #21279

    Hi

    sorry i did not explain it properly and forgot to mention the issue is only the case when you are logged in as employer
    and then click on the “Find Jobs” button in the top menu and then click on a job in the list to get to the job details.
    then on the right you have the wrong buttons as I explained in my first post.

    thanks

    Post count: 67
    huwcole
    July 17, 2016 at 9:21 am #21287

    sorry guys my bad…i found what caused this behaviour. I looked at user accounts and noticed that an employer had 2 roles: Employer and applicant as an additional role. that is what caused it.

    sorry for wasting your time there

    thanks

    Post count: 2247
    Jegbagus
    July 18, 2016 at 2:11 am #21292

    ok huwcole 🙂

You must be logged in to reply to this topic.