Title: Get all meta field options programatically
Last modified: October 17, 2022

---

# Get all meta field options programatically

 *  Resolved [d555555](https://wordpress.org/support/users/d555555/)
 * (@d555555)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/get-all-meta-field-options-programatically/)
 * Hi,
 * I am creating a plugin for a client who uses WCK. I need to fetch all possible
   options for a select field he created with the WCK Custom Field Creator.
 * Do you have a helper function that I can use for that? Where are these stored
   in the database?
 * Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Support [alexandrubodea](https://wordpress.org/support/users/alexandrubodea/)
 * (@alexandrubodea)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/get-all-meta-field-options-programatically/#post-16109943)
 * Hi [@d555555](https://wordpress.org/support/users/d555555/),
 * The custom field data is stored as a custom post type and associated meta-data.
   You can use this code to export all custom fields data you have defined inside
   WCK:
 *     ```
       $all_custom_fields = get_posts( "post_type=wck-meta-box&posts_per_page=-1" );
       			foreach( $all_custom_fields as $key => $value ) {
                       # the $key is the post object with the metabox data
       				$all_custom_fields[$key]->postmeta = get_post_custom( $value->ID );
       			}
       ```
   
 * This will give you everything you have defined inside Custom Fields Creator. 
   Do a var_dump($all_custom_fields) to see the exact data structure or inspect 
   the array with a debugger.
 * Best regards,
 *  Thread Starter [d555555](https://wordpress.org/support/users/d555555/)
 * (@d555555)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/get-all-meta-field-options-programatically/#post-16111675)
 * Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Get all meta field options programatically’ is closed to new replies.

 * ![](https://ps.w.org/wck-custom-fields-and-custom-post-types-creator/assets/icon-
   256x256.png?rev=2257602)
 * [Custom Post Types and Custom Fields creator - WCK](https://wordpress.org/plugins/wck-custom-fields-and-custom-post-types-creator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wck-custom-fields-and-custom-post-types-creator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wck-custom-fields-and-custom-post-types-creator/)
 * [Active Topics](https://wordpress.org/support/plugin/wck-custom-fields-and-custom-post-types-creator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wck-custom-fields-and-custom-post-types-creator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wck-custom-fields-and-custom-post-types-creator/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [d555555](https://wordpress.org/support/users/d555555/)
 * Last activity: [3 years, 7 months ago](https://wordpress.org/support/topic/get-all-meta-field-options-programatically/#post-16111675)
 * Status: resolved