Skip Navigation

[Closed] Custom field for event expiration

This support ticket is created 3 years, 8 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.

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)

Tagged: 

This topic contains 7 replies, has 2 voices.

Last updated by Shane 3 years, 8 months ago.

Assisted by: Shane.

Author
Posts
#1979713

I have a CPT called Events. I want to create a custom field which allows the user to set an expiration date. Once the expiration date has passed the post goes into Draft.

I see you can do this using Forms (https://toolset.com/course-lesson/setting-up-automatic-post-expiration/) but I am not actually using a form for this. This is for internal marketing managers to add content (they use the standard word +New post interface) and so I would prefer them not to have to do this one post type in a totally different way.

Is there a way to set a custom field to have an expire date without using Toolset forms?

Thanks!

#1979975

Shane
Supporter

Languages: English (English )

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

Post Expiration.PNG

Hi Stewart,

Thank you for getting in touch.

In order to set the expiration of posts using our Forms plugin, you must first enable it by going to Toolset -> Settings -> Forms -> Post expiration. Then enable it. From there just set how frequent you want the checks for expired posts to be done.

Finally just setup the post expiration information on your post itself when you are creating the post. See Screenshot

You will need to set this on each individual post that you create.

Thanks,
Shane

#1981835
post-creation-method.PNG
classic.PNG

Apologies maybe I didn't explain correctly. I think the method suggested would only work if the posts were created by a Form?

The issue is I am not actually using forms to create the post. I am using Types to create a post type called Events which has custom fields associated with it but the post itself is actually created using the standard WordPress classic editor (see screenshots). So what I am asking is is there a way to set for example the Custom Date field to have an expiry date?

#1982429

Shane
Supporter

Languages: English (English )

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

Hi Stewart,

Apologies maybe I didn't explain correctly. I think the method suggested would only work if the posts were created by a Form?

No this method actually works even if the posts are created on the backend. I've tested and verified that it works as intended. As long as the post expiration parameter is set then it will expire.

So what I am asking is is there a way to set for example the Custom Date field to have an expiry date?

If you use a custom date field to do this rather than the post date expiration field then you will need to use custom coding to expire the post based on this field. What you can do however is to set the Post expiration field and your custom date field to the same exact datetime. However the post will only expire based on the date set in the Post Expiration field.

Please let me know if this clarifies the issue for you.

Thanks,
Shane

#1982509
Capture.PNG
settings.PNG

I went to Toolset -> Settings -> Forms -> Post expiration and set post expiration (see screenshot) but when I create a post I can't see the post expiration options that you are showing. Am I missing a step?

Thanks

#1982547

Shane
Supporter

Languages: English (English )

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

Hi Stewart,

I must apologize that I didn't include one of the steps to get this working.

You will need to create a frontend form for the post type and then on that Post form enable the "Set expiration date for post created or edited by this form" setting.

Once you've done this then you should see the option now appearing on your Custom Post type when you are creating it from the backend.

Please confirm if you're now able to see the post expiration setting on the post itself.

Thanks,
Shane

#1983609

Ah ok - that makes sense. Just to confirm... this is the only way to set a post expiration date with Toolset? - i.e. you have to use forms. You can't do it using custom fields in any way?

I ask because as I am not using forms it will mean I will have to create a form which won't be used and hide it in some way, which doesn't seem very neat.

Thanks!

#1983683

Shane
Supporter

Languages: English (English )

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

Hi Stewart,

Just to confirm... this is the only way to set a post expiration date with Toolset? - i.e. you have to use forms. You can't do it using custom fields in any way?

That is correct the only way to have the Post Expiration information show up on your Posts on the backend is to first enable the Post Expiration in Toolset ->Settings -> Forms and then Create a Post Form for that post type and then enable "Set expiration date for post created or edited by this form".

I ask because as I am not using forms it will mean I will have to create a form which won't be used and hide it in some way, which doesn't seem very neat.

You won't need to worry about hiding the form because the form doesn't need to be added to any page. All you will be doing is creating it but not adding it to the frontend. Essentially the form won't be visible to any users except admins and only on the backend when they go to Toolset -> Forms.

Please confirm that once you've followed these instructions the post expiration option appears on your custom post type.

Thanks,
Shane

The topic ‘[Closed] Custom field for event expiration’ is closed to new replies.