humanmade / humanmade/repeatable-posts

Suggestion: Add unpublish option

Abierto
#27 4 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
PHP
Estrellas
48
Forks
12
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

This may seem like a strange suggestion when reading only the title, but please hear me out :)

For a website i'm (heavily) working on, I have a lot of seasonal relevant posts. Preferably, I would like these posts to only appear when they are in season.

## An example for repeating + unpublishing
Let's say that we have a generic post about Christmas. The post should become visible every year in December (thus repeatable). Since the post isn't relevant the rest of the year it should be unpublished on the first of January (either change from 'published' to 'draft' or 'remove' altogether. Perhaps this implementation can possibly be combined with #5 ?).

I'm curious to hear what others think of this idea (interesting, useless?)

## How could this 'unpublishing' be achieved?
An idea for implementation is as follows:

1. option to set an _unpublish date_ from the admin interface
2. when saving the post, either save OR remove the _unpublish date_ from the post's meta info. Which of these actions is executed is dependent of user input.
3. when the meta info changes, set a [scheduled event](https://codex.wordpress.org/Function_Reference/wp_schedule_event) to unpublish the post, or remove an earlier set scheduled event (if any).

_Extra:
4. upon post delete / restore, trigger action nr. 3._

## ...and repeatable unpublishing?
For repeatable posts, one could hook into the scheduling of the next post, and correct the _unpublish date_ in the meta info with the repeat interval.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Start by reviewing the admin interface, post meta handling, and the scheduled-event flow around wp_schedule_event. Check how post delete and restore actions are handled, and consider the relationship to issue #5. Done means an agreed design supports one-time and repeatable unpublishing without leaving outdated scheduled events.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
php, wordpress
Área
backend
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.