Support » Plugin: Advanced Custom Fields » How to display post form in page

  • Hi,

    Please help in how to add the form that I created using this plugin into a page. I want a loggedin user to use this form to create a post for a specific category and submit the post. Once the post is submitted, the user can edit the post in future if required.

    I got stuck after creating the form. Unable to know how to integrate the form to a page for users to submit posts.

Viewing 1 replies (of 1 total)
  • Create one form manually based on your fields. Then you can insert post by wp_insert_post() method. After that, you can update custom post by update_field() method.

    Demo Code:-

    if($_POST['title']){
     $arr = $_POST['title'];
     $post_id = wp_insert_post($arr);
     update_field('extra_data', $_POST['extra_data'], $post_id )
    }
    • This reply was modified 4 months, 4 weeks ago by  Arshid.
    • This reply was modified 4 months, 4 weeks ago by  Arshid.
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.