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 to use an additional, arbitrary post status on one of my custom post types. I'm calling it "limbo", and it's assigned to a post which has been deleted by the user, but one that I still want to keep its data on the database for legacy purposes.

I assign it to a post by hijacking the permanent deletion routine, which is to say I'm not really registering it via the proper WordPress function register_post_status, because a) it's not something I want my users to worry about or deliberately assign to their posts; and b) it's only applicable to a single custom post type, which I cannot specifically target with register_post_status.

I don't feel confident that it's the most reliable solution, though.

Is there a routine check that WordPress would run on the database which would detect this invalid post status and revert it, or am I being overly paranoid?

Either way, is there a better solution which wouldn't rely on full-blown plug-ins like Edit Flow?

share|improve this question
    
Have you solved this? If not, can you post the code that you have? –  brasofilo Jul 5 '12 at 1:13
    
I've monitored a test post and everything seems fine so far. I think I must have changed the post_status unwillingly at some point, which got me worried excessively. Still, the question stands unanswered. I don't think the code I have is relevant, though. Think of this: if someone was to change it directly in the db, would it be changed back at some point? –  tbuteler Jul 5 '12 at 7:57

1 Answer 1

up vote 1 down vote accepted

I'm pretty sure only attachments have post status "enforcement" ("inherit" or "private"), and that's only inside wp_insert_attachment(). Otherwise there's no cron action or routine I'm aware of that'll change stati.

I still think you should opt for registering it though. Without any arguments, everything will still behave the way it does currently; they won't appear in post results, nor as part of the admin UI.

And since WP_Query whitelists post stati, you can now use it's awesome power to grab limbos with post_status=limbo ;)

share|improve this answer
    
Thanks @TheDeadMedic! Makes me feel more confident to continue down that path. I took your suggestion and registered it, and everything is fine on the front end too! –  tbuteler Jul 7 '12 at 15:02

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.