관리-도구
편집 파일: upload.min.js
var blog_articles_file_frame;jQuery(function(t){jQuery(document).on("click","input.select-img",function(e){var i=t(this);e.preventDefault();var a=wp.media.controller.Library.extend({defaults:_.defaults({id:"author-info-insert-image",title:i.data("uploader_title"),allowLocalEdits:!1,displaySettings:!0,displayUserSettings:!1,multiple:!1,library:wp.media.query({type:"image"})},wp.media.controller.Library.prototype.defaults)});(blog_articles_file_frame=wp.media.frames.blog_articles_file_frame=wp.media({button:{text:jQuery(this).data("uploader_button_text")},state:"author-info-insert-image",states:[new a],multiple:!1})).on("select",function(){var t=blog_articles_file_frame.state("author-info-insert-image"),e=t.get("selection"),a=t.display(e.first()).toJSON(),r=e.first().toJSON();a=wp.media.string.props(a,r);var l=i.siblings(".img"),n=a.src;l.val(n);var o=i.siblings(".image-preview");o.show(),o.find("img").attr("src",n)}),blog_articles_file_frame.open()})});