• Resolved gicrom

    (@gicrom)


    Hi there and thanks for this fantastic plugin.
    I’ve just noticed that the hidden field _expiration-date disappear in the post’s custom field after the post is expired. How to keed this field? I would like to query posts that are expired.
    Thanks for your collaboration.

Viewing 1 replies (of 1 total)
  • Plugin Support Riza Maulana Ardiyanto

    (@rizaardiyanto)

    Hi @gicrom

    It’s not possible to disable the expiration right now because the metadata indicates that expiration is enabled. If you leave it as is, the expiration process might keep running repeatedly.

    As a temporary solution, you can use an action hook, publishpressfuture_post_expired, which triggers after a post expires. This hook can add another post meta to store a log of the expiration event. Here’s an example of how you can implement this:

    add_action('publishpressfuture_post_expired', 'futureLogPostExpiration', 10, 2);
    
    function futureLogPostExpiration($postId, $expirationLog) {
        add_post_meta($postId, '_post_expiration_log', time(), false);
    }

    This function adds a timestamp to the post meta _post_expiration_log whenever a post expires.

Viewing 1 replies (of 1 total)
  • The topic ‘Field _expiration-date disappear’ is closed to new replies.