10+
June 9, 2012
June 9, 2012
WordPress has a wonderful JavaScript/iframe dialog for uploading or choosing images to use
in posts or as featured thumbnails. Repurposing this dialog for other uses is difficult.
Image Upload Helper is a simple library that helps you add an image upload/selection field
anywhere in the WordPress admin, using a single function.
Created by Flightless with significant credit to Modern Tribe
This is a library. It doesn’t actually do anything by itself. To use it in a plugin:
require_once( 'image-upload-helper/image-upload-helper.php' );image_upload_helper() wherever you want an upload dialog available.The image_upload_helper() function takes an array of arguments to control exactly what the form
looks like.
field_name – Required. The name of the form field that will be submitted. Defaults tofield_name value, you can call image_upload_helper() as often as you like on each page.thumbnail_id – The attachment ID of the current value of the field.label – The label to use for the field. Defaults to “thumbnail image”. This willsize – The size of the image you want displayed in the form. Defaults to “post-thumbnail”.When a form is submitted with an Image Upload Helper field, the field specified by the field_name argument
will contain the attachment ID of the selected image.
No FAQ provided.
Initial version
No previous versions available.