I would like to link the creation of a type 'pledge' (post extended) with that of a map marker using MapMarkers.
1) When I create a pledge, I also create a marker, get the ID of the marker in return and save it in the 'pledge' type for future use (update)
2) When I update a pledge, I use the marker ID to post the updated information in the marker using an API.
The information on the MapMarker API is at: hidden link.
To add a new marker, title Headquarter, geocode Main Street 1 Washington, it can be either:
My question is: where do I put that code? Same question for an update (for either the http request or the form)?
I don't see any custom field where I can write a form or execute a http request (using the values of the 'pledge' fields to fill in).
And of course, I would like to be able to set the ID of the new pledge after the marker has been created... If there is already a simple solution without getting back the ID, that would be a great first step.
Subsidiary question: what piece of code/condition should I use to differentiate the behaviour between new 'pledge' (to create a marker) and existing (update)? I suppose that at their creation custom fields are empty.
Actually, Types doesn't offer such solution, except creating Custom Post Types and Custom Fields, which you can use to create/edit/manage via CRED (forms), Views (listing/display/query) or by using Custom Coding (WP standards).
I think the solution you are asking for, does require custom coding involved. You will need to create marker handling via custom coding and upon success, you will need to create/update your particular CPT using WP methods.