How to create a custom status?

How can I create a custom status for a custom post type (‘places’ in this example): Add this function to your plugin or function file: … [+]