[wp-hackers] Custom post status for a custom post type

Michael Van Winkle mike at mikevanwinkle.com
Tue May 24 20:32:58 UTC 2011


I think the best way to do this right now would be through a taxonomy. You
could set up a private taxomomy for that post type call it
"candidate_status". Then you could create a custom metabox with a select
menu and use wp_set_object_terms() to apply the status on the 'post_save'
hook:
http://codex.wordpress.org/Function_Reference/wp_set_object_terms

Then on the frontend you can use an advanced taxonomy query to filter your
candidates:
http://ottopress.com/2010/wordpress-3-1-advanced-taxonomy-queries/

Alternatively you could set up your candidates using podscms (
http://podscms.org) and use their "pick" column API for the status.

Cheers,

Mike

On Tue, May 24, 2011 at 9:15 AM, Erick Hitter <ehitter at gmail.com> wrote:

> Alex,
>
> Check out this thread from yesterday:
> http://lists.automattic.com/pipermail/wp-hackers/2011-May/039399.html.
>
> Erick
>
> On Tue, May 24, 2011 at 06:53, Alex Hempton-Smith <hempsworth at gmail.com
> >wrote:
>
> > I have a post type of 'Candidates', and instead of the default post
> status'
> > of 'Published', 'Draft' etc I would like to define my own custom ones to
> > replace these, just for that custom post type.
> >
> > How would I go about that? I can't seem to find anything on Google...
> >
> > - - - -
> > Kind regards,
> > Alex Hempton-Smith
> >
> > www.alexhemptonsmith.com
> > www.twitter.com/hempsworth
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
Mike Van Winkle
708-289-3136
mike at mikevanwinkle.com
http://www.mikevanwinkle.com
http://www.twitter.com/mpvanwinkle
http://www.facebook.com/mpvanwinkle


"All excellent things are as difficult as they are rare." -Spinoza


More information about the wp-hackers mailing list