Width 100%: Aspect ratio of image

A + C: img.resize-proportionally { max-width: 100%; height: auto; } As an aside, for the above to work, you shouldn’t attempt B. Having width and height attributes in the img tag is good.

WordPress Image Editor doesn’t update thumbs specified with `add_image_size()`

Like it was said, WordPress only generate thumbnails in the new sizes of the new media uploaded. The old images’ thumbs doesn’t get generated automatically. For this situation, I strongly recommend the following plugin: http://wordpress.org/plugins/force-regenerate-thumbnails/ It is pretty simple and unobtrusive. It just adds a new item on the wp-admin menu for you to regenerate … Read more

Image resize with image url

u can use this: function wpse128538_resize($url, $width, $height = null, $crop = null, $single = true) { //validate inputs if (!$url OR !$width) return false; //define upload path & dir $upload_info = wp_upload_dir(); $upload_dir = $upload_info[‘basedir’]; $upload_url = $upload_info[‘baseurl’]; //check if $img_url is local if (strpos($url, $upload_url) === false) return false; //define path of image … Read more

Filter Media Library by author or post_parent

The only way to do it is using a query filter I think function wpse156319_posts_where( $where, $query ) { global $wpdb; $where .= $wpdb->prepare( ‘ AND (‘ . $wpdb->posts . ‘.post_parent = %s OR ‘ . $wpdb->posts . ‘.post_author = %s)’, $_POST[‘id’], get_current_user_id() ); return $where; } which you just add in the ajax_query_attachments_args instead … Read more