Passer la navigation

[Fermé] Naming Child Posts Genereation

This support ticket is created Il y a 4 années et 10 mois. 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.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Fuseau horaire du supporter : America/New_York (GMT-04:00)

Ce sujet contient 1 réponse, a 2 voix.

Dernière mise à jour par Christian Cox Il y a 4 années et 10 mois.

Assisté par: Christian Cox.

Auteur
Publications
#1761319

Hello, I needed to name the children generations for a post type per author creation.

exemple

Person Square create a child post in a table A which is a one-many relationship. Each child in this relationship can also create post type following a one-many frame. When person Triangle makes a post, since the triangle is a child in Table A, it will make the new child in table B, However I needed to name the new generation and keep track of it like 1st Gen, 2nd Gen, 3rd Gen up to 10 Gen but per author.

Thanks

#1761707

Hello, depending on whether the posts are created with Toolset Forms or created in wp-admin, you'll need to use different custom code hooks to programmatically change the name of new posts. If they are created with Forms, you can use the Toolset hook cred_save_data to trigger your own custom code when the new post Form is submitted. We have documentation available for this hook here: https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

If the posts are created in wp-admin, you must use the WordPress hook save_post to trigger your own custom code. The documentation for this hook is available on the WordPress site:
https://developer.wordpress.org/reference/hooks/save_post/

In either case, you can use the WordPress function wp_update_post to set the post title and slug programmatically. This ticket contains some information about that: https://toolset.com/forums/topic/auto-create-and-change-post-title-from-author-name-and-post-last-modified-date/

Let me know if you need more direct guidance on this, and I can provide more specific information.

Le sujet ‘[Fermé] Naming Child Posts Genereation’ est fermé à de nouvelles réponses.