Note: All code examples on this site are provided for developer reference/guidance only and we cannot guarantee that they will always work as expected. Our support policy does not include assistance with modifying or debugging code from any code examples, and they may be changed or removed if we find they no longer work due to changes in our plugins.
This tutorial applies to users running both Job Manager Resumes and WC Paid Listings and lets you restrict access to the resumes portion of your site to users with an active job package only.
Configure Resume Access
The first step is to configure resumes for capability based access. Go to Resumes > Settings > Resume Visibility and for each permission enter ‘has_active_job_package’.
Add a snippet
The following code snippet can go either in a custom plugin, or your theme functions.php file.
What does it do? When WordPress checks if the user has the correct capability to view resumes, it checks the users packages. If they have a package, they are given the capability dynamically.
Modifying the snippet to also check for active job listings
If you also want to allow resume access if they have an active job listing i.e. one they have posted with their package, we can tweak this snippet to also check the listings they have posted.
If they have an active job listing already posted, this will let them view resumes. When that job expires, this check will no longer return true.