Calculating Default Value based on created_at

By: Roland Jungwirth | Asked: 09/09/2023
ForumsCategory: General questionsCalculating Default Value based on created_at
Roland Jungwirth asked 7 months ago
I have a user registration that includes a trial period (in days). Once the user registers, I want the form to calculate the end of the trial period by adding the value of the trial period field and the created_at date. Generally I would do this on the fly using PHP, but I cannot find any way to retrieve the created_at value using PHP. I then tried calculating this by adding [15] + [created-at], but this does not work as the [created-at] shortcode only works in views. Also, I have no clue (and couldn't find any reference) how this would be interpreted, e.g. if [15]=5, how would I tell the calculation that this is days. The reason why I need to know whether the trial period is done - in PHP - is because I want to redirect the user to a payment page. Any ideas on how to implement this would be appreciated.
1 Answers
Best Answer
Victor Font answered 7 months ago
If the end of trial date is a fixed period, having you tried using the new date calculation feature built into Formidable?
Roland Jungwirth replied 7 months ago

Ok, I don't have a fixed period, but by using the current date, that worked. Thank you.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community