Support

Account

Home Forums Feedback initializing meta data

Helping

initializing meta data

  • I’m attempting to programmatically iterate through fields I’ve attached to a custom post type. For example:

    $fo = get_field_objects($post_id);
    	
    	foreach($fo as $field_object) {
    		$fo_name = $field_object['name'];
    		$thisdoc = get_field($fo_name, $post_id);
    	}

    The problem is it would seem that ACF won’t attach the meta data fields to the post until I go into the dashboard and hit ‘update’ for the post. Not entirely sure what series of hooks this calls to be honest, but if this custom post type was created programmatically using wp_insert_post then the meta data fields won’t be attached to it until this happens.

  • Exactly how are you inserting the values of the custom fields into the database when you insert the new post?

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

The topic ‘initializing meta data’ is closed to new replies.