Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Expired Post Status

Registers a post status called Expired.

// Register Custom Status
function expired_post_status() {

	$args = array(
		'label'                     => '_tm_expired',
		'label_count'               => 'Expired (%s)',
		'public'                    => true,
		'show_in_admin_all_list'    => true,
		'show_in_admin_status_list' => true,
		'exclude_from_search'       => true,
	);
	register_post_status( '_tm_expired', $args );

}

// Hook into the 'init' action
add_action( 'init', 'expired_post_status', 0 );