Title and post URL based on custom fields?


I have custom fields in my custom post type. They should serve as a title and post slug for URL. Basically, whenever I change the content of the custom fields, the title field should react accordingly. E.g. if the field NAME contains ‘John’ and the SURNAME ‘Smith’, the title should transform to ‘John Smith’.

The users of the site will be unexperienced so they won’t understand the need of putting NAME and SURNAME and a separate title for that – that’s why I need it.

I know I can display custom field content instead of a title in my template, but that’s not the same. I also need the permalink to be amended accordingly.

So, to recap
My input:
custom field NAME = John
custom field SURNAME = Smith
What should happen:
post title = John Smith
permalink = john-smith (I presume it will process the title extracted from the custom fields as it would normally do)

I hope it’s clear now. Thanks indeed for any suggestions.

, , polish bastard 9 years 2014-05-11T03:58:54-05:00 0 Answers 82 views 0

Leave an answer