[wp-trac] [WordPress Trac] #43227: Media uploaded to post should remove underscores and hyphens from text inserted into title attribute

WordPress Trac noreply at wordpress.org
Thu Feb 2 16:29:19 UTC 2023


#43227: Media uploaded to post should remove underscores and hyphens from text
inserted into title attribute
-------------------------+-----------------------------
 Reporter:  mrmadhat     |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Future Release
Component:  Media        |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |     Focuses:
-------------------------+-----------------------------

Comment (by abitofmind):

 When someone looks into the topic of "filename to image metadata fields in
 the Media Library" this is closely related:
 [https://github.com/WordPress/gutenberg/issues/34149 Inserting media via
 Gutenberg creates kebab case in media title vs. Upload New Media preserves
 whitespace]
 - In that case the filename has spaces on upload. (In your example the
 filename starts its lifecycle with underscores and hyphens)
 - The media title then sadly gets "-" minus instead of " " space
 characters. (Kebab case)
   - So I guess instead of writing the original filename without the
 extension into the media title, the filename sanitazion happens first, and
 then the transfer to the media title happens.
   - A pity that such a minor bug takes that long to getting fixed. (I
 myself am no developer, but a UX designer)

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/43227#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list