WordPress.org

Support

Support » Plugins and Hacks » Hacks » [Resolved] wp_insert_post fron a page

[Resolved] wp_insert_post fron a page

Viewing 2 replies - 1 through 2 (of 2 total)
  • At the top of the form, action is left blank:
    action=""

    Action specifies where the form should send the data. The php, which handles the data from the form must be saved to a file on your web server, at the root of the wp installation. If you were to name this ‘frontpost.php’, you would amend action as follows:

    action="/frontpost.php"

    That way the form sends the data to the php file, which then processes it.

    Hope that helps – I’m trying to use this too, but i’m getting the following error:

    Fatal error: Call to undefined function wp_insert_post() in /homepages/25/d288611421/htdocs/intranet/front-post.php on line 26

    Something in the php doesn’t seem to be working.

    If action is left blank and you only have _POST info for the title and content then it works, but if you have any fields that are meant to add meta data, then the php breaks and returns a 404 error.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] wp_insert_post fron a page’ is closed to new replies.
Skip to toolbar