/**
 * Gets the jobs status
 *
 * @return string
 */
function get_the_job_status($post = null)
{
    $post = get_post($post);
    $status = $post->post_status;
    $statuses = get_job_listing_post_statuses();
    if (isset($statuses[$status])) {
        $status = $statuses[$status];
    } else {
        $status = __('Inactive', 'wp-job-manager');
    }
    return apply_filters('the_job_status', $status, $post);
}
    /**
     * Adds post status to the "submitdiv" Meta Box and post type WP List Table screens. Based on https://gist.github.com/franz-josef-kaiser/2930190
     *
     * @return void
     */
    public function extend_submitdiv_post_status()
    {
        global $post, $post_type;
        // Abort if we're on the wrong post type, but only if we got a restriction
        if ('job_listing' !== $post_type) {
            return;
        }
        // Get all non-builtin post status and add them as <option>
        $options = $display = '';
        foreach (get_job_listing_post_statuses() as $status => $name) {
            $selected = selected($post->post_status, $status, false);
            // If we one of our custom post status is selected, remember it
            $selected and $display = $name;
            // Build the options
            $options .= "<option{$selected} value='{$status}'>{$name}</option>";
        }
        ?>
		<script type="text/javascript">
			jQuery( document ).ready( function($) {
				<?php 
        if (!empty($display)) {
            ?>
					jQuery( '#post-status-display' ).html( '<?php 
            echo $display;
            ?>
' );
				<?php 
        }
        ?>

				var select = jQuery( '#post-status-select' ).find( 'select' );
				jQuery( select ).html( "<?php 
        echo $options;
        ?>
" );
			} );
		</script>
		<?php 
    }