• Hey Guys

    For some reason Post Expirator is not working, I have tried just about everything, as well as different plugins, none seem to work.

    It is on a multi-site network, where the plugin is activated solely on the site its being used on (not network active). I have tried deactivating all other plugins to see if that might be the interfering, but no different.

    Future posts work fine so wp-cron isn’t the problem.

    Whenever I enable the expiration date the column in the post list doesn’t change from displaying ‘never’ however the correct date and time will show up in the footer of the post. I have tired leaving it over night and scheduling the time for the next day just in-case it a time zone problem and still no luck.

    Does anyone have any idea??

    Thanks in advance
    Tafts

    http://wordpress.org/extend/plugins/post-expirator/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter tafts

    (@tafts)

    UPDATE: Still no luck at all, I installed the ‘core control’ plugin to check that the cron task were happening. The tasks show up but none of the posts are being displayed under ‘Arguments’, where as when scheduling future posts it works and shows the post ID under ‘arguments’. So it seems like the hook happens when scheduled, but its just not attaching the post.

    Same here—the plugin’s been broken since 3.1.

    I’m really hoping the author is working on an update here, as it’s affecting several of my sites.

    Alright, I think I’ve come up with a temporary solution that might work for some of you.

    It’s by no means as elegant as the plugin, as the code below checks whether the post has expired on every page load. If it has indeed expired, its status is set to draft (or private, that’s up to you).

    In the loop — right after the_post(); — place the following code:

    // check to see whether post has expired
    $expiration = get_post_meta($post->ID, "expiration-date", true);
    if ($expiration && (time() > $expiration)) {
    	$postSettings = array(
    		'post_status' => 'draft'
    	);
    
    	wp_update_post($postSettings);
    } else {
    // normal content goes here
    }
    Thread Starter tafts

    (@tafts)

    heintore you are truly awesome, it seems to work fine, sending a post to draft on page load. I was so close too, playing around with similar code. Just what I needed.

    Thanks a lot

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Post Expirator] Posts not expiring – tried everything’ is closed to new replies.