Title: Display meta_key
Last modified: August 16, 2019

---

# Display meta_key

 *  [code_](https://wordpress.org/support/users/amcollaborazioni/)
 * (@amcollaborazioni)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/display-meta_key-2/)
 * as from the title I’m trying to get my meta keys to insert into my contact form
   7 in the form of <select>
 *  ` // Dynamic Select for Contact Form 7
    function dynamic_select_for_custom_posts(
   $choices, $args=array()) {
 *  // Here we grab the posts using the arguments originated from the shortcode
   
   $get_custom_posts = get_posts($args);
 *  // If we have posts, proceed
    if ($get_custom_posts) {
 *  // Foreach found custom post, we build the option using the [key] => [value]
   fashion
    foreach ($get_custom_posts as $custom_post) { $choices[$custom_post-
   >post_title] = $custom_post->post_title; }
 *  // If we don’t have posts, halt! Lets use a generic not found option
    } else{
 *  // Just a generic option to inform nothing was found
    $choices[‘No posts found’]
   = ‘No posts found’;
 *  }
    return $choices; } // Lets add a suggestive name to our filter (we will use
   it on the shortcode) add_filter(‘conjure-posts-dynamically’, ‘dynamic_select_for_custom_posts’,
   10, 2);`
 * after:
 * `[dynamicselect* desired-game class:browser-default class:custom-select include_blank"
   conjure-posts-dynamically post_type=suite posts_per_page=-1 meta_key=metakey_AMC_tavoli"]`
 * obviously my meta key to recover is the following as you can read:metakey_AMC_tavoli
 * I just can’t get the function out to get get_post_meta
 * into function:
 * `$choices[$custom_post->post_title] = $custom_post->post_title;`
 * I don’t want the post titles, but the meta_value of the meta key:metakey_AMC_tavoli
 * my custom post type: suite
 * my meta_key: metakey_AMC_tavoli
 * i can do this?

The topic ‘Display meta_key’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/contact-form-7-dynamic-select-extension.
   svg)
 * [Dynamic Select for Contact Form 7](https://wordpress.org/plugins/contact-form-7-dynamic-select-extension/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7-dynamic-select-extension/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7-dynamic-select-extension/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7-dynamic-select-extension/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7-dynamic-select-extension/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7-dynamic-select-extension/reviews/)

## Tags

 * [meta_key](https://wordpress.org/support/topic-tag/meta_key/)

 * 0 replies
 * 1 participant
 * Last reply from: [code_](https://wordpress.org/support/users/amcollaborazioni/)
 * Last activity: [6 years, 12 months ago](https://wordpress.org/support/topic/display-meta_key-2/)
 * Status: not resolved