I’ve created a very nice custom post type using the fantastic ACF plugin, but now I need a way for users to submit posts from the front end. Plugins like Gravity forms and Front-end Editor are nice, but don’t work very well for this.
Is there a way that I can make the same Back-end edit form show up on a front end page? or alternatively Disguise part of the back-end site to look like the front-end?
Any help would be much apreciated
Not sure if it would work but have you checked out Scribu’s front-end editor?
or check this thread
What you’re asking for is not possible because of the security checks for user capabilities and admin referrer checks. It would be best for you to create a form on the front-end and use the wp_insert_post()
if(isset($_POST['foo_bar'])): //Verify nonce and referrer //Validate data $args = array( 'post_status' => 'draft', 'post_content' => esc_html($content), 'post_title' => esc_attr($title) ); $foo = wp_insert_post($args); //If the post was inserted, wp_insert_post() will return the post ID of the new post if($foo) echo "bar"; endif; //Create your form with a hidden nonce field here.
I’ve built several forms like this using a static template as well as an AJAX version. It isn’t that hard to do. Just make sure you take every precaution to verify the integrity of the data and hide the input form from evil doers.
This is now possible with ACF. Just take a look at the documentation to see how to create a front-end form for both creating a new post and editing an existing one.