[wp-trac] [WordPress Trac] #60158: The description field for media doesn't automatically make paragraphs in the generated code

WordPress Trac noreply at wordpress.org
Wed Dec 27 11:47:53 UTC 2023


#60158: The description field for media doesn't automatically make paragraphs in
the generated code
---------------------------+-----------------------------
 Reporter:  juliemoynat    |      Owner:  (none)
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Media          |    Version:  6.4.2
 Severity:  normal         |   Keywords:
  Focuses:  accessibility  |
---------------------------+-----------------------------
 There are two ways to edit a media:

 - via a modal window where all the contribution fields are only simple
 textareas;
 - via a dedicated web page where "alternative text" and "caption" fields
 are simple textareas and the "description" field is a WYSIWYG editor in
 text mode where TinyMCE is deactivated.

 For some media, you can need to add a long description just like a
 transcript (for videos, audios, complex images like infographic, etc.).
 So, in these cases, the description field can be used because it's totally
 appropriate.

 But, there is a problem: usually, in editor fields, the paragraphs (<p>
 elements) are automatically added when you display the web page (in the
 front view). In this field, they are not.

 For accessibility reason, paragraphs need to be HTML paragraphs
 ([https://www.w3.org/WAI/WCAG21/Understanding/info-and-relationships.html
 WCAG Success Criterion 1.3.1: Info and Relationships (level A)]).

 I've tried to modify the code in the core to add TinyMCE that is
 explicitly deactivated and this is fixing the problem.

 It's in wp-admin/includes/media.php, on line 3261 where you can just
 change "false" to "true" for "tinymce":

 {{{#!php
 <?php
 $quicktags_settings = array( 'buttons' =>
 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' );
 $editor_args        = array(
         'textarea_name' => 'content',
         'textarea_rows' => 5,
         'media_buttons' => false,
         'tinymce'       => false,
         'quicktags'     => $quicktags_settings,
 );
 }}}

 So, is it possible to activate TinyMCE for this field? Why is it
 deactivated?
 Or, if it's not possible, is it possible to make this option hookable?

 Thank you

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60158>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list