Skip Navigation

[Resolved] Integrate with Post Expirator

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.

This thread is resolved. Here is a description of the problem and solution.

Problem:
Set Post Expirator value from CRED.
Solution:
To do this you will need to create a Date field in types and then add that Date field to CRED.

What you can do is to copy the value from the cred field to the _expiration_date custom field.

You can use our CRED Hook to do this. Have a look at the link below.
https://toolset.com/documentation/user-guides/cred-api/#csd

Then you can update the post meta with the following function.
https://codex.wordpress.org/Function_Reference/update_post_meta

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 community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 2 replies, has 2 voices.

Last updated by Ron Clarke 7 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#472727

I am trying to: Integrate CRED with the Post Expirator Plugin

My first thought was to access the hidden field used by Post Expirator and add to the CRED add post form but this failed to show anythibg(possibly because a new post that has not been saved ha no value for _expiration_Date).
My next thought wat to add my own custom field (Expiration Date) and prior to saving the post add a hook function to update the Post Expirator meta data with the value in my custom post. Does this sound like the right approach? Does anyone have an example of this?

#473015

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Ron,

Thank you for contacting our support forum.

Yes this should be possible.

What you can do is to copy the value from the cred field to the _expiration_date custom field.

You can use our CRED Hook to do this. Have a look at the link below.
https://toolset.com/documentation/user-guides/cred-api/#csd

Then you can update the post meta with the following function.
https://codex.wordpress.org/Function_Reference/update_post_meta

If you need more assistance with this please let me know and I will be more than happy to assist.

Thanks,
Shane

#473064

Thanks Shane,
That's what I was thinking. Just wanted to make sure I was on the right track.

Ron

The forum ‘Types Community Support’ is closed to new topics and replies.