Skip Navigation

[Resuelto] delete all custom post a user created when deleting the user from the users list

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem:
When deleting a user in the backend, how is it possible to make sure that any custom posts they have authored are deleted?

Solution:
WordPress offers you the choice when deleting a user to delete their content or re-assign it.

But it will only consider content as belonging to the user if the custom post type is registered with the 'supports' option set to include author.

When registering a post type with Types at Toolset > Post Types you must specify "author" under the "Sections to display..." section.

This support ticket is created hace 6 años, 10 meses. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por davidZ-4 hace 6 años, 10 meses.

Asistido por: Nigel.

Autor
Mensajes
#609156

Tell us what you are trying to do? delete a user from the user list and with it delete all the custom posts the user created.

Is there any documentation that you are following? i couldn't find anything

Is there a similar example that we can see? the default WordPress behavior is to ask what to do with user's posts when the user is deleted. I always selected delete all users posts but still see all the custom posts the user created in the same place...

What is the link to your site? equiblocks.com

#609291

Nigel
Supporter

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+00:00)

Hi David

I just tested this myself on a local install and when I deleted a user and chose to delete their posts that's exactly what happened, all of their posts, including custom posts created using Types, were deleted.

I don't have any info about your site.

If you are seeing something different, that the posts are not deleted, what happens to them? They are re-assigned to another author?

Can you check if this happens on a minimal install, i.e. with the twentyseventeen theme and with all non-Toolset plugins de-activated.

#609510

Hi Nigel,

i took a deeper look at this and it seems that the posts were assigned to the admin even though i selected to delete content.

to view the author i had to go to the post type and under the "Section to display when editing" check the Author box.
i check posts of user that were deleted and i can see that the Author changed to the admin account.
i then created a custom post type with another user account, then deleted the user and this time the content was deleted. strange!

to confirm this is the behavior i tested even further:
i created two different post types by a user, post type A had the Author box under "Section to display when editing" checked while post type B didn't.
i deleted the user and as expected post type A was deleted but not post type B.

Not sure this is a bug or by design...
at the moment I will use this work around and hope toolset will change/fix this.

Thanks,

David