It has an option to link form fields to any of my fields
– can I know what do you mean by fields? e.g. Custom Fields
sorry, haven’t used that plugin before
Thread Starter
adzay
(@adzay)
Hi sorry.
Basically, If i was to make a form input field ( with the plugin) and call the form field: “colour”, there is an option that allows me to select that field, and then link it to my already created custom field “Color_attribute” etc. So when someone selects a colour in the form on the front end, that custom field is filled in for the post.
It works perfectly well for custom fields ( That I made myself). The form is even able to fill in the title, description and thumbnail.
It does not work for the core event manager fields such as ” Date to”, ” Start time”, “location address”. Which is what I would like. Are they technically ‘custom fields’?
I already asked on the Formidable plugin forum if there is a php option form me to assign the custom fields, so I can have an opportunity to use “$EM_Location->location_town”.
They told me to come back to you with the question in the first post. 🙁
here is a link to the “create a post” function the plugin has ( I do not expect you to read all, but just to get a quick Idea)
actually, haven’t tried that plugin before that is why can’t comment on this yet; however, maybe the best option is using custom fields just like what you did and since location are custom post type; is that plugin doesn’t support CPT with custom field attach?
Thread Starter
adzay
(@adzay)
It does..Which is strange. Every custom field ( Made with Advanced custom field, doubt that is relevant though) in the locations/events post type is filled in easily by the form. Even the Title, description and Thumbnail.
What doesn’t work are the following:
Locations Post type:
Location Address
Location Town
Location region etc
Events Post type:
Event date start/end
Event start/end time
and locations fields
The above fields do not work.
I found on the plugin support site that someone used this method to set the post title with success.
$_POST['frm_wp_post']['102=post_title'] = $_POST['item_meta'][102]
with “$_POST[‘item_meta’][102]” being the value of the form field.
Do you know how I can change this so it can target one of the event manager fields such as Location_town, Event_start_date etc?
I attempted the following with no Luck:
$_POST['location_town'] = $_POST['item_meta'][102]
Thread Starter
adzay
(@adzay)
Oh wow I figured it out. I used get_post_custom_values to list the field names and found that your fields have a ‘_’ at the begining.
So for example it wasn’t “location_town” it was “_location_town”. It works with the plugin.
Thanks
I see, glad it worked now; btw, those are save in wp_postmeta table e.g. _location_town, _location_region