Skip Navigation

[Closed] there any way to execute code on update on back end?

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

Our next available supporter will start replying to tickets in about 2.62 hours from now. 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)

This topic contains 1 reply, has 2 voices.

Last updated by Shane 3 years ago.

Assisted by: Shane.

Author
Posts
#2218343

There is a any way to autocalculate values when do a change of values on the back end? with a snipet or something.

#2218613

Shane
Supporter

Languages: English (English )

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

Hi Rafael,

Thank you for getting in touch. There are hooks available for wordpress that will allow you to run any code when you've performed an update action on your posts.

The hooks below can be used in such a scenario:

- Can be used if you want to run your code only on existing posts
https://developer.wordpress.org/reference/hooks/post_updated/

- Can be used if you want to run your code for new and existing posts.
https://developer.wordpress.org/reference/hooks/save_post/

There is a any way to autocalculate values when do a change of values on the back end?

Given that the hooks above will allow you to run your code under these scenarios, however it should be noted that a save post or update action needs to be performed for the code to run.

Also when you refer to auto calculating values are you referring to your custom fields ? For e.g adding 2 custom field values together?

Please let me know.

Thanks,
Shane

The topic ‘[Closed] there any way to execute code on update on back end?’ is closed to new replies.