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'd like to add the posts in my loop the ability to toggle them between different post statuses (e.g. publish/draft).

What's the best way to do it?

Thanks in advance!

share|improve this question
add comment

2 Answers

My suggestion is to create a modal popup with an iframe, that loads edit post page "above" the front end page. (use the edit post link and jQuery) Then set the iframe onLoad to hide everything but the publish meta box, where you toggle the draft/ publish. Also set the iframe onunload to reload parent window (the front end behind the modal). When saving to draft/ publish, the main site view reloads with current status for that post.

this is suitable for listed posts, in the category view, to fast remove unwanted stuff.

You can power a lot of admin stuff from the front end with this teq.

The iframe script is tricky and this is an old question, I might paste some code if requested.

share|improve this answer
add comment

There isn't much native functionality in WP to apply admin powers on front end. Front-end Editor plugin is usually great for such, but changing post status is one feature it seems to lack (maybe it's worth suggesting to scribu).

So you are basically stuck with writing this from scratch - implementing JS on front end to make Ajax request and backend handler for it. Unless you need this functionality constantly and daily I would not bother with spending time on it.

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.