I have a function that expires posts after a certain amount of time. It also sets a custom post status of 'expired'
. I would like it to function like a 'draft'
post in that the URL is no longer accessible to the public. At the moment, once the post is set to 'expired'
, the full permalink is still visible. Here is my code:
function hrl_custom_status_creation(){
register_post_status( 'expired', array(
'label' => _x( 'Expired', 'post_type_listings' ),
'label_count' => _n_noop( 'Expired <span class="count">(%s)</span>', 'Expired <span class="count">(%s)</span>'),
'public' => true,
'exclude_from_search' => false,
'show_in_admin_all_list' => true,
'show_in_admin_status_list' => true,
'protected' => true,
'_builtin' => true
));
}
add_action( 'init', 'hrl_custom_status_creation' );