• I’m developing an iOS app that lets anyone who has installed the app take a picture and upload it to a WordPress blog. I don’t need a front end at all: the picture + some metadata are sent as a POST request to a page in WordPress, and that page should then handle the rest–creating a post and attaching the image to it. I know that wp_insert_post() and media_handle_upload() are the function I’m going to need for the PHP part, but I’m lost on how to create my very basic plugin.

    I’ve created a PHP page in my plugins directory with the header information, and that is recognized by the plugins manager in the WP admin. However, I don’t know what my next step would be? Obviously, directly sending the request to this page isn’t going to work, as it doesn’t include() anything WP related. Calling wp_insert_post() and media_handle_upload() would thus result in “Call to undefined function” errors.

    I know of the action hookups, but I’m not really sure which one to use in this case.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘First steps in plugin writing’ is closed to new replies.