I currently have a form where the upload file looks like this:
I would like to make it look like this:
The reason for doing this is because the server already has the files. So I simply want to add the URL in the input field. However, the upload button is important too because we will need to upload files which aren't in the server yet.
How do we best go about this?
I currently have this code:
function wp_custom_attachment() {
wp_nonce_field(plugin_basename(__FILE__), 'wp_custom_attachment_nonce');
$html .= '<input type="file" id="wp_custom_attachment" name="wp_custom_attachment" value="" size="25" />';
echo $html;
}
I tried a method like this but this ended up with a warning:
$html .= '<input type="text" value="" id="wp_custom_attachment" name="wp_custom_attachment" onclick="javascript:document.getElementById(\'file\').click();"><input id="file" type="file" name="img" onchange="ChangeText(this, \'wp_custom_attachment\');"/>';
Warning:
Warning: Illegal string offset 'url' in /path/content.php on line 42

