Support » Plugin: Post Expirator » [Plugin: Post Expirator] Always On and Default Date/Time Duration for 7 days.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Need to re-write Q2
    Q2. I’m wanting to set the “Default Date/Time Duration” to be 7 days after the publish time/date of the post. What value do I use in the custom field?

    I have the same question as Pauce. Please update me of how to set duration to custom post to expire after 7 days

    Plugin Author Aaron Axelsen

    (@axelseaa)

    Q1. I will consider this for the future, but its not currently possible.
    Q2. You can use the “Default Date/Time Duration” option. Set it to custom, and then enter “+7 days”. This will prepopulate the expiration date boxes.

    I’d also be interested in being able to set the expiration to be always on for a post.

    Handoko

    (@handoko-zhang)

    By editing post-expirator/post-expirator.php, I’m able to make it default always on for new posts/pages.

    1. Go to menu > Plugins > Editor
    2. Select plugin to edit: Post Expirator
    3. Go to line no. 222 and 223 (inside function expirationdate_meta_box)
    4. Change line 222 to $enabled = ‘ checked=”checked”‘;
    5. Change line 223 to $disabled = ”;
    6. Save it by clicking Update File button

    The simple trick above will make all new posts/pages default on for expire time given. But the best is to wait Aaron to implement always on/off feature.

    Handoko

    (@handoko-zhang)

    === Updated ===

    The previous trick above will always enable expire for new or saved posts/pages. I modified to the code to only enable expire for new posts/pages by using get_post_status($post->ID) == ‘auto-draft’.

    1. Go to menu > Plugins > Editor
    2. Select plugin to edit: Post Expirator
    3. Go to line 222 and 223 (inside function expirationdate_meta_box)
    4. Delete line 222 and 223 and add this:

    $enabled = ”;
    $disabled = ‘ disabled=”disabled”‘;
    if (get_post_status($post->ID) == ‘auto-draft’) {
    $enabled = ‘ checked=”checked”‘;
    $disabled = ”;
    }

    Save it by clicking Update File button.

    Hi Handoko Zhang I did what you described above but nothing happened

    }

    $enabled = ”;
    $disabled = ‘ disabled=”disabled”‘;
    if (get_post_status($post->ID) == ‘auto-draft’) {
    $enabled = ‘ checked=”checked”‘;
    $disabled = ”;
    }

    can you please help me set up an default expiration time of say 10 days from publishing?
    is there a function I can put in the loop?

    Handoko

    (@handoko-zhang)

    @qzha017:

    Sorry for the late reply, I don’t get any notification from this forum website.

    My trick may not working correctly now because the plugin has been updated by the developer. The good news is it’s already able to use default expiration on for all new posts/pages.

    It’s also had configuration to use post/page publish time, but I doubt it will working as what we expect to be.

    I suggest you to create a new support topic, if what you mean is not working if the date is based on the publish time.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: Post Expirator] Always On and Default Date/Time Duration for 7 days.’ is closed to new replies.