- Author was Featured
- Bought between 50 and 99 items
- Exclusive Author
- Has been a member for 3-4 years
- Item was Featured
- Referred between 50 and 99 users
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Sold between 250 000 and 1 000 000 dollars
Hi Guys,
so today I wrote a simple plugin, which allows you to easily invoke and use the built in WP Media Uploader to upload / select images across all your custom admin pages. The whole code you have to write are 2 lines 
1.) Create a upload hyperlink
<a href="'.get_bloginfo('wpurl').'/wp-admin/media-upload.php?TB_iframe=1" media-upload-link="slide-1" class="thickbox">Upload / Insert</a>
You see the “media-upload-link” attribute ? It’s important for identify the invoker of the dialog. For example if you have 10 slides, you will create 10 hyperlinks and fill the attribute with slide-1 to slide-10 
$('.thickbox').attachMediaUploader('media-upload-link', function(url, clicked_link_attr_value ){
$('sliders').find(clicked_link_attr_value).find('input').attr('value', url);
});
so, the callback function get: url -> of the selected image ( can be new uploaded ) clicked_link_attr_value -> value of attribute of the Original invoker (in this example will be “slide-1”);
of course you will have to include jquery and thickbox for your admin pages:
wp_enqueue_script('jquery');
wp_enqueue_script('thickbox',null,array('jquery'));
wp_enqueue_style('thickbox.css', '/'.WPINC.'/js/thickbox/thickbox.css', null, '1.0');
The plugin can be found here :
https://github.com/boobslover/wpmediainvokerThank you kind Sir 
- Has been a member for 4-5 years
- Item was Featured
- Author was Featured
- Bought between 100 and 499 items
- Referred between 200 and 499 users
- Exclusive Author
- Microlancer Beta Tester
- Author had a Free File of the Month
boobslover 
cheers booby 
purethemes said
boobslover![]()
WHAT 
love the github username 
