• Resolved d555555

    (@d555555)


    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

    (@alexandrubodea)

    Hi @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

    (@d555555)

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Get all meta field options programatically’ is closed to new replies.