Remove duplicate images from media library.
I know its too late for this answer, but can help others, you can use Media Deduper plugin to index and find duplicated image , it is also good enough to link the post to existing image.
I know its too late for this answer, but can help others, you can use Media Deduper plugin to index and find duplicated image , it is also good enough to link the post to existing image.
Even if is not very flexible filter you can use the gettex hook. Only be aware that this filter runs for every string being translated, so can affect performarce if over-used. To narrow the performance impact you can add it only of admin footer, and remove it just after had use it: add_action(‘admin_footer’, function() { … Read more
I have solved this by changing wp.media.editor.open() to meta_image_frame.open(). It’s now working fine. But I am not sure what was the error before.
640px is the content size set in your functions.php. Here is an example of the content width set in the bundled theme twentyfourteen in twentyfourteen/functions.php#L28 if ( ! isset( $content_width ) ) { $content_width = 474; } In this example, the image size will be 474 px. The content size will be the size used … Read more
Here’s some code that will set the focus to the search field when clicking on the Add Media button or when opening the media modal when setting a featured image. Add this code to your theme’s functions.php or to a plugin to use it. Note: This is an updated version of my original solution. I … Read more
To solve ” TypeError: this.activateMode is not a function ” error, add lodash as an external in your webpack config file. externals: { ‘lodash’: ‘lodash’ }
I use the Media Library Categories plugin to add categories. It does a wonderful job of adding category functionality, but the code could be improved upon and custom implementation requires some knowledge of PHP, as it only provides you with a shortcode and no documentation. This Question, maybe be able to help you if you … Read more
For image formats that are only used for a small fraction of the images, I suggest using an on-the-fly image resizer. Preferrably one that caches the images so that you only have to resize them once. I use TimThumb for a number of projects, and it’s been good enough for me.
WordPress has an hook for save meta data an attachment; an small example; like the post_data on save posts. // Construct the attachment array $attachment = array_merge( array( ‘post_mime_type’ => $type, ‘guid’ => $url, ‘post_parent’ => $post_id, ‘post_title’ => $title, ‘post_content’ => $content, ), $post_data ); // Save the data $id = wp_insert_attachment($attachment, $file, $post_id); … Read more
I don’t see any way of hooking into this. Following the lead of wp_get_attachment_image takes nowhere… // wp-admin/includes/class-wp-media-list-table.php // line 200 case ‘icon’: $attributes=”class=”column-icon media-icon”” . $style; ?> <td <?php echo $attributes ?>><?php if ( $thumb = wp_get_attachment_image( $post->ID, array( 80, 60 ), true ) ) { if ( $this->is_trash || ! $user_can_edit ) { … Read more