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?
- Image Upload from URL
- How to extend the gallery block in Gutenberg?
- Upload images to remote server
- Each custom image size in custom upload directory?
- How to delete resized (cropped) image uploads and prevent future resizing?
- WordPress adding scaled images that don’t exist (1536×1536 and 2048×2048)
- Download an image from a webpage to the default uploads folder
- After Moving a Site to Another Domain, All Images Are Lost
- Uploaded images don’t show in Media Library if there are special characters in IPTC Keywords
- Allow contributor role to upload images and not edit already published articles
- get_post_gallery with Gutenberg
- Limit image resolution on upload
- Rename files on upload
- How to insert images into posts without using Add Media dialog
- Using Images in WordPress – Best Practices
- Media Upload Folder – how to manage
- Prevent large image uploads
- Modifying an uploaded image with ‘wp_get_image_editor’ and ‘wp_handle_upload_prefilter’
- Upload multiple images in a custom metabox
- Remove title attribute from images
- hook into completed image upload filter
- Prevent image upload unless exact size
- getting uploaded SVG dimensions on front-end
- Adding upload button in metabox
- Use Media upload in custom widget on wordpress 3.5
- Automating a Daily Picture Blog?
- How to copy and paste a picture found on the web to wordpress easily
- Images uploading to wrong folder
- Get attachment ID of author_meta image – Attachment Metadata
- How to include externally hosted images into a gallery block
- Replace all of post’s image URLs with upload directory URLs
- 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 do i upload an image and return the image id?
- Alter media caption/description conflict in WordPress?
- Restrict the number of images to upload per post
- WordPress function: limit size, only jpg, jpeg, limit of uploaded files per account
- How to increase media image scale limit?
- Frontend image uploading from edit profile page. (goldenapples)
- Alter image output in content
- How to upload image without post ID using the new media uploader?
- How to Display an Image Uploaded through a Meta Box in a Template?
- HTTP Error when trying to upload image
- Rename attachments during upload
- Filter to modify post_title after image upload?
- Wrap all post images inside a div element
- How to link Gutenberg Gallery images To Media file automatically?
- 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
- Automatically Add Caption in image
- Uploading images to Media Library fails with Memory Exhausted
- Edit image preview is not displayed
- How to add a media with PHP
- When Uploading JPEGs, Does WordPress Compress the Original Image?
- Rename image during upload using date and time stamp?
- Uploading images: ‘ø’ get replaced with ‘ø’
- Why images/photos after being uploaded to my wordpress site get slightly blurry?
- How to Add extra option to Image Block Settings?
- How to disable the suffix “-scaled” which is being added at the end of each uploaded image?
- SSL: How to make customizer images Protocol Relative in WordPress?
- @wordpress/create-block image url in css
- Insert image in comment reply
- Is there a better way to implement responsive images than what WordPress uses by default?
- How to set a Minimum Image Dimension for Uploading
- What’s the best “insert all images” plugin?
- How to remove buttons from gutenberg toolbar
- Is 700,00 jpgs too many for a WordPress site.?
- Extend core block attributes in post content
- Different upload path per file type
- Animated Gif image not uploading correctly
- Images in upload folder with hexadecimal names
- Gutenberg editor get post featured image by id
- Hook to get image filename when it is uploaded
- hardcrop images in gutenberg “latest posts” block
- Frontend Post – Allow Only Image File Upload
- Restrict Image Uploads to a Certain File Type
- Rename media files generated during upload
- add_image_size() to crop images into squares?
- HTML tags in WordPress image caption
- HTTP Error when uploading files above 7mb unless using GD Image Editor
- Add “data-” attribute to image links
- wordpress media library shows empty images
- media_sideload_image with rewritten urls?
- Upload .doc to blog
- How to order images in a post in WordPress 3.3?
- Is there a plugin or simple way to add a multiple images metabox to a post?
- How to remove Geo Tagging on image uploads, but not other EXIF data?
- How can I upload an image for background use using the Theme Editor in WordPress?
- Bulk edit Gutenberg single images to change from linking to media file to attachment page
- Trying to create a mouseover effect in html using Gutenberg editor
- media sideload image and Google Content
- How to set a contact forms total size limit
- Generating different dimension images while uploading image file from custom plugin page