Any way to use dynamic query args in field groups?

Support General Any way to use dynamic query args in field groups?Resolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #37091
    JohnJohn
    Participant

    Hi,

    I've added a new select field to a post type and if I set the query_args (linked to a relationship), I can filter the default options available to select. I'm setting the to field to the user's ID manually to test, ie where to is user id 4.

    But I need this to be based on the currently logged in user. Is this possible? I've searched and the answer seems to be no.

    Thanks

    #37097
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Currently, it is not possible to add a function to query_args settings in the builder. Please use the code to register the custom fields in this case to assign a parameter to a function that returns a value.

    #37098
    JohnJohn
    Participant

    Thanks Long, that's working great now. Is there a way to force the first option in the dropdown to be selected (it most cases there will only be one) or should I use javascript to do this on page load?

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.