1. don’t understand
2. understand
3. yes
4. in attachment
5. yes
6. understand
Its complicated, I have a second thought, its easily define title of a post by using 'post_title' => $_POST["fields"]['field_52e6af7f6f4b8']
As like this, can I define field for custom taxonomy “rent”, 'rent' => $_POST["fields"]['field_52e6afd36f4bc']
or for post Tags 'post_tag' => $_POST["fields"]['field_52ee3572071cd']
where field_52e6afd36f4bc or field_52ee3572071cd is custom text field.
If second thought is possible, first is dismissed.
Thanks for holiday replay.
I add bellow code to the theme function.php
$post = array(
'post_status' => 'publish',
'post_title' => $_POST["fields"]['field_52e6af7f6f4b8'] ,
'post_content' => $_POST["fields"]['field_52e6af906f4b9'],
'post_type' => 'post'
);
// insert the post
$post_id = wp_insert_post( $post );
update_field('field_52e6afd36f4bc', $_POST['field_52e6afd36f4bc'], $post_id);
// update $_POST['return']
$_POST['return'] = add_query_arg( array('post_id' => $post_id), $_POST['return'] );
// return the new ID
return $post_id;
}
where “field_52e6afd36f4bc” is the field key of custom taxonomy “rent”. I don’t understand what is update_field()’s $value for frontend new post, where user insert a value, not like the example- $value=”some string”.
And where I put update_field(), into function.php or templete.php.
I know how to display “custom fields” or “custom taxonomy”, question about how to insert data into “custom taxonomy” from frontend. Their is any javascript function or anything. Its too complex, …
I need a frontend post, where user can add post in frontend. Website link is http://tolett.com/?page_id=5 .
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.