This thread is resolved. Here is a description of the problem and solution.
Problem:
How to set CRED different post expiration date for each CRED post created.
Solution:
You should add date field to your CRED form and then use date field value and assign it to CRED expiration and use CRED API hook 'cred_save_data'.
This support ticket is created 7 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
So this is what should be happening (refer back to the private post if you need to check the urls)
1) I create a job post using the cred form embedded in the /create-job page
2) I fill in all the fields in this from- title, overview etc and add an expiry date using the generic field (see screenshot)
3) When I hit submit the job is posted to the the list on the /internal-vacancies page
4) When the expiry date (that I previously set) passes the job post is deleted so it no longer shows on the /internal-vacancies page
Note - The code that you previously suggested to go in functions.php has been added to a plugin which is activated
I'm about to resolve your issue but I need FTP access details temporarily. Could you please share FTP access details so that I should be able to fix the issue.
Remove this code from your current theme's functions.php file:
add_action('cred_save_data', 'my_save_data_action',10,2);
function my_save_data_action($post_id, $form_data){
// if a specific form
if ($form_data['id']==7067){
$expiry_date = $_POST['_cred_post_expiration_time']['timestamp'];
update_post_meta($post_id, '_cred_post_expiration_time', $expiry_date );
}
}
Once you remove this coded, please let me know. Site will be start functioning again.
1) deleted the code from my Jobs Expiry plugin
2) Took the code that you added to my functions.php (we not allowed to modify the functions.php in production) and moved it into my Jobs Expiry plugin
I've created a test job to run overnight . Hopefully this should work now - i'll let you know
Even to test what you can do is:
=> Create a new job
=> select expiration date = yesterday , that is 4th july, 26016
=> Wait for 2 mins
=> Check your view after 2 mins, that newly created job will not be displayed on view job listing page
I hope above solution will help you to resolve your issue.