Support

Account

Home Forums Front-end Issues Query for User Field Type

Unread

Query for User Field Type

  • Hi there:

    Without going into too much detail I have a front end form which uses a field with the user field type to store a list of users who have access to editing a group of posts from a custom post type. I have already successfully set up the portion of the code that assigns the users to the user field.

    The issue I am having is the client for privacy reasons does not want every user’s name and email exposed in this field, it needs to be limited only to users who are currently stored in the value for the field.

    I thought the easiest way to do this would be to use the query filter and use the post__not_in argument to limit the users returned to the field to only the current ones assigned to the value. My question is can the $post_id argument included in the query filter be used to query the current users stored as values for the field?

    A second follow up question is can the query be modified using the prepare field filter? The prepare field filter has the field object as the only argument. Could someone point me towards documentation on the full contents of the field object?

    Thanks in advance for any ideas anyone has!

    -Robert

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.