No way to find the author of an item when using pods_api_pre_save_pod_item #6642
Replies: 3 comments
-
Ok, seems this is possible using some un-documented steps: set number of params for This provides the post ID of the item to be saved (presumably auto-draft....?). In the handler method for the filter, do Perhaps the docs need updating with this 3rd param? |
Beta Was this translation helpful? Give feedback.
-
hi take a look at the author is part of $pieces[ 'object_fields' ] like the post title - sorry for the trouble :( @jimtrue maybe a thing for updating docs! |
Beta Was this translation helpful? Give feedback.
-
@quasel I'd say on these what is more helpful? We can't possibly document every single thing in $pieces because it's a huge structure. We could give folks a 'road map' to identify where to find things they more than likely would be using. @sc0ttkclark Does that sound like something you could easily do? |
Beta Was this translation helpful? Give feedback.
-
It seems that when using the
pods_api_pre_save_pod_item
filter, there's no way to know the author of the item about to be saved.In my use case,
wp_get_current_user
can't be used, because the current user may be an admin creating a record for someone else.Beta Was this translation helpful? Give feedback.
All reactions