Skip Navigation

[Résolu] Create post title automatically based on custom field value

This support ticket is created Il y a 1 an 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 - -

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

Auteur
Publications
#1926741

One thing although: the post keeps saving with Auto Cred Save. How to create a title based on a custom field?

#1926805

You can use the WordPress API wp_update_post in your cred_save_data hook to set the post title automatically using text from custom field values. There are several examples in other tickets here in the forum, like these:
https://toolset.com/forums/topic/post-title-from-different-type-fields-not-working-with-cred/#post-900292
https://toolset.com/forums/topic/i-need-a-title-post-to-be-populated-by-a-custom-field/

More information about wp_update_post:
https://developer.wordpress.org/reference/functions/wp_update_post/

If you need more specific guidance, please elaborate on what you want to accomplish and the custom fields involved.