Added this code for an image upload field, but it does not work yet:
<?php
function my_admin_scripts() { // load necessary script including new script
wp_enqueue_script('media-upload');
wp_enqueue_script('thickbox');
wp_register_script('my-upload', WP_PLUGIN_URL .'/my-script.js', array('jquery','media-upload','thickbox'));
wp_enqueue_script('my-upload');
}
function my_admin_styles() {
wp_enqueue_style('thickbox');
}
if (isset($_GET['page']) && $_GET['page'] == 'datafeedr-ads') {
add_action('admin_print_scripts', 'my_admin_scripts'); // run javascripts in html header
add_action('admin_print_styles', 'my_admin_styles'); // add your own css styles
}
?>
<tr valign="top">
<th scope="row">Upload Image</th>
<td><label for="upload_image">
<input id="upload_image" type="text" size="36" name="upload_image" value="" />
<input id="upload_image_button" type="button" value="Upload Image" />
<br />Enter an URL or upload an image for the banner.
</label></td>
</tr>