mirror of
https://github.com/WordPress/WordPress.git
synced 2024-08-19 20:33:00 +02:00
This also allows us to leverage the builtin `suggestedWidth` and `suggestedHeight` parameters to convey the expected image size. Props ocean90. Fixes #32860. Built from https://develop.svn.wordpress.org/trunk@33075 git-svn-id: http://core.svn.wordpress.org/trunk@33046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 line
523 B
JavaScript
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); |