We are developing a crowd-funding platform based on Wordpress' "advanced custom fields". In order to create a new funding-project we fill ACF-fields (in a HTML-form). On submitting we create a new WP-page:
$post = array(
'post_name' => $pname,
'post_title' => $pname,
'post_type' => 'page',
'post_parent' => 8,
'page_template' => 'project.php'
);
$this->post_id = wp_insert_post($post);
Strangely we cannot access the field variables with get_field(" ... ")
before we manually click onto "Save" or "Publish" on the page in the Wordpress backend. wp_update_post()
or wp_publish_post()
make no difference.
Do you have any suggestions?
We just found the solution! Using the field key instead of the field name on filling the fields worked!