Skip Navigation

[Resolved] Calculated fields

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

Problem:
Calculated fields

Solution:
The best way is to write the custom shortcodes as per your need of calculation.

Relevant Documentation:
https://toolset.com/documentation/customizing-sites-using-php/updating-types-fields-using-php/

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

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

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by nicolaS-3 5 years, 11 months ago.

Assisted by: Minesh.

Author
Posts
#1169469

Hi,
is there any tutorial explaining how to create calculated fields ? for example, I need a field "subscription expire date" = today (registration date) + 365. I might need other similar fields in the future (set values like A=100 or Y=A+B, etc.). What's the best approach to get this ?
Thanks
Regards
Nicola

#1169686

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - the best way is to write the custom shortcodes as per your needs.

We do not have exact Docs but I will share here which is available for now that may give you the idea:
=> https://toolset.com/documentation/adding-custom-code/how-to-create-a-custom-shortcode/
=> https://toolset.com/documentation/adding-custom-code/how-to-use-toolset-api-hooks-in-custom-code/
=> https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/

As I understand you want to apply some calculations once the post is saved from backend (admin). If this is true, you need to use the standard save_post action.

More info:
=> https://toolset.com/documentation/customizing-sites-using-php/updating-types-fields-using-php/

#1169737

My issue is resolved now. Thank you!