New post status for custom post type

There is a great Step by Step description on how to do that here https://www.jclabs.co.uk/create-custom-post-status-in-wordpress-using-register_post_status/

To add your custom post status to the drop-down menue, just add the following to your themes function script:

add_action('admin_footer-post.php', 'jc_append_post_status_list');
function jc_append_post_status_list(){
 global $post;
 $complete="";
 $label="";
 if($post->post_type == 'recipes'){
      if($post->post_status == 'aggregated'){
           $complete=" selected=\"selected\"";
           $label="<span id=\"post-status-display\"> Aggregated</span>";
      }
      echo '
      <script>
      jQuery(document).ready(function($){
           $("select#post_status").append("<option value=\"aggregated\" '.$complete.'>Aggregated</option>");
           $(".misc-pub-section label").append("'.$label.'");
      });
      </script>
      ';
  }
}

With this you have your custom post status up and running in 5 min, saved me a bunch of time!

Leave a Comment