Changing upload directory and migrating old attachments
Changing upload directory and migrating old attachments
Changing upload directory and migrating old attachments
Moving media files outside of the site directory
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
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
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(); } }); })();
I install Regenerate Thumbnails on pretty much every single website I build. It does exactly what you need and I’ve never had a single problem with it. You can either resize them all at once in bulk through a tools submenu, or you can do individual ones in the media library.
Those new files are your original file resized. When you insert an image and pick ‘medium’ ‘thumbnail’ or ‘large’, they aren’t generated on the fly or pulled out of thin air. They’re created when you upload the image to save size. The reason you can’t see these in the media section is because the media … Read more
Extract video content from post to display on front page
How to store and retrieve the attachment alignment?
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