[wp-trac] [WordPress Trac] #58416: Media Title field should soft wrap in Media Modal: For better readability/editing of long titles.

WordPress Trac noreply at wordpress.org
Thu Jun 8 21:57:13 UTC 2023


#58416: Media Title field should soft wrap in Media Modal: For better
readability/editing of long titles.
-------------------------------------------------+-------------------------
 Reporter:  abitofmind                           |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Media                                |     Version:  3.5
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-screenshots has-       |     Focuses:
  testing-info needs-testing needs-unit-tests    |  administration
-------------------------------------------------+-------------------------

Comment (by abitofmind):

 @joedolson
 - Ad 1-3) Thanks for describing. All working as I had hoped. Nice! The
 linebreaks only live in some session variables and only the sanitized
 variant gets persisted to the database and called by all other UIs.
 Perfect!

 - Ad 3) The sanitation works fine. Whatever amount of whitespace
 linebreaks whitespace `\w*\n+\w*` gets normalized to a single whitespace.
 I tested multiple variations now, and they all brought a consistent
 result.

 @mrinal013 or @joedolson yourself
 - Please use this solution as-is and apply it for the Media Title field to
 get a textarea with this look & feel.

 @mrinal013
 1. As @joedolson put it very clearly: Line breaks are forbidden in both
 the Media Title (aka Attachment Title aka post_title for media entities)
 and the ALT Text.
 2. Without knowing your intended application in detail, possibly
 https://wordpress.org/plugins/media-library-assistant/ can has you
 covered!
   - With it you can map between or among any of those fields: EXIF ↔︎ IPTC
 ↔︎ WP standard media fields ↔︎ WP custom fields:
   - On upload, on Media Edit events, and also on demand in a bulk
 interface.
   - And you can perform powerful multi pass RegEx find/replace operations
 etc.
   - My [https://wordpress.org/support/topic/regex-replace-function-with-
 arrays-fails-with-uncaught-typeerror/#post-16771635 application as an
 example]
   - It has a very oldschool UI, but it is very powerful.
   - Sadly there is no online documentation available, but the line
 documentation, even if sometimes very technical/dry, covers really
 everything! Long learning curve, but then very satisfactory and reliable.
   - Potentially you can also use a special symbol like a bullet "•" in one
 field which does not support linebreaks into another field which supports
 line breaks, and there replace it as a line break, the possibilities are
 endless.

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


More information about the wp-trac mailing list