• I want anonymous users to be able to submit via a form to a custom post_type that I created i.e whatever gets posted is saved as a post of a custom post_type.

    Right now I have a shortcode that outputs a simple form and I am not sure about –
    a) what should go into the form’s action attribute
    b) where exactly do I handle the response ? Do I have to create some sort of hook and then handle it there ? I am so not sure..

    Thanks

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    You could convert your shortcode to a page template, in which case the form can submit to itself and handle the processing all in one place.

    Otherwise POSTs should go through wp-admin/admin-ajax.php or admin-post.php. The first is obviously an AJAX technique using javascript or jQuery. The other uses similar techniques but the user experience is more like a traditional new page load, and no javascript is needed.

Viewing 1 replies (of 1 total)
  • The topic ‘Allowing anonymous users to post to custom post_type’ is closed to new replies.