Sauter la navigation

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

This support ticket is created Il y a 3 années et 1 mois. 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
- 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)

Ce sujet contient 1 réponse, a 2 voix.

Dernière mise à jour par Shane Il y a 3 années et 1 mois.

Assisté par: Shane.

Auteur
Publications
#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

Les langues: Anglais (English )

Fuseau horaire: 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

Le sujet ‘[Fermé] there any way to execute code on update on back end?’ est fermé à de nouvelles réponses.