Tag Info

Hot answers tagged

2

After struggling around for days through the poorly documented media modal source code and using code from the gist (thanks, Fabien), I came up with a solution: JS: wp.media.controller.Custom = wp.media.controller.State.extend({ initialize: function(){ this.props = new Backbone.Model({ custom_data: '' }); this.props.on( ...


2

It was actually easier than I thought. function route_uploads_past_cdn( $url, $path ) { $upload_paths = array( 'async-upload.php', 'media-new.php' ); if( !in_array( $path, $upload_paths ) ) { return $url; } return str_replace('www.', '', $url); } add_filter( 'admin_url', 'pew_route_uploads_past_cdn', 10, 2 ); The URL for ...


1

After digging through the media modal code, I came up with the answer to my question: wp.media.controller.Custom = wp.media.controller.State.extend({ initialize: function(){ this.props = new Backbone.Model(); }, // called when the toolbar button is clicked customAction: function( controller ){ // get the value of a media ...


1

The renaming to test1.jpg is not due to any cropping / resizing functions WordPress. This is because you already had a file named test.jpg uploaded, and WordPress does not replace files if one exists in the folder that has the same name. If, for some reason you want it to replace files rather than rename it (not recommended) you can use a plugin like: ...



Only top voted, non community-wiki answers of a minimum length are eligible