Skip Navigation

[Resolved] Is there a hook to catch saving a new custom field?

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 7 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by yarivH 7 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#466329

I am trying to duplicate custom fields. Suppose I create a new custom field, example: address, and I want to catch its update and add another field called address1. Can this be done via any hooks?
Can you give me an example for code using such a hook?

Thanks

#466413

Dear yariv,

I suggest you try with the wordpress built-in action hook update_postmeta:
https://developer.wordpress.org/reference/hooks/update_postmeta/
Fires immediately before updating a post’s metadata.

#466614

I meant to capture adding a field while working inside types, not inside posts. But your reply made me realize I can hook with update_option.
Thanks.

The forum ‘Types Community Support’ is closed to new topics and replies.