0

I want to create CPT that have a location address as the title. So the person comes on a page, enter an address, it load suggestions and when he click save it autogenerate the title of the post as the address.

How can I do that?

1 Answer 1

1

Welcome to WPSE. This is a rather broad question and perhaps not quite on topic here, but here are some links that should get you started developing a solution to match your needs.

  • Introduction to Plugin Development - A custom plugin is good place for this kind of custom functionality so it won't be lost if/when you change theme on your site.
  • Use register_post_type() to register your custom post type.
  • Use wp_insert_post() to save new post entries to the database.
  • REST API Handbook - You might need to register one or more custom REST endpoints, for example to handle the suggestions loading and saving the user submitted data, depending on how you implement the address form.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.