User Meta In WHERE Clause
-
I’ve got three Pods that I’m using: CPTs for Document and Company and extended User. With both Document and User, I have a related field pulling from Company. I want to have the logged-in User be able to see only the Documents that are assigned to their company or not assigned to a Company, which would be assumed to be public. Follow so far?
I’m using Pods shortcode and am having trouble with the WHERE. I can get the public Documents easily with “related_company.id is null” and I can hard-code the Documents for my Company by using “related_company.id = ‘101’”. The tricky part is getting the user meta for the logged-in user and passing that to the WHERE clause. Can that be done?
- The topic ‘User Meta In WHERE Clause’ is closed to new replies.