0

Simply put, I need to hide all posts on the frontend if they are written by authors with a specific role. The role I have created is called 'Suspended'.

I'm happy with putting a simple IF statement around the loop which prevents posts from a certain role ID from appearing. Preferably though it would be something I can enter into the WP_Query.

I Can't use user ID as there would be xx number of users with the same role.

Does anyone know how this could/ would be done? Any help would be very much appreciated. Thanks in advance.

4

Use WP_User_Query to build a list of suspended authors` ids, then use that list with minuses for inversion as author parameter in query.

  • Nice idea, I'll give it a try. – Adam Moss Jul 5 '11 at 14:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.