Converting Attachment to Images?

Although it shouldn’t change based on your theme, this may be an issue caused by how this new theme handles images. As of WordPress 3.5, when you add a media object such as an image, there’s a sidebar that appears on the right. Underneath the “Attachment Details” (preview, title, caption, etc.) there’s a section called … Read more

Images in upload folder with hexadecimal names

Testing the plugin provided in this Answer, I just saw that media_handle_sideload generates exactly this pattern, jpeg extension as well (instead of jpg). Following its path through the core, it seems that only the filter wp_handle_upload could be used for dealing with that. But a brief research shows an interesting use of wp_handle_upload_prefilter: Rename files … Read more

Change code to display image attachment page

As pointed in the other answer, you should not have prettyPhoto part The link should be changed to utilize the function get_attachment_link Basically change this line in your code $link = ‘<a href=”‘.get_attachment_link($id).'”>’.wp_get_attachment_image($id, $size, false).'</a>’;

Image File Names

Those numeric suffixes are image sizes corresponding to the width/height values in wp-admin->Settings->Media. It is part of the thumbnail system. If the right image manipulation libraries are installed on the server, WordPress will create these different image sizes when you upload an image. The idea is that you can then load appropriately sized images for … Read more

Display latest 12 images from media library

Simply omit the parent value. $args = array( ‘post_type’ => ‘attachment’, ‘post_status’ => ‘published’, ‘numberposts’ => 12, ); Check the documentation for other arguments: Function_Reference/get_posts. Maybe you’d like to use the PHP command shuffle, like shuffle( $attachments );.

3.5 media.editor: what is the event listener for choosing an image?

Found out that overriding some of the wp.media.editor objects methods is the best solution, because it allows you to customize the event handling, but will also preserve a lot of the backend processing and handling that WP has in place for processing images. I basically overrode wp.media.editor.send.attachment, wp.media.gallery.shortcode with my own methods, and wp.media.editor.remove, in … Read more