There is a filter to use for the array containing the filename that is saved to postmeta but since there are no filters available to change the filename before it is saved you have to manually change it using rename()
.
function wpse_filter_image_resize_name( $filename ) {
$new_name = preg_replace( "/-(?<match>\\d)/ui", "_$1", $filename );
if ( rename( $filename, $new_name ) )
return $new_name;
return $filename;
}
add_filter( 'image_make_intermediate_size', 'wpse_filter_image_resize_name' );
Related Posts:
- Adding a custom image upload size and making it selected by default?
- How to register images uploaded via FTP in media library?
- Create Image Uploader for Widget
- Using file_exists to check file in Uploads
- Rename image uploads replacing “width” and “height” in filename with “medium”, “large”, “small”
- Rename image uploads with width in filename
- Debugging upload problem: What part of WP does actual image-resizing?
- How to resize image on client-side before upload?
- How to upload imagick resource to media in wordpress
- Adding a querystring to an image URL when clicking ‘insert into post’?
- Validate Uploaded Image using WordPress’ Built-in Functions?
- Get most recent media upload
- Convert all images to PNG on file upload
- Can’t upload image using media_sideload_image
- Upload multiple images to a Woocomerce product
- What is the alternative to “ when it comes to calling Media (image) files in the ‘attachment.php’ file?
- Enable custom logo upload if logo is not in header
- WordPress automatically adds links to uploaded images
- WordPress function when file is uploaded, deleted or edited
- Get featured image with custom size outside WordPress
- Images Uploaded saving onto older/previous year folders
- Convert canvas to image and upload image to server
- WordPress İmages Upload & Delete Error
- How to Make Thumbnail of Post Stay Animated
- Convert all uploaded PNG files to PNG-8 format
- Some problems in custom widget
- Checking page before applying image restrictions while uploading
- WordPress loading all local images from specific directory?
- Save the outputted image into the Media Library, with a different filename and extension
- How to resize an image server-side before upload?
- Name Input from widget displays Sidebar name instead of saved data
- How to automatically convert images to WebP on WordPress?
- Generate and upload screenshot as featured image for user-submitted post
- How do I hook into WordPress to save an uploaded photo as an alternate size to an existing photo?
- How to check if image is already stored in a site’s post database? (network)
- How to draw media details for Isotope gallery using Photoswipe
- Failed media upload: “The uploaded file was only partially uploaded.”
- Permanently remove first image from posts
- Accessing a random image via ajax
- Is it unsafe to put php in the /wp-content/uploads directory?
- WordPress media upload “HTTP error”
- How do I get images (with a thumbnail preview) to show in search results?
- Using wp_get_image_editor in a standalone script
- Modify Maximum upload file size text
- Assign a picture URL to a page via PHP
- Upload a json file in php [closed]
- Styling images coming from another blog
- Custom image upload
- How to scale image with equal width and height without distortion?
- is it possible to force wordpress to always save thumbnails as ‘jpg’ not ‘png’
- IMG src weird behaviour inside a single post loop
- Escape post image attachments added to template
- Display post image with fancybox
- Upload Image in a WordPress page using PHP
- WordPress (3.9.1) MultiSite Permissions. Is chown the answer?
- PHP code to call image Caption, Alternative Text, and Decription?
- Echo URL of large version of Featured Image
- Change the URL of an image from wp_get_attachment_image_src except in the frontpage
- how to retrieve uploaded url of zip files
- Why is $_REQUEST an empty array in admin-ajax.php?
- Best practice for migration friendly images in posts/pages?
- Get the post ID and display the images
- Responsive Header for Phone
- Upload file could not be moved to wp-content/uploads
- Why my image upload button is not working in wordpress widget area?
- How to make own crop image function for WordPress plugin
- How do I Import / Upload Files with jQuery AJAX?
- How to loop through all the attached images in a post, and get their url one by one
- Clickable image link sends people to wrong URL
- Timthumb.php image gallery not working on Multisite WordPress
- Upload multiple files in randomly generated folder using wp_upload_bits
- Change default gallery images – Currently they are displaying full size imagese
- Creating black and white copy of an image [closed]
- Display an image based on field value
- How do I increase the upload size only when editing special pages?
- How to set a featured image (thumbnail) with PHP?
- Image rotation issue (horizontal picture uploading as vertical) — Exif issue?
- Adding a ‘style=’ bit to image_send_to_editor output
- Displaying images outside the content
- Hook on file upload
- Generate images with html2canvas and the woocommerce api
- Retrieve alt text by referencing the img src
- Show next image in array if page is revisited by same logged user
- Update Images after edit via php
- How to get the url of the entry in which an image belongs
- How to include different html tags in the header for different pages?
- Crop an image after upload on custom account page
- Restrict File Type Uploads by User on Wordress via functions.php
- wp_delete_attachment not working with multiple values
- How do I routinely extract the thumbnail of the most recent post?
- add class to background image
- My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set
- Creating image gallery in wordpress
- Gallery requires a featured image but does not show it in posts/pages
- Changing 2011 theme header image based on user dropdown
- Edit Image/Image Details – Replace button missing
- Use URL query string in img src attribute
- Add/alter image attribute before render
- Upload multiple files via ajax from an HTML file input
- get_post_meta returns on side but it doesn’t return on bottom of admin page