[PLUGIN: Post Expirator] Custom Post Type, Custom Status
-
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';
to
$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.
- The topic ‘[PLUGIN: Post Expirator] Custom Post Type, Custom Status’ is closed to new replies.