Home › Forums › Backend Issues (wp-admin) › Hide comments in backend for users who don\'t have custom field option set › Reply To: Hide comments in backend for users who don\'t have custom field option set
You’re going to need to use pre_get_comments. Unfortunately, I cannot find much documentation on this. Nor can I find much information on WP_Comment_Query https://codex.wordpress.org/Class_Reference/WP_Comment_Query But it should allow you two alter the comments returned just like pre_get_posts. Here’s a general idea of what to do.
1) See if the user can see the secure area, if yes then return without doing anything
2) Get all the post ID’s for the posts in the secure area and add them to post__not_in
I don’t know if this will work.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.