You could create a plugin for the editor to achieve that. In JS there’s the onpaste event. These would be the basic steps:
- listen for onpaste.
- Find the closest heading element up the tree from the target element being pasted into.
- Default to page/post title if no heading elements are found and then back to the default naming convention if all else fails.
- Send the name you created based on that information back to server and trigger renaming the file with the PHP code you made.
creating an input box would be a little bit more indepth to do in gutenberg – but automatically naming them seems like it would be more ideal for you anyways.
Related Posts:
- Set default image link target in Gutenberg image block
- Is there a hook which fires after all thumbnails are generated?
- Saving the pre-sanitized filename of an attachment as the Title or Caption
- How to get the Gallery form/section just like in Gutenberg block?
- How to delete resized (cropped) image uploads and prevent future resizing?
- WordPress adding scaled images that don’t exist (1536×1536 and 2048×2048)
- After Moving a Site to Another Domain, All Images Are Lost
- Using Images in WordPress – Best Practices
- Prevent large image uploads
- Modifying an uploaded image with ‘wp_get_image_editor’ and ‘wp_handle_upload_prefilter’
- Prevent image upload unless exact size
- Use Media upload in custom widget on wordpress 3.5
- How to copy and paste a picture found on the web to wordpress easily
- How can I add the “Use as featured image” to a custom metabox?
- Apply image width to tag
- Image resize with image url
- How can you upload an image from within a settings page?
- How to increase media image scale limit?
- How to upload image without post ID using the new media uploader?
- Uploading an image as featured image from frontend form
- How to upload images from my directory into my wordpress?
- could not upload image in media library
- Uploading images: ‘ø’ get replaced with ‘ø’
- Why images/photos after being uploaded to my wordpress site get slightly blurry?
- SSL: How to make customizer images Protocol Relative in WordPress?
- @wordpress/create-block image url in css
- Is there a better way to implement responsive images than what WordPress uses by default?
- Extend core block attributes in post content
- Images in upload folder with hexadecimal names
- hardcrop images in gutenberg “latest posts” block
- Restrict Image Uploads to a Certain File Type
- Rename media files generated during upload
- add_image_size() to crop images into squares?
- Add “data-” attribute to image links
- wordpress media library shows empty images
- Upload .doc to blog
- How to remove Geo Tagging on image uploads, but not other EXIF data?
- Trying to create a mouseover effect in html using Gutenberg editor
- media sideload image and Google Content
- image in my post disappeared after I upload website to remote server
- Disable all resizing and compression
- Force minimum image size and aspect ratio when uploading images
- having issue while uploading An error occured in the upload. Please try again later
- How to change image atributes right before an image to be saved?
- Add width & height attributes to Gutenberg’s image output?
- How to filter the image embed code based on link type
- Images in Media aren’t showing, not broken
- How to replace images?
- Upload Image using wp_insert_attachment and file url don’t have file extension
- using media_sideload_image with a file from theme directory
- Is there any way to Integrate WordPress with Imgur for Image Hosting
- Blank upload.php page
- Add custom text in the media library image meta area
- Upload image without media-upload [duplicate]
- Tinymce and uploading local pictures
- Unable to upload images to the Media Library. Getting this erron on the console wp-admin/async-upload.php 403 (Forbidden)
- Images give 404 after changing default domain
- How to set uploaded image as featured image wordpress
- Create a post from every image in my media gallery
- Autosort uploads in galleries by filename
- Is there a wordpress filter to edit the markup of inline images?
- How can I check if the first block is an image aligned left or right?
- Not seeing text alignment option in Image block
- Change Image folder Locations
- “HTTP Error” or Network Error (tcp_error) when uploading image
- Images uploading from media going in wrong folder
- How does wordpress name resized image copies?
- adding image to post thumbnail from another server
- Metabox image upload value
- Making a parent directory writable by the server
- Change Image Size option in the settings in bulk
- How to display a warning when an uploaded image is too small?
- How to disable a WP Image Block to link to itself?
- Large uploaded images not resizing?
- cant upload media/pictures to my wordpress site, cant upload anything to my database
- Rebuilding core image block
- WordPress on IIS works except for image upload widget: Win 10 Pro
- Unset image sizes before images are uploaded
- unsharp thumbnails after uploading image
- How to delete original image file after upload and resize
- Wrap post images with a link, not figure (image_send_to_editor doesn’t work)
- An error has occurred during the upload process in wordpress 5.3.2
- Convert multiple image blocks to gallery block in Gutenberg?
- Hook for validating and rejecting frontend image upload
- Images uploaded via Gutenberg image block are cropped
- How to disable post-thumbnail from generation?
- Getting the Select and Crop Functionality Using Custom Fields
- After I upload a file to library its name converted to dashes
- Only User Upload image Http Error
- Rename uploads filenames to POST-ID on upload
- See the all uploaded images of a user as an admin
- Broken Media Library
- 3.5.x Theme Customize: Handling Custom Control Requests
- Transfered live site to new server and images are not showing
- Limit files uploaded per folder
- Media upload error
- Best Photoshop-WordPress workflow for editing images without re-upload [closed]
- Gutenberg block HTML image rendering override
- Can’t upload svg files in WordPress
- Random images from uploads folder and subfolder