Disable slow media queries?

Solution for WordPress versions >= 4.7.4 (4.8) Ticket #31071 introduces patches with new filters to override three possible slow media queries, in the wp_enqueue_media() function: media_library_show_audio_playlist (@param bool|null) From the inline doc: Whether to show the button, or null to decide based on whether any audio files exist in the media library. media_library_show_video_playlist (@param bool|null) … Read more

Switch to the library tab in the media uploader

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( ‘change:custom_data’, this.refresh, this ); }, refresh: function() { this.frame.toolbar.get().refresh(); }, // called when the … Read more

How to reduce original image quality on upload?

In general I wouldn’t recommend modifying the original uploaded image files, just in case we might need to re-generate intermediate sizes. But let’s see if it’s possible 🙂 We can in general let WordPress choose the image editor, that depends on modules like GD or Imagick, through: $editor = wp_get_image_editor( $file ); but this can … Read more

Append button to WordPress Image Details modal

Here’s an alternative technique to manipulating the template. I adapted the solution below from this post. In the approach below, the print_media_templates hook, which is triggered at the bottom of wp-includes/media-template.php, is used to output some JavaScript that removes the default image details underscores template (<script type=”text/html” id=”tmpl-image-details”>) and replaces it with a duplicated version … Read more

Best image hosting service

Its not recommended often enough, but Flickr is an excellent image host for blogs as well. Their pro account costs only $25/year. You get unlimited image, video uploads and no bandwidth limit. If you don’t want your blog image uploads populating your personal photostream, you can easily create a separate account for it. You can … Read more

Image dimensions same as image size

No, it won’t create a new image that is exactly the same size.. nor should it. All the thumbnail, medium, and large images are resized images, by definition. Since the original image is already 600×600, there’s no point in creating another file at the same size, but with a lower quality (remember that JPEG compression … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)