Limit relationship fields in front-end forms
-
Hello,
I’m building a front-end form to add a new post of a particular post type, let’s say ‘book’. This pod has a relationship field that links it to a second post type, let’s say ‘library’.
In the dashboard i’ve limited the list of libraries in the relationship field using the where clause in the Relationship Options tab, like this: t.ID=43, where 43 is the desired library ID.
When I try to do the same using an array of options for this field, including the where clause, it is not working:
$my_pod = pods('my_pod');
$fields = array(
'related_library' => array('where'=>'t.ID=43')
)
$my_pod->form($fields);I’ve read the documentation pages about form method, about find method and the find notation options. Is “where” clause available into the form() method? If not, is there any other way to filter or limit relationship fields in front-end forms?
The page I need help with: [log in to see the link]
- You must be logged in to reply to this topic.