Support

Account

Home Forums General Issues Create another post with fields when a post in a relationship field don't exist

Unread

Create another post with fields when a post in a relationship field don't exist

  • I want to do something with a Custom Post Type and custom fields, but I’m not sure if can be done with ease: I want to make a Custom Post Type for “live shows” where all the upcoming ones are listed in single page. The Custom Post Type don’t use title nor “content”, but only fields. All the fields are Date/Time (the show date), Taxonomy (tour name if apply, festival name if apply), Select (ongoing/canceled/posponed/sold out) and Link fields (tickets, more info) AND a more complex one that is a relationship field with another custom post type (¿or taxonomy?) for venues. The “venue” thing has 3 fields in itself:

    • Name of the venue (Text)
    • City (Text)
    • Country (Select list)

    By default I may fill the Venue CTP by themselves and edit in mass in case I have to make a correction to a same Venue applied to many “live shows”, but I’m not sure of how to make it work for the overall default behavior I want to use:

    • By default, in the “live show” CPT there should be a relationship field to link to an existing “venue” (it may show the venue name, the city and the country as part of the title, which I guess it can be done with core WordPress PHP filters)
    • In case the venue is not already created, give me the option fill between the same “live show” edition page the three fields a Venue is made of and when the post is published create a new Venue post with these data applied. This is not unlike when one creates a new taxonomy between the post editor to like to the post, but by displaying 3 editable fields at the moment of doing that instead of just the “name” one.

    I’m not sure how to make the latter half. Some event plugins do stuff like that, but these don’t necessarily use CPT and I have a lot of other issues with these as well. It is possible?

Viewing 1 post (of 1 total)

The topic ‘Create another post with fields when a post in a relationship field don't exist’ is closed to new replies.