Skip Navigation

[Closed] Naming Child Posts Genereation

This support ticket is created 4 years, 2 months ago. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 4 years, 2 months ago.

Assisted by: Christian Cox.

Author
Posts
#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.

The topic ‘[Closed] Naming Child Posts Genereation’ is closed to new replies.