Support » Plugins » [PLUGIN: Post Expirator] Custom Post Type, Custom Status

  • Resolved tzeldin88


    The Post Expirator plugin is amazing! I made two modifications though, so I want to share in case others have the same needs.

    The plugin works on Posts and Pages, but can also work on a Custom Post Type.
    Edit your post-expirator.php, adding:

    // for custom post type "report"
    function expirationdate_meta_report() {
    	add_meta_box('expirationdatediv', __('Post Expirator'), 'expirationdate_meta_box', 'report', 'advanced', 'high');
    add_action ('dbx_post_advanced','expirationdate_meta_report');

    My wp also has custom post statuses, thanks to a combination of the Edit Flow plugin, and the new built-in support in wp3.0 for register_post_status. So when a post expires, I am changing its status to “Archived” instead of “Draft” or “Trash”. I edited post-expirator.php, changing a few instances of
    $expiredStatus = 'draft';
    $expiredStatus = 'archived';
    I also tried adding an option for “archived” to the admin ui dropdown, which correctly set the option in the database to “archived” but that wasn’t enough, there was some php that must have ignored it.

    Hope this helps someone.

Viewing 1 replies (of 1 total)
  • I would only mention 2 things for this post:

    1) You have to give it the name of the custom post type. Where is says ‘report’

    2) You can actually just add it to you functions.php file. That way you don’t have to worry about it getting erased when you have to upgrade the plugin in the future.

Viewing 1 replies (of 1 total)
  • The topic ‘[PLUGIN: Post Expirator] Custom Post Type, Custom Status’ is closed to new replies.