Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want a way to make all pages with certain tags public.

I don't care if a solution is programatic or via GUI (though I prefer programatic), I just want to be able to make all pages with a certain tag public with just one "click-of-the-button" so to speak.

EDIT:

Oops. I thought pages could have tags just like posts. My intention is to make a bunch of static pages, show them to someone to approve them, and if they approve of the pages, then make them public all at once for the world to see. Is there a way to do this?

share|improve this question
    
What do you mean by public? –  m0r7if3r Feb 20 '12 at 2:37
    
Can you please clarify your question? Pages - i.e. static pages - don't have tags, and by default, all content is publicly accessible. –  Chip Bennett Feb 20 '12 at 3:06
    
I am a little confused myself. But I provided an answer based on what I think you're asking and if I am not correct, based on further information I will revise and help you out. –  DigitalSea Feb 20 '12 at 3:06
add comment

1 Answer

I am not entirely sure what you're asking, so I'm going to stake a wild stab in the dark until you can provide more information provided I don't tell you exactly what you wanted to know. If by public you mean; pages with a certain tag lets say for this example the tag is 'public' and pages that only registered and logged in users can access aren't tagged with public.

The simple answer would be in your post loop you would get a list of post tags assigned to the post using the function wp_get_post_tags and then check to see if the public tag exists, if it doesn't show an error message telling the user the post is not accessible or perhaps even redirect the user using the wp_redirect function.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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