bsottoli
Forum Replies Created
-
Hi Rafsun,
An update, we noted that this behaviuor is only present when we select custom taxonomies (dslc_projects_cat) related to custom post (dslc_project).
We tested with native taxonomy and it’s work fine, but when we try with custom taxonomy the selected category get lost.Thanks.
Bruno.Hi Rafsun, thanks for your response.
We are using just Default Post Category in Settings tab, no category field is used in the form layout.
Here are the screenshots, i tried to show the secuence of actions that result in this behaviour:
1.- We have two configured forms (ignore the sample form):
Image012.- I select last one (Post Form Obras de Arquitectura en Madera) and enter to form properties:
Image023.- Go to Settings tab, you can note here we are using live composer custom post “dslc_projects”:
Image034.- Now i select a Default Post Category “Concurso EPE OARQ”:
Image045.- I Save the form, then the selected category goings gray:
Image056.- Then i return to initial screen and select the recently modified form, entering to form properties, select the Settings Tab again, and no Default Category is showed as selected:
Image06Rafsun, we send a ticket for this case too, Number #101094, this info can be complementary to it.
Thanks a lot.
Bruno.Hi,
Thanks a lot @rafsuntaskin… I achieved it!!!
I added this code in theme’s functions.php, and it is working:function concat_imagesid_to_customfield ($post_id, $form_id, $form_settings, $form_vars) { $files_id = array(); $proj_images =''; //extract $meta_vars from $form_vars list( $post_vars, $taxonomy_vars, $meta_vars ) = $form_vars; //construct $files array to keep files uploaded info (code copied from wp-user-frontend plugin) foreach ($meta_vars as $key => $value) { switch ( $value['input_type'] ) { // put attachment_id in a separate array case 'image_upload': $files[] = array( 'name' => $value['name'], 'value' => isset( $_POST['wpuf_files'][$value['name']] ) ? $_POST['wpuf_files'][$value['name']] : array(), 'count' => $value['count'] ); break; } } //put attached_id's array into $files_id $files_id=$files[0][value]; //concatenate each file_id into $proj_images (or any coustom field value you want) foreach ($files_id as $arch_key => $arch_id ) { $proj_images = $proj_images . $arch_id . ' '; } //save custom field with the new data ('dslc_project_images' or any you want) update_post_meta( $post_id, 'dslc_project_images', $proj_images ); } add_action ('wpuf_add_post_after_insert', 'concat_imagesid_to_customfield', 10, 4);Kind regards.
- This reply was modified 8 years ago by bsottoli.
Thanks a lot!
I’ll try your suggestion this night.Bruno.