• Resolved jsegura1706

    (@jsegura1706)


    Hi, i have installed your plugin and i have found an issue when set expirate post programmatically.

    i use this code to set expiration programmatically:

    if (function_exists(‘postExpirator_init’)) {
    /**
    * Expiration types:
    *
    * – draft
    * – delete
    * – trash
    * – private
    * – stick
    * – unstick
    * – category
    * – category-add
    * – category-remove
    *
    * For “category”, add additional attributes:
    * ‘category’ => $categoryId,
    * ‘categoryTaxonomy’ => $taxonomyName
    */
    $options = [
    ‘expireType’ => ‘delete’,
    ‘id’ => $postId,
    ];
    $postId = 258;
    $timeStamp = date(‘U’, strtotime(‘2021-06-25 10:00:00’));

    _scheduleExpiratorEvent($postId, $timeStamp, $options);
    }

    the issue occurr when i set the post expiration by code, the same time i set the expiration, it is expiration run too.

    example: if i set expiration by code at 10:30am, it is expire at the same 10:30am. It doesnt expire at the datetime expiration i have set.

    I am using the latest version of the plugin.

    here i share the debug logs:

    2022-05-25 10:31:56 3683 -> PROCESSED trash Array ( [expireType] => trash [category] => [categoryTaxonomy] => [enabled] => 1 )
    2022-05-25 10:31:49 3683 -> NO PAYLOAD ON SAVE_POST
    2022-05-25 10:31:47 3683 -> CRON EVENT SCHEDULED at mié, 25 May 2022 06:46:47 -0400 (1653475607) with options Array ( [expireType] => trash [id] => 3683 ) no error

    i hope can you help me! Thanks.

The topic ‘Post expiring the same time that is schedule programmatically’ is closed to new replies.