CF7_get_custom_field value from dropbox gets number value instead of text
-
Hi great plugin!
I have been pulling info from a custom textbox field of a custom post type to send some additional information in a email.
Recently we changes the custom textfield in the Edit Post page to a dropbox with various options.
When I put it like this: [dynamichidden dynamichidden-525 “CF7_get_custom_field key=’property_owner'”]
It grabs the numeric postid of the item in the dropbox, but the idea is to give the textvalue that is in the dropbox (witch is the title of another custom post type).The code of the dropbox inside the costum post type is the following:
if( !function_exists('ownerestate_box') ): function ownerestate_box($post) { global $post; wp_nonce_field(plugin_basename(__FILE__), 'owner_property_noncename'); $mypost = $post->ID; $originalpost = $post; $owner_list = ''; $picked_owner = (get_post_meta($mypost, 'property_owner', true)); $args = array( 'post_type' => 'estate_owner', 'post_status' => 'publish', 'posts_per_page' => -1 ); $owner_selection = new WP_Query($args); while ($owner_selection->have_posts()){ $owner_selection->the_post(); $the_id = get_the_ID(); $owner_list .= '<option value="' . $the_id . '" '; if ($the_id == $picked_owner) { $owner_list.=' selected="selected" '; } $owner_list.= '>' . get_the_title() . '</option>'; } wp_reset_postdata(); $post = $originalpost; print ' <label for="property_zip">'.__('Proprietário Responsável: ','wpestate').'</label><br /> <select id="property_owner" style="width: 237px;" name="property_owner"> <option value="">none</option> <option value=""></option> '. $owner_list .' </select>'; } endif;
https://www.ads-software.com/plugins/contact-form-7-dynamic-text-extension/
- The topic ‘CF7_get_custom_field value from dropbox gets number value instead of text’ is closed to new replies.