Support » Plugin: Post Expiration Date » Not working with Custom Post Type

  • Resolved candeeg


    I made a custom post type, but I don’t see the expiration option. What do I need to add to the “Supports” of the post type array to add this?

    		'labels' => array(
    			'name' => __('Cruises'),
    			'singular_name' => __('Cruise'),
    		'public' => true,
    		'rewrite' => array("slug" => "cruises"), 
    		'supports' => array('thumbnail','editor','title','custom-fields','excerpt',)

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • tobyy


    it seems to support only posts out of the box.

    to add the metabox to custom post types or pages you can add this to your functions.php:

    function mycustomposttype_add_expire_date_metabox() {
    	add_meta_box( 'hugu_ped_expire_date_metabox', __( 'Expiration Date', 'hugu'), 'hugu_ped_expire_date_metabox_callback', array( 'mycustomposttype', 'page' ), 'side', 'high' );
    add_action( 'add_meta_boxes', 'mycustomposttype_add_expire_date_metabox' );

    just replace “mycustomposttype” with your custom post type!

    Plugin Author Huguette Inc


    Yes @tobyy that looks great. Thanks for stepping in.

    I haven’t specifically addressed custom posts but fixes like this work well with the the way the plugin is constructed.



    Thanks @toby and @hugetteinc.
    I used the fuction and now I have a box on the custom post “Expiration Date” but it doesn’t have a date picker and typing in a date has no effect.


    Plugin Author Huguette Inc


    Right now the datetime picker is only working in Chrome/Opera. If you want to test in a different browser you can use a format that looks like this:


    YYYY-DD-MMTHH:MM with the “T” just being a separator.

    v1.2 will support all modern browsers is in code review now and will be released in a few days.



    That did it, thanks!



    Code above tested & approved. Great thank you lads 🙂

    Definitely a great feature to add the expiration date on custom post type as a native feature in the next version.

    It would be awesome to set up the expiration date based on the value of post custom fields 😉


    I thought i asked this already, but how can I add this to a WooCommerce product page?

    Great Job. Thanks a lot !

    I second this request. I just downloaded the plugin to use specifically on a custom post type.

    I will try to get this working via the function – but yes, out of the box support seems like it would be a great step forward 🙂

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.