Detect changes to WP native fields in User when using pods_api_pre_save_pod_item #6637
Replies: 2 comments
-
I'm not aware of any built in functionality within pods that would help you there - one way would be to just compare the current user values to the new ones on save - any other ideas @jimtrue ? |
Beta Was this translation helpful? Give feedback.
-
I mean that in the same way I can use pods This would allow using Pods-own methods as a proxy for detecting changes to any field in a pod, whether they come from WP or Pods. The benefit being a single and consistent API for interacting with a Pod, limiting the need to jump between WP's methods/actions/filters and Pods - especially because WP's actions and filters can be a confusing mess whereas Pods is more modern & logical. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a common interface where I use
pods_api_pre_save_pod_item
for all of my models. One of these models is WP'sUser
.I would like to detect when a user updates either their first or last name and automatically set the
display_name
&nick_name
.I understand that this can be done using a standard WP filter, e.g:
update_user_metadata
, but ideally, I'd like to be able to use Pods as a concrete interface to all fields, whether WP or custom. This allows me to keep all before/after save logic confined to the respective object's models, rather than floating around as a usual WP action.Beta Was this translation helpful? Give feedback.
All reactions