Title: Custom image upload coding for functions.php
Last modified: August 21, 2016

---

# Custom image upload coding for functions.php

 *  [philperrin](https://wordpress.org/support/users/philperrin/)
 * (@philperrin)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/custom-image-upload-coding-for-functionsphp/)
 * I’m incorporating some custom fields on functions.php to be used for extending
   profile fields. I’m having difficulty implementing an upload feature so that 
   users can upload a profile image. Any advice? THANKS!

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

 *  [Hassan1](https://wordpress.org/support/users/hassan1/)
 * (@hassan1)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/custom-image-upload-coding-for-functionsphp/#post-4087412)
 * It’s not as simple as other text based fields!
 * You need to search for a pre-made upload class. Just Google: PHP uploader and
   implement it in your PHP code.
 * If it’s all backend you can use WP image uploader:
    [http://mikejolley.com/2012/12/using-the-new-wordpress-3-5-media-uploader-in-plugins/](http://mikejolley.com/2012/12/using-the-new-wordpress-3-5-media-uploader-in-plugins/)
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/custom-image-upload-coding-for-functionsphp/#post-4087414)
 * Have you tried using [wp_handle_sideload()](http://codex.wordpress.org/Function_Reference/wp_handle_sideload)?
   The documentation is sparse, you can learn more by studying the source code.
 * Be very careful from whom, where, and what you allow to be uploaded. Many sites
   have been hacked by allowing indiscriminate uploads. And some thought they were
   being careful but were not devious enough to see the hole in their security.
 *  Thread Starter [philperrin](https://wordpress.org/support/users/philperrin/)
 * (@philperrin)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/custom-image-upload-coding-for-functionsphp/#post-4087444)
 * Thanks.
    I’ll check out the Mike Jolly media uploader post – but I am looking
   for a front-end solution for a custom profile page… so we’ll see.
 * Sideload() looks promising – not much documentation, but this could lead me to
   where I need to be:
    [http://wordpress.stackexchange.com/questions/34730/uploading-images-to-media-library-via-wp-handle-sideload-fails](http://wordpress.stackexchange.com/questions/34730/uploading-images-to-media-library-via-wp-handle-sideload-fails)
 * This has been informative:
    [http://wordpress.org/support/topic/plugin-user-photo-front-end-upload?replies=17](http://wordpress.org/support/topic/plugin-user-photo-front-end-upload?replies=17)
 * As well as this:
    [http://wordpress.stackexchange.com/questions/4307/how-can-i-add-an-image-upload-field-directly-to-a-custom-write-panel/4413#4413](http://wordpress.stackexchange.com/questions/4307/how-can-i-add-an-image-upload-field-directly-to-a-custom-write-panel/4413#4413)
 * I use theme-my-login to password protect the entire site. Nothing should be accessible
   to any external user who is not logged in. External registration is not permitted–
   this is a closed-off site.
 * Once I get this working, I’ll post the results here and mark as solved. Ideally,
   if an image is uploaded for the user, the image will be displayed (and resized
   proportionally). The upload object should be a simple directory box with a ‘Browse’
   button next to it that opens an old fashioned file upload box (only permitting
   image file types).
 * Thanks for your help. I’ll post back soon!

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

The topic ‘Custom image upload coding for functions.php’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 3 replies
 * 3 participants
 * Last reply from: [philperrin](https://wordpress.org/support/users/philperrin/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/custom-image-upload-coding-for-functionsphp/#post-4087444)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
