Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function($){
- $(document).ready(function(){
- $('button#custom_img').live("click",function(event){
- event.preventDefault();
- var imageUploader = wp.media({
- 'title' : 'Upload Image',
- 'button' : {
- 'text' : 'Set image'
- }
- });
- imageUploader.open();
- imageUploader.on("select", function(){
- var image = imageUploader.state().get("selection").first().toJSON();
- var link = image.url;
- $("input.imglink").val( link );
- $(".image_show img").attr('src', link );
- });
- });
- });
- }(jQuery))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement