Brady Brady - 11 months ago 84
PHP Question

Wordpress create a new post status?

In Wordpress you get the default post statuses: Published, Draft and Pending Review. Is it possible to add some more post types via registering them via the function.php file of the active theme?

Also is it possible to edit the lables of the Publish Meta Box? What I'm submitting really isnt Publishing...

Also like to add I only want these changes made when in my custom post type I've made.

Kind Regards


Answer Source

Since WP 3.0, you can use the register_post_status() function ( ) to add new statuses to a post type.

WP itself uses register_post_status() to register the default "published", "draft", etc. statuses on init using the create_initial_post_types() function in wp-includes/post.php ( ).

Look at the code in those links, and you can get an idea of how to use the function.

I hope that helps you get started!