WordPress/wp-admin/js/site-icon.min.js

1 line
523 B
JavaScript

!function(a){var b;a(function(){a("#choose-from-library-link").on("click",function(c){var d=a(this);return c.preventDefault(),b?void b.open():(b=wp.media({button:{text:d.data("update"),close:!1},states:[new wp.media.controller.Library({title:d.data("choose"),library:wp.media.query({type:"image"}),date:!1,suggestedWidth:d.data("size"),suggestedHeight:d.data("size")})]}),b.on("select",function(){var a=b.state().get("selection").first(),c=d.data("updateLink");window.location=c+"&file="+a.id}),void b.open())})})}(jQuery);