Automattic / newspack-popups

Popup notifications.
GNU General Public License v2.0
70 stars 17 forks source link

feat: prompt expiration date #1305

Closed adekbadek closed 1 month ago

adekbadek commented 2 months ago

All Submissions:

Changes proposed in this Pull Request:

Adds a prompt expiration date, so prompts can be set to automatically revert to draft state at a certain date.

How to test the changes in this Pull Request:

  1. Create or edit a prompt
  2. Open the new sidebar panel called "Expiration", toggle the setting on and choose a date
  3. Save the prompt
  4. Using WP CLI, set an expiration date in the past (the UI will obviously block such possibility) (wp post meta set <post-id> expiration_date '2024-03-13T10:43:06')
  5. Verify that the newspack_popups_check_expiry cron event is set to run in under an hour (wp cron event list)
  6. Either wait for an hour or trigger the cron event (wp cron event run newspack_popups_check_expiry)
  7. Edit to post – observe that it has been reverted to draft, with a notice saying so at the top of the editor
  8. Publish the post, observe that the expiration date has been removed and there's a notice saying so

Other information:


matticbot commented 1 month ago

:tada: This PR is included in version 2.33.0-alpha.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

matticbot commented 1 month ago

:tada: This PR is included in version 2.33.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: