Created
November 4, 2014 12:42
-
-
Save khromov/adb5d414584327716cce to your computer and use it in GitHub Desktop.
ACF PRO create post on frontend
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| acf_form(array( | |
| 'id' => 'your-form', | |
| 'post_id' => 'new_post', | |
| 'new_post' => array( | |
| 'post_type' => 'post', | |
| 'post_status' => 'publish', | |
| 'post_author' => get_current_user_id() | |
| ), | |
| 'field_groups' => array('group_544f441dc5661', 'group_544f49a3060b0', 'group_5451dc41933e4'), //Your ACF groups | |
| 'return' => add_query_arg( 'post_added', 'true', home_url( $_SERVER['REQUEST_URI'] ) ), | |
| 'html_before_fields' => '', | |
| 'html_after_fields' => '', | |
| 'submit_value' => 'Create post', | |
| 'updated_message' => 'Post created' | |
| )); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment