Title: First steps in plugin writing
Last modified: August 20, 2016

---

# First steps in plugin writing

 *  [MeScott](https://wordpress.org/support/users/mescott/)
 * (@mescott)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/first-steps-in-plugin-writing/)
 * 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)

 *  [Amy Hendrix (sabreuse)](https://wordpress.org/support/users/sabreuse/)
 * (@sabreuse)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/first-steps-in-plugin-writing/#post-2650255)
 * You’ll probably need to look at the [XML-RPC API](http://codex.wordpress.org/XML-RPC_Support)
   for anything that involves posting from an outside client.
 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/first-steps-in-plugin-writing/#post-2650341)
 * review:
 * [http://codex.wordpress.org/Writing_a_Plugin](http://codex.wordpress.org/Writing_a_Plugin)
 * [http://corpocrat.com/2009/12/27/tutorial-how-to-write-a-wordpress-plugin/](http://corpocrat.com/2009/12/27/tutorial-how-to-write-a-wordpress-plugin/)
 * [http://codex.wordpress.org/Developer_Documentation](http://codex.wordpress.org/Developer_Documentation)
 * i am sure there are probably more guides out there.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘First steps in plugin writing’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 3 participants
 * Last reply from: [t-p](https://wordpress.org/support/users/t-p/)
 * Last activity: [14 years, 1 month ago](https://wordpress.org/support/topic/first-steps-in-plugin-writing/#post-2650341)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
