WP is showing wrong image dimensions

How to get real image dimension of already uploaded images which dimensions are bigger than one now set in media settings? (Note: The italic and bold formatting above was added by me.) wp_get_attachment_image_src() indeed doesn’t necessarily return the actual width and height of the resized image file, and that the function relies upon the specific … Read more

How i can upload images to another folder?

In WordPress we can change the default location of the wp-content folder by defining a couple constants in wp-config.php about it here on Codex So if the structure on the server looks like this: /root/ 1. myblog.tld – its own directory 2. sub.myblog.tld – its own directory You can use this in your wp-config.php: define( … Read more

Media Manager 3.5 custom options

I got the solution. I used the following script: WordPress Media Manager 3.5 – default link to and altered it to my needs with this modification: (function() { var _AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay; wp.media.view.Settings.AttachmentDisplay = _AttachmentDisplay.extend({ render: function() { _AttachmentDisplay.prototype.render.apply(this, arguments); this.$el.find(‘select.link-to’).val(‘none’); this.model.set(‘link’, ‘none’); this.updateLinkTo(); this.$el.find(‘select.link-to’).parent(‘label’).hide(); this.$el.find(‘select.size option[value=full]’).hide(); this.model.set(‘size’, ‘medium’); this.updateLinkTo(); } }); })();

How to create different media uploader frames / filter library depending on a custom action

You will have to create two different media modals that are fired depending on your click event. Here is some code from a recent project where I added these buttons to the tinyMCE visual editor: jQuery(document).ready(function($){ $(document).on(‘click’, ‘.mce-my_upload_button’, upload_image_tinymce); $(document).on(‘click’, ‘.mce-my_upload_pdf_button’, upload_pdf_tinymce); function upload_image_tinymce(e) { e.preventDefault(); var $input_field = $(‘.mce-my_input_image’); var custom_uploader = wp.media.frames.file_frame = … Read more